Merge pull request #84 from boostorg/issue80

Add tests for scoped_enums.
This commit is contained in:
jzmaddock
2018-08-11 09:26:47 +01:00
committed by GitHub
17 changed files with 690 additions and 0 deletions

View File

@ -7,6 +7,59 @@
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#include <boost/config.hpp>
#include <boost/type_traits/detail/config.hpp>
#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/make_void.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <utility>
namespace boost
{
namespace binary_op_detail {
struct dont_care;
template <class T, class Ret, class = boost::void_t<>>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
template <class T, class Ret>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP) > >
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP), Ret>::value> {};
template <class T, class = boost::void_t<> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, boost::void_t<decltype(std::declval<typename add_reference<T>::type>()BOOST_TT_TRAIT_OP)> >
: public boost::integral_constant<bool, ::boost::is_void<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)>::value> {};
template <class T, class = boost::void_t<>>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, boost::void_t<decltype(std::declval<typename add_reference<T>::type>() BOOST_TT_TRAIT_OP)> >
: public boost::true_type {};
}
template <class T, class Ret = boost::binary_op_detail::dont_care>
struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) <T, Ret> {};
template <class T>
struct BOOST_TT_TRAIT_NAME<T, void> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) <T> {};
template <class T>
struct BOOST_TT_TRAIT_NAME<T, boost::binary_op_detail::dont_care> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) <T> {};
}
#else
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_const.hpp>
@ -193,3 +246,5 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BO
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
#endif

View File

@ -7,6 +7,75 @@
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#include <boost/config.hpp>
#include <boost/type_traits/detail/config.hpp>
#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/make_void.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_void.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <utility>
#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 <class T, class Ret, class = boost::void_t<>>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) : public boost::false_type {};
template <class T, class Ret>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp)<T, Ret, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>()) > >
: public boost::integral_constant<bool, ::boost::is_convertible<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>() ), Ret>::value> {};
template <class T, class = boost::void_t<> >
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp)<T, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>())> >
: public boost::integral_constant<bool, ::boost::is_void<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>())>::value> {};
template <class T, class = boost::void_t<>>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) : public boost::false_type {};
template <class T>
struct BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp)<T, boost::void_t<decltype(BOOST_TT_TRAIT_OP std::declval<typename add_reference<T>::type>() )> >
: public boost::true_type {};
}
template <class T, class Ret = boost::binary_op_detail::dont_care>
struct BOOST_TT_TRAIT_NAME : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _ret_imp) <T, Ret> {};
template <class T>
struct BOOST_TT_TRAIT_NAME<T, void> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _void_imp) <T> {};
template <class T>
struct BOOST_TT_TRAIT_NAME<T, boost::binary_op_detail::dont_care> : public boost::binary_op_detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME, _dc_imp) <T> {};
}
#ifdef BOOST_GCC
#pragma GCC diagnostic pop
#endif
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
#else
#include <boost/type_traits/detail/yes_no_type.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_const.hpp>
@ -206,3 +275,6 @@ struct BOOST_TT_TRAIT_NAME : public integral_constant<bool, (::boost::detail::BO
#if defined(BOOST_MSVC)
# pragma warning ( pop )
#endif
#endif

View File

@ -27,5 +27,349 @@
#undef BOOST_TT_TRAIT_NAME
#undef BOOST_TT_TRAIT_OP
#undef BOOST_TT_FORBIDDEN_IF
#if defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
namespace boost {
template <class R>
struct has_dereference<void*, R> : public false_type {};
template <>
struct has_dereference<void*, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*, void> : public false_type {};
template <class R>
struct has_dereference<const void*, R> : public false_type {};
template <>
struct has_dereference<const void*, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*, R> : public false_type {};
template <>
struct has_dereference<volatile void*, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*, R> : public false_type {};
template <>
struct has_dereference<const volatile void*, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*, void> : public false_type {};
template <class R>
struct has_dereference<void*const, R> : public false_type {};
template <>
struct has_dereference<void*const, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const, void> : public false_type {};
template <class R>
struct has_dereference<const void*const, R> : public false_type {};
template <>
struct has_dereference<const void*const, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const, R> : public false_type {};
template <>
struct has_dereference<volatile void*const, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const, void> : public false_type {};
template <class R>
struct has_dereference<void*volatile, R> : public false_type {};
template <>
struct has_dereference<void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*volatile, void> : public false_type {};
template <class R>
struct has_dereference<const void*volatile, R> : public false_type {};
template <>
struct has_dereference<const void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*volatile, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*volatile, R> : public false_type {};
template <>
struct has_dereference<volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*volatile, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*volatile, R> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile, void> : public false_type {};
template <class R>
struct has_dereference<void*const volatile, R> : public false_type {};
template <>
struct has_dereference<void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const volatile, void> : public false_type {};
template <class R>
struct has_dereference<const void*const volatile, R> : public false_type {};
template <>
struct has_dereference<const void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const volatile, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const volatile, R> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const volatile, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile, void> : public false_type {};
// references:
template <class R>
struct has_dereference<void*&, R> : public false_type {};
template <>
struct has_dereference<void*&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*&, void> : public false_type {};
template <class R>
struct has_dereference<const void*&, R> : public false_type {};
template <>
struct has_dereference<const void*&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*&, R> : public false_type {};
template <>
struct has_dereference<volatile void*&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*&, void> : public false_type {};
template <class R>
struct has_dereference<void*const&, R> : public false_type {};
template <>
struct has_dereference<void*const&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const&, void> : public false_type {};
template <class R>
struct has_dereference<const void*const&, R> : public false_type {};
template <>
struct has_dereference<const void*const&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const&, R> : public false_type {};
template <>
struct has_dereference<volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const&, void> : public false_type {};
template <class R>
struct has_dereference<void*volatile&, R> : public false_type {};
template <>
struct has_dereference<void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*volatile&, void> : public false_type {};
template <class R>
struct has_dereference<const void*volatile&, R> : public false_type {};
template <>
struct has_dereference<const void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*volatile&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*volatile&, R> : public false_type {};
template <>
struct has_dereference<volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*volatile&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*volatile&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile&, void> : public false_type {};
template <class R>
struct has_dereference<void*const volatile&, R> : public false_type {};
template <>
struct has_dereference<void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const volatile&, void> : public false_type {};
template <class R>
struct has_dereference<const void*const volatile&, R> : public false_type {};
template <>
struct has_dereference<const void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const volatile&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const volatile&, R> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const volatile&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile&, void> : public false_type {};
// rvalue refs:
template <class R>
struct has_dereference<void*&&, R> : public false_type {};
template <>
struct has_dereference<void*&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*&&, void> : public false_type {};
template <class R>
struct has_dereference<const void*&&, R> : public false_type {};
template <>
struct has_dereference<const void*&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*&&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*&&, R> : public false_type {};
template <>
struct has_dereference<volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*&&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*&&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*&&, void> : public false_type {};
template <class R>
struct has_dereference<void*const&&, R> : public false_type {};
template <>
struct has_dereference<void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const&&, void> : public false_type {};
template <class R>
struct has_dereference<const void*const&&, R> : public false_type {};
template <>
struct has_dereference<const void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const&&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const&&, R> : public false_type {};
template <>
struct has_dereference<volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const&&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const&&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const&&, void> : public false_type {};
template <class R>
struct has_dereference<void*volatile&&, R> : public false_type {};
template <>
struct has_dereference<void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<const void*volatile&&, R> : public false_type {};
template <>
struct has_dereference<const void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*volatile&&, R> : public false_type {};
template <>
struct has_dereference<volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*volatile&&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<void*const volatile&&, R> : public false_type {};
template <>
struct has_dereference<void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<void*const volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<const void*const volatile&&, R> : public false_type {};
template <>
struct has_dereference<const void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const void*const volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<volatile void*const volatile&&, R> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<volatile void*const volatile&&, void> : public false_type {};
template <class R>
struct has_dereference<const volatile void*const volatile&&, R> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile&&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_dereference<const volatile void*const volatile&&, void> : public false_type {};
}
#endif
#endif

View File

@ -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 <class R>
struct has_post_decrement<bool, R> : public false_type {};
template <>
struct has_post_decrement<bool, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_post_decrement<bool, void> : public false_type {};
template <class R>
struct has_post_decrement<bool&, R> : public false_type {};
template <>
struct has_post_decrement<bool&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_post_decrement<bool&, void> : public false_type {};
}
#endif
#endif

View File

@ -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 <class R>
struct has_post_increment<bool, R> : public false_type {};
template <>
struct has_post_increment<bool, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_post_increment<bool, void> : public false_type {};
template <class R>
struct has_post_increment<bool&, R> : public false_type {};
template <>
struct has_post_increment<bool&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_post_increment<bool&, void> : public false_type {};
}
#endif
#endif

View File

@ -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 <class R>
struct has_pre_decrement<bool, R> : public false_type {};
template <>
struct has_pre_decrement<bool, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_pre_decrement<bool, void> : public false_type {};
template <class R>
struct has_pre_decrement<bool&, R> : public false_type {};
template <>
struct has_pre_decrement<bool&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_pre_decrement<bool&, void> : public false_type {};
}
#endif
#endif

View File

@ -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 <class R>
struct has_pre_increment<bool, R> : public false_type {};
template <>
struct has_pre_increment<bool, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_pre_increment<bool, void> : public false_type {};
template <class R>
struct has_pre_increment<bool&, R> : public false_type {};
template <>
struct has_pre_increment<bool&, boost::binary_op_detail::dont_care> : public false_type {};
template <>
struct has_pre_increment<bool&, void> : public false_type {};
}
#endif
#endif

View File

@ -13,6 +13,7 @@
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/detail/config.hpp>
#include <boost/config/workaround.hpp>
#if !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
# include <boost/type_traits/detail/is_function_ptr_helper.hpp>
@ -96,6 +97,9 @@ template <class T> struct is_function : integral_constant<bool, ::boost::detail:
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
template <class T> struct is_function<T&&> : public false_type {};
#endif
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1600)
template <class T> struct is_function<T&> : public false_type {};
#endif
#endif
} // namespace boost

View File

@ -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

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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<decltype(f)>::value), result);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2)>::value), result);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), bool>::value), result);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), bool>::value), result);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f), void>::value), 0);
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME<decltype(f2), void>::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)

View File

@ -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(){};