Older GCC doesn't accept use of this in constexpr.

Fix #11517
This commit is contained in:
Kohei Takahashi
2015-08-03 00:03:40 +09:00
parent 24f527d401
commit 8242c688e7
3 changed files with 13 additions and 3 deletions

View File

@ -9,6 +9,8 @@
#if !defined(FUSION_IGNORE_07192005_0329)
#define FUSION_IGNORE_07192005_0329
#include <boost/fusion/support/config.hpp>
namespace boost { namespace fusion
{
// Swallows any assignment (by Doug Gregor)
@ -17,7 +19,7 @@ namespace boost { namespace fusion
struct swallow_assign
{
template<typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED
swallow_assign const&
operator=(const T&) const
{

View File

@ -88,4 +88,12 @@ namespace std
}
#endif
// Workaround for older GCC that doesn't accept `this` in constexpr.
#if BOOST_WORKAROUND(BOOST_GCC, < 40700)
#define BOOST_FUSION_CONSTEXPR_THIS
#else
#define BOOST_FUSION_CONSTEXPR_THIS BOOST_CONSTEXPR
#endif
#endif

View File

@ -34,7 +34,7 @@ namespace boost { namespace fusion
}
template <typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED
unused_type const&
operator=(T const&) const BOOST_NOEXCEPT
{
@ -49,7 +49,7 @@ namespace boost { namespace fusion
return *this;
}
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED
unused_type const&
operator=(unused_type const&) const BOOST_NOEXCEPT
{