Merge pull request #96 from Flast/bugfix/issue-11517

Fix #11517
This commit is contained in:
Joel de Guzman
2015-08-03 08:48:56 +08:00
3 changed files with 15 additions and 5 deletions

View File

@ -9,6 +9,8 @@
#if !defined(FUSION_IGNORE_07192005_0329) #if !defined(FUSION_IGNORE_07192005_0329)
#define FUSION_IGNORE_07192005_0329 #define FUSION_IGNORE_07192005_0329
#include <boost/fusion/support/config.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
// Swallows any assignment (by Doug Gregor) // Swallows any assignment (by Doug Gregor)
@ -17,7 +19,7 @@ namespace boost { namespace fusion
struct swallow_assign struct swallow_assign
{ {
template<typename T> template<typename T>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED
swallow_assign const& swallow_assign const&
operator=(const T&) const operator=(const T&) const
{ {
@ -27,7 +29,7 @@ namespace boost { namespace fusion
} }
// "ignore" allows tuple positions to be ignored when using "tie". // "ignore" allows tuple positions to be ignored when using "tie".
BOOST_CONSTEXPR detail::swallow_assign const ignore = detail::swallow_assign(); BOOST_CONSTEXPR_OR_CONST detail::swallow_assign ignore = detail::swallow_assign();
}} }}
#endif #endif

View File

@ -88,4 +88,12 @@ namespace std
} }
#endif #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 #endif

View File

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