diff --git a/include/boost/type_traits/detail/has_postfix_operator.hpp b/include/boost/type_traits/detail/has_postfix_operator.hpp index ba0358f..1812416 100644 --- a/include/boost/type_traits/detail/has_postfix_operator.hpp +++ b/include/boost/type_traits/detail/has_postfix_operator.hpp @@ -7,6 +7,59 @@ // See http://www.boost.org/libs/type_traits for most recent version including documentation. #include +#include + +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +#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) > > + : public boost::integral_constant::type>() BOOST_TT_TRAIT_OP), 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)> > + : public boost::integral_constant::type>() BOOST_TT_TRAIT_OP)>::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)> > + : 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 @@ -193,3 +246,5 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant +#include + +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +#include +#include +#include +#include +#include +#include + +#ifdef BOOST_GCC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated" +#endif +#if defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4804) +#endif + +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>()) > > + : public boost::integral_constant::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>())> > + : public boost::integral_constant::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>() )> > + : 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) {}; + + +} + +#ifdef BOOST_GCC +#pragma GCC diagnostic pop +#endif +#if defined(BOOST_MSVC) +# pragma warning ( pop ) +#endif + +#else + #include #include #include @@ -206,3 +275,6 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + // references: + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + // rvalue refs: + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + template + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + template <> + struct has_dereference : public false_type {}; + + +} +#endif #endif diff --git a/include/boost/type_traits/has_post_decrement.hpp b/include/boost/type_traits/has_post_decrement.hpp index e3f98ff..fc1c430 100644 --- a/include/boost/type_traits/has_post_decrement.hpp +++ b/include/boost/type_traits/has_post_decrement.hpp @@ -41,4 +41,25 @@ #undef BOOST_TT_TRAIT_OP #undef BOOST_TT_FORBIDDEN_IF +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +namespace boost { + + template + struct has_post_decrement : public false_type {}; + template <> + struct has_post_decrement : public false_type {}; + template <> + struct has_post_decrement : public false_type {}; + + template + struct has_post_decrement : public false_type {}; + template <> + struct has_post_decrement : public false_type {}; + template <> + struct has_post_decrement : public false_type {}; + +} + +#endif #endif diff --git a/include/boost/type_traits/has_post_increment.hpp b/include/boost/type_traits/has_post_increment.hpp index 3861a2b..e83afd1 100644 --- a/include/boost/type_traits/has_post_increment.hpp +++ b/include/boost/type_traits/has_post_increment.hpp @@ -41,4 +41,25 @@ #undef BOOST_TT_TRAIT_OP #undef BOOST_TT_FORBIDDEN_IF +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +namespace boost { + + template + struct has_post_increment : public false_type {}; + template <> + struct has_post_increment : public false_type {}; + template <> + struct has_post_increment : public false_type {}; + + template + struct has_post_increment : public false_type {}; + template <> + struct has_post_increment : public false_type {}; + template <> + struct has_post_increment : public false_type {}; + +} + +#endif #endif diff --git a/include/boost/type_traits/has_pre_decrement.hpp b/include/boost/type_traits/has_pre_decrement.hpp index 7ef0783..5ce50e9 100644 --- a/include/boost/type_traits/has_pre_decrement.hpp +++ b/include/boost/type_traits/has_pre_decrement.hpp @@ -41,4 +41,25 @@ #undef BOOST_TT_TRAIT_OP #undef BOOST_TT_FORBIDDEN_IF +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +namespace boost { + + template + struct has_pre_decrement : public false_type {}; + template <> + struct has_pre_decrement : public false_type {}; + template <> + struct has_pre_decrement : public false_type {}; + + template + struct has_pre_decrement : public false_type {}; + template <> + struct has_pre_decrement : public false_type {}; + template <> + struct has_pre_decrement : public false_type {}; + +} + +#endif #endif diff --git a/include/boost/type_traits/has_pre_increment.hpp b/include/boost/type_traits/has_pre_increment.hpp index c4c9734..9361cc8 100644 --- a/include/boost/type_traits/has_pre_increment.hpp +++ b/include/boost/type_traits/has_pre_increment.hpp @@ -41,4 +41,26 @@ #undef BOOST_TT_TRAIT_OP #undef BOOST_TT_FORBIDDEN_IF +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + +namespace boost { + + template + struct has_pre_increment : public false_type {}; + template <> + struct has_pre_increment : public false_type {}; + template <> + struct has_pre_increment : public false_type {}; + + template + struct has_pre_increment : public false_type {}; + template <> + struct has_pre_increment : public false_type {}; + template <> + struct has_pre_increment : public false_type {}; + +} + +#endif + #endif diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index f77c1f0..805cd70 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -96,6 +96,7 @@ template struct is_function : integral_constant struct is_function : public false_type {}; #endif +template struct is_function : public false_type {}; #endif } // namespace boost diff --git a/test/has_post_decrement_test.cpp b/test/has_post_decrement_test.cpp index 36e556d..c0f1445 100644 --- a/test/has_post_decrement_test.cpp +++ b/test/has_post_decrement_test.cpp @@ -219,6 +219,23 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + +#ifndef BOOST_NO_CXX11_SCOPED_ENUMS + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif +#endif } TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) diff --git a/test/has_post_increment_test.cpp b/test/has_post_increment_test.cpp index c15c6d3..28157b7 100644 --- a/test/has_post_increment_test.cpp +++ b/test/has_post_increment_test.cpp @@ -219,6 +219,23 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + +#ifndef BOOST_NO_CXX11_SCOPED_ENUMS + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif +#endif } TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) diff --git a/test/has_pre_decrement_test.cpp b/test/has_pre_decrement_test.cpp index f65961e..77710b6 100644 --- a/test/has_pre_decrement_test.cpp +++ b/test/has_pre_decrement_test.cpp @@ -219,6 +219,23 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + +#ifndef BOOST_NO_CXX11_SCOPED_ENUMS + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif +#endif } TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) diff --git a/test/has_pre_increment_test.cpp b/test/has_pre_increment_test.cpp index 80c56a5..d7eaf14 100644 --- a/test/has_pre_increment_test.cpp +++ b/test/has_pre_increment_test.cpp @@ -219,6 +219,23 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + +#ifndef BOOST_NO_CXX11_SCOPED_ENUMS + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif +#endif } TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) diff --git a/test/has_unary_minus_test.cpp b/test/has_unary_minus_test.cpp index 1751d8c..33863fa 100644 --- a/test/has_unary_minus_test.cpp +++ b/test/has_unary_minus_test.cpp @@ -219,8 +219,22 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + #ifndef BOOST_NO_CXX11_SCOPED_ENUMS BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif #endif } diff --git a/test/has_unary_plus_test.cpp b/test/has_unary_plus_test.cpp index b629afe..0c28250 100644 --- a/test/has_unary_plus_test.cpp +++ b/test/has_unary_plus_test.cpp @@ -219,8 +219,22 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int & >::value), 0); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const & >::value), 0); +#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION) + // There are some things that pass that wouldn't otherwise do so: + auto f = []() {}; + auto f2 = [](double)->int { return 2; }; + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 1); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), 0); + #ifndef BOOST_NO_CXX11_SCOPED_ENUMS BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, scoped_enum >::value), 0); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum, void >::value), 0); +#endif #endif }