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 fe72ebf..e0b057a 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -13,6 +13,7 @@ #include #include +#include #if !defined(BOOST_TT_TEST_MS_FUNC_SIGS) # include @@ -96,6 +97,9 @@ template struct is_function : integral_constant struct is_function : public false_type {}; #endif +#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1600) +template struct is_function : public false_type {}; +#endif #endif } // namespace boost diff --git a/test/has_binary_classes0_test.cpp b/test/has_binary_classes0_test.cpp index 1c6978b..a77a34b 100644 --- a/test/has_binary_classes0_test.cpp +++ b/test/has_binary_classes0_test.cpp @@ -259,4 +259,5 @@ TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME) BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 &, ret const & >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014, C014 const &, ret const & >::value), 1); BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< C014 const, C014, ret const >::value), 1); + TT_TEST_END diff --git a/test/has_complement_test.cpp b/test/has_complement_test.cpp index 394ecca..d1b9254 100644 --- a/test/has_complement_test.cpp +++ b/test/has_complement_test.cpp @@ -222,7 +222,23 @@ void specific() { BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< int* const &, int const >::value), 0); 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_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 5481a16..33863fa 100644 --- a/test/has_unary_minus_test.cpp +++ b/test/has_unary_minus_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_plus_test.cpp b/test/has_unary_plus_test.cpp index 416c01a..e24d833 100644 --- a/test/has_unary_plus_test.cpp +++ b/test/has_unary_plus_test.cpp @@ -219,6 +219,28 @@ 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; }; +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1900) + bool result = false; +#else + bool result = true; +#endif + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME::value), result); + 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/test.hpp b/test/test.hpp index 15fd66a..4d0eb32 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -322,6 +322,12 @@ enum enum2 three_,four_ }; +#ifndef BOOST_NO_CXX11_SCOPED_ENUMS + +enum class scoped_enum { one, two, three }; + +#endif + struct VB { virtual ~VB(){};