Add tests for scoped_enums.

See https://github.com/boostorg/type_traits/issues/80 and https://svn.boost.org/trac10/ticket/9913.
This commit is contained in:
jzmaddock
2018-08-06 19:11:20 +01:00
parent 458b1fa071
commit e574d2c134
5 changed files with 20 additions and 1 deletions

View File

@ -259,4 +259,9 @@ 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);
#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::has_plus< scoped_enum, scoped_enum >::value), 0);
#endif
TT_TEST_END

View File

@ -222,7 +222,9 @@ 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);
#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0);
#endif
}
TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME)

View File

@ -219,6 +219,9 @@ 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);
#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0);
#endif
}
TT_TEST_BEGIN(BOOST_TT_TRAIT_NAME)

View File

@ -219,6 +219,9 @@ 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);
#ifndef BOOST_NO_CXX11_SCOPED_ENUMS
BOOST_CHECK_INTEGRAL_CONSTANT((::boost::BOOST_TT_TRAIT_NAME< scoped_enum >::value), 0);
#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(){};