From e4d3cba6dd65d54e40751ed1e336cdd761620682 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 7 Feb 2018 19:14:50 +0000 Subject: [PATCH 1/5] Binary Operators: switch to the "detection idiom" if the compiler supports it. This gives us almost perfect fidelity in the detection and solves the known issues for binary operators. Also fixes: https://svn.boost.org/trac10/ticket/13012. --- .../detail/has_binary_operator.hpp | 84 +++++++++++++--- include/boost/type_traits/has_minus.hpp | 93 ++++++++++++++++++ .../boost/type_traits/has_minus_assign.hpp | 95 ++++++++++++++++++- 3 files changed, 256 insertions(+), 16 deletions(-) diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index 039a6bb..3af3657 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -7,19 +7,7 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // cannot include this header without getting warnings of the kind: // gcc: @@ -37,12 +25,77 @@ # pragma GCC system_header #elif defined(BOOST_MSVC) # pragma warning ( push ) -# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 4133) # if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) # pragma warning ( disable : 6334) # endif #endif +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + + namespace binary_op_detail { + + struct dont_care; + + template > + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {}; + + template + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)::type>() BOOST_TT_TRAIT_OP std::declval::type>())> > + : public boost::integral_constant::type>() BOOST_TT_TRAIT_OP std::declval::type>()), Ret>::value> {}; + + template > + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {}; + + template + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)::type>() BOOST_TT_TRAIT_OP std::declval::type>())> > + : public boost::integral_constant::type>() BOOST_TT_TRAIT_OP std::declval::type>())>::value> {}; + + template > + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {}; + + template + struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)::type>() BOOST_TT_TRAIT_OP std::declval::type>())> > + : public boost::true_type {}; + + } + + template + struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail:: BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) {}; + template + struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail:: BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) {}; + template + struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail:: BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) {}; + + +} + +#else + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace boost { namespace detail { @@ -217,6 +270,9 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant +#include + +// cannot include this header without getting warnings of the kind: +// gcc: +// warning: value computed is not used +// warning: comparison between signed and unsigned integer expressions +// msvc: +// warning C4018: '<' : signed/unsigned mismatch +// warning C4244: '+=' : conversion from 'double' to 'char', possible loss of data +// warning C4547: '*' : operator before comma has no effect; expected operator with side-effect +// warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) +// warning C4804: '<' : unsafe use of type 'bool' in operation +// warning C4805: '==' : unsafe mix of type 'bool' and type 'char' in operation +// cannot find another implementation -> declared as system header to suppress these warnings. +#if defined(__GNUC__) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 4133) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif +#endif + +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + + namespace binary_op_detail { + + struct dont_care; + + template > + struct has_minus_ret_imp : public boost::false_type {}; + + template + struct has_minus_ret_imp::type>() - std::declval::type>())> > + : public boost::integral_constant::type>() - std::declval::type>()), Ret>::value> {}; + + template > + struct has_minus_void_imp : public boost::false_type {}; + + template + struct has_minus_void_imp::type>() - std::declval::type>())> > + : public boost::integral_constant::type>() - std::declval::type>())>::value> {}; + + template > + struct has_minus_dc_imp : public boost::false_type {}; + + template + struct has_minus_dc_imp::type>() - std::declval::type>())> > + : public boost::true_type {}; + + template + struct has_minus_ret_filter : public boost::binary_op_detail::has_minus_ret_imp {}; + template + struct has_minus_ret_filter : public boost::binary_op_detail::has_minus_void_imp {}; + template + struct has_minus_ret_filter : public boost::binary_op_detail::has_minus_dc_imp {}; + + template + struct has_minus_void_ptr_filter : public boost::binary_op_detail::has_minus_ret_filter {}; + template + struct has_minus_void_ptr_filter : public boost::false_type {}; + + } + + template + struct has_minus : + public boost::binary_op_detail::has_minus_void_ptr_filter< + T, U, Ret, + boost::is_void::type>::type>::value + || boost::is_void::type>::type>::value> {}; + + +} + +#else + + #define BOOST_TT_TRAIT_NAME has_minus #define BOOST_TT_TRAIT_OP - #define BOOST_TT_FORBIDDEN_IF\ @@ -50,6 +141,7 @@ )\ ) +#define BOOST_TT_FORBIDDEN_IF_NEW (boost::is_void::type>::type>::value || boost::is_void::type>::type>::value) #include @@ -58,3 +150,4 @@ #undef BOOST_TT_FORBIDDEN_IF #endif +#endif diff --git a/include/boost/type_traits/has_minus_assign.hpp b/include/boost/type_traits/has_minus_assign.hpp index b53474e..2f89163 100644 --- a/include/boost/type_traits/has_minus_assign.hpp +++ b/include/boost/type_traits/has_minus_assign.hpp @@ -6,8 +6,98 @@ // // See http://www.boost.org/libs/type_traits for most recent version including documentation. -#ifndef BOOST_TT_HAS_MINUS_ASSIGN_HPP_INCLUDED -#define BOOST_TT_HAS_MINUS_ASSIGN_HPP_INCLUDED +#ifndef BOOST_TT_has_minus_assign_ASSIGN_HPP_INCLUDED +#define BOOST_TT_has_minus_assign_ASSIGN_HPP_INCLUDED + +#include +#include + +// cannot include this header without getting warnings of the kind: +// gcc: +// warning: value computed is not used +// warning: comparison between signed and unsigned integer expressions +// msvc: +// warning C4018: '<' : signed/unsigned mismatch +// warning C4244: '+=' : conversion from 'double' to 'char', possible loss of data +// warning C4547: '*' : operator before comma has no effect; expected operator with side-effect +// warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) +// warning C4804: '<' : unsafe use of type 'bool' in operation +// warning C4805: '==' : unsafe mix of type 'bool' and type 'char' in operation +// cannot find another implementation -> declared as system header to suppress these warnings. +#if defined(__GNUC__) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 4133) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif +#endif + +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + + namespace binary_op_detail { + + struct dont_care; + + template > + struct has_minus_assign_ret_imp : public boost::false_type {}; + + template + struct has_minus_assign_ret_imp::type>() -= std::declval::type>())> > + : public boost::integral_constant::type>() -= std::declval::type>()), Ret>::value> {}; + + template > + struct has_minus_assign_void_imp : public boost::false_type {}; + + template + struct has_minus_assign_void_imp::type>() -= std::declval::type>())> > + : public boost::integral_constant::type>() -= std::declval::type>())>::value> {}; + + template > + struct has_minus_assign_dc_imp : public boost::false_type {}; + + template + struct has_minus_assign_dc_imp::type>() -= std::declval::type>())> > + : public boost::true_type {}; + + template + struct has_minus_assign_ret_filter : public boost::binary_op_detail::has_minus_assign_ret_imp {}; + template + struct has_minus_assign_ret_filter : public boost::binary_op_detail::has_minus_assign_void_imp {}; + template + struct has_minus_assign_ret_filter : public boost::binary_op_detail::has_minus_assign_dc_imp {}; + + template + struct has_minus_assign_void_ptr_filter : public boost::binary_op_detail::has_minus_assign_ret_filter {}; + template + struct has_minus_assign_void_ptr_filter : public boost::false_type {}; + + } + + template + struct has_minus_assign : + public boost::binary_op_detail::has_minus_assign_void_ptr_filter< + T, U, Ret, + boost::is_void::type>::type>::value + || boost::is_void::type>::type>::value> {}; + + +} + +#else #define BOOST_TT_TRAIT_NAME has_minus_assign #define BOOST_TT_TRAIT_OP -= @@ -63,3 +153,4 @@ #undef BOOST_TT_FORBIDDEN_IF #endif +#endif From e9399adefa4b3f2e8d2f549c375aa63ab6dce93c Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 7 Feb 2018 19:50:26 +0000 Subject: [PATCH 2/5] Add tests for improved binary operators. --- test/has_binary_operators.hpp | 19 +++++++++++++++++++ test/has_equal_to_test.cpp | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/test/has_binary_operators.hpp b/test/has_binary_operators.hpp index 681cde9..165dad9 100644 --- a/test/has_binary_operators.hpp +++ b/test/has_binary_operators.hpp @@ -86,6 +86,14 @@ inline bool operator BOOST_TT_TRAIT_OP (const C&, void*) { return true; } inline bool operator BOOST_TT_TRAIT_OP (void*, const D&) { return true; } inline bool operator BOOST_TT_TRAIT_OP (const C&, const D&) { return true; } +struct private_op { private: void operator BOOST_TT_TRAIT_OP (const private_op&); }; + +struct ambiguous_A +{ +}; +bool operator BOOST_TT_TRAIT_OP (const ambiguous_A&, const ambiguous_A&); +struct ambiguous_B { operator ambiguous_A()const; }; + //class internal_private { ret operator BOOST_TT_TRAIT_OP (const internal_private&) const; }; void common() { @@ -144,6 +152,17 @@ void common() { TEST_TR(Derived2, bool, true); // compile time error // TEST_T(internal_private, false); +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +// There are some things that pass that wouldn't otherwise do so: +#if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) + TEST_TR(private_op, bool, false); + TEST_T(private_op, false); +#endif + TEST_TR(ambiguous_A, bool, true); + TEST_T(ambiguous_A, true); + TEST_TR(ambiguous_B, bool, true); + TEST_T(ambiguous_B, true); +#endif } } diff --git a/test/has_equal_to_test.cpp b/test/has_equal_to_test.cpp index d987065..08ca61b 100644 --- a/test/has_equal_to_test.cpp +++ b/test/has_equal_to_test.cpp @@ -219,6 +219,15 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; +#ifndef BOOST_MSVC + TEST_TR(decltype(f), bool, true); +#else + TEST_TR(decltype(f), bool, false); +#endif +#endif } TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) From 98d6eaf1e9e2bf15ddf4cd76af228dc413dbade7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 8 Feb 2018 09:02:05 +0000 Subject: [PATCH 3/5] Add missing function bodies to test cases - it suppresses gcc warnings. --- test/has_binary_operators.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/has_binary_operators.hpp b/test/has_binary_operators.hpp index 165dad9..d7082c9 100644 --- a/test/has_binary_operators.hpp +++ b/test/has_binary_operators.hpp @@ -86,13 +86,13 @@ inline bool operator BOOST_TT_TRAIT_OP (const C&, void*) { return true; } inline bool operator BOOST_TT_TRAIT_OP (void*, const D&) { return true; } inline bool operator BOOST_TT_TRAIT_OP (const C&, const D&) { return true; } -struct private_op { private: void operator BOOST_TT_TRAIT_OP (const private_op&); }; +struct private_op { private: void operator BOOST_TT_TRAIT_OP (const private_op&) {} }; struct ambiguous_A { }; -bool operator BOOST_TT_TRAIT_OP (const ambiguous_A&, const ambiguous_A&); -struct ambiguous_B { operator ambiguous_A()const; }; +inline bool operator BOOST_TT_TRAIT_OP (const ambiguous_A&, const ambiguous_A&) { return true; } +struct ambiguous_B { operator ambiguous_A()const { return ambiguous_A(); } }; //class internal_private { ret operator BOOST_TT_TRAIT_OP (const internal_private&) const; }; From 94e54c030dd91e64af28c5a2cfe16f1ef2de9ee3 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 8 Feb 2018 19:21:13 +0000 Subject: [PATCH 4/5] binary operators: disable new code for older gcc versions --- include/boost/type_traits/detail/has_binary_operator.hpp | 2 +- include/boost/type_traits/has_minus.hpp | 2 +- include/boost/type_traits/has_minus_assign.hpp | 2 +- test/has_binary_operators.hpp | 2 +- test/has_equal_to_test.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/boost/type_traits/detail/has_binary_operator.hpp b/include/boost/type_traits/detail/has_binary_operator.hpp index 3af3657..0a21144 100644 --- a/include/boost/type_traits/detail/has_binary_operator.hpp +++ b/include/boost/type_traits/detail/has_binary_operator.hpp @@ -31,7 +31,7 @@ # endif #endif -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) #include #include diff --git a/include/boost/type_traits/has_minus.hpp b/include/boost/type_traits/has_minus.hpp index a82618f..912749c 100644 --- a/include/boost/type_traits/has_minus.hpp +++ b/include/boost/type_traits/has_minus.hpp @@ -34,7 +34,7 @@ # endif #endif -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) #include #include diff --git a/include/boost/type_traits/has_minus_assign.hpp b/include/boost/type_traits/has_minus_assign.hpp index 2f89163..fcca10e 100644 --- a/include/boost/type_traits/has_minus_assign.hpp +++ b/include/boost/type_traits/has_minus_assign.hpp @@ -34,7 +34,7 @@ # endif #endif -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) #include #include diff --git a/test/has_binary_operators.hpp b/test/has_binary_operators.hpp index d7082c9..3df8a82 100644 --- a/test/has_binary_operators.hpp +++ b/test/has_binary_operators.hpp @@ -152,7 +152,7 @@ void common() { TEST_TR(Derived2, bool, true); // compile time error // TEST_T(internal_private, false); -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) // There are some things that pass that wouldn't otherwise do so: #if !BOOST_WORKAROUND(BOOST_MSVC, < 1910) TEST_TR(private_op, bool, false); diff --git a/test/has_equal_to_test.cpp b/test/has_equal_to_test.cpp index 08ca61b..35a5dfd 100644 --- a/test/has_equal_to_test.cpp +++ b/test/has_equal_to_test.cpp @@ -219,7 +219,7 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int* const &, int const & >::value), 1); -#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) // There are some things that pass that wouldn't otherwise do so: auto f = []() {}; #ifndef BOOST_MSVC From fb4430512d26681a7b06c434c793f98567a8ad4a Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 9 Feb 2018 18:20:23 +0000 Subject: [PATCH 5/5] Fix up -= and += detection for clang. --- .../boost/type_traits/has_minus_assign.hpp | 4 +- include/boost/type_traits/has_plus_assign.hpp | 90 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/has_minus_assign.hpp b/include/boost/type_traits/has_minus_assign.hpp index fcca10e..0ae6720 100644 --- a/include/boost/type_traits/has_minus_assign.hpp +++ b/include/boost/type_traits/has_minus_assign.hpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -92,7 +93,8 @@ namespace boost public boost::binary_op_detail::has_minus_assign_void_ptr_filter< T, U, Ret, boost::is_void::type>::type>::value - || boost::is_void::type>::type>::value> {}; + || boost::is_void::type>::type>::value + || (boost::is_pointer::type>::value && boost::is_pointer::type>::value)> {}; } diff --git a/include/boost/type_traits/has_plus_assign.hpp b/include/boost/type_traits/has_plus_assign.hpp index 5ef6f23..faeb220 100644 --- a/include/boost/type_traits/has_plus_assign.hpp +++ b/include/boost/type_traits/has_plus_assign.hpp @@ -9,6 +9,95 @@ #ifndef BOOST_TT_HAS_PLUS_ASSIGN_HPP_INCLUDED #define BOOST_TT_HAS_PLUS_ASSIGN_HPP_INCLUDED +#include +#include + +// cannot include this header without getting warnings of the kind: +// gcc: +// warning: value computed is not used +// warning: comparison between signed and unsigned integer expressions +// msvc: +// warning C4018: '<' : signed/unsigned mismatch +// warning C4244: '+=' : conversion from 'double' to 'char', possible loss of data +// warning C4547: '*' : operator before comma has no effect; expected operator with side-effect +// warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) +// warning C4804: '<' : unsafe use of type 'bool' in operation +// warning C4805: '==' : unsafe mix of type 'bool' and type 'char' in operation +// cannot find another implementation -> declared as system header to suppress these warnings. +#if defined(__GNUC__) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 4133) +# if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) +# pragma warning ( disable : 6334) +# endif +#endif + +#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + + namespace binary_op_detail { + + struct dont_care; + + template > + struct has_plus_assign_ret_imp : public boost::false_type {}; + + template + struct has_plus_assign_ret_imp::type>() += std::declval::type>())> > + : public boost::integral_constant::type>() += std::declval::type>()), Ret>::value> {}; + + template > + struct has_plus_assign_void_imp : public boost::false_type {}; + + template + struct has_plus_assign_void_imp::type>() += std::declval::type>())> > + : public boost::integral_constant::type>() += std::declval::type>())>::value> {}; + + template > + struct has_plus_assign_dc_imp : public boost::false_type {}; + + template + struct has_plus_assign_dc_imp::type>() += std::declval::type>())> > + : public boost::true_type {}; + + template + struct has_plus_assign_filter_ret : public boost::binary_op_detail:: has_plus_assign_ret_imp {}; + template + struct has_plus_assign_filter_ret : public boost::binary_op_detail:: has_plus_assign_void_imp {}; + template + struct has_plus_assign_filter_ret : public boost::binary_op_detail:: has_plus_assign_dc_imp {}; + + template + struct has_plus_assign_filter_impossible : public boost::binary_op_detail:: has_plus_assign_filter_ret {}; + template + struct has_plus_assign_filter_impossible : public boost::false_type {}; + + } + + template + struct has_plus_assign : public boost::binary_op_detail:: has_plus_assign_filter_impossible ::type>::value && boost::is_pointer::type>::value && !boost::is_same::type>::type>::value> {}; + +} + +#else + #define BOOST_TT_TRAIT_NAME has_plus_assign #define BOOST_TT_TRAIT_OP += #define BOOST_TT_FORBIDDEN_IF\ @@ -64,3 +153,4 @@ #undef BOOST_TT_FORBIDDEN_IF #endif +#endif