forked from boostorg/type_traits
Fix result of add_reference<const void>.
Also update tests. See https://svn.boost.org/trac/boost/ticket/11900.
This commit is contained in:
@@ -49,9 +49,9 @@ template <class T> struct add_reference<T&>
|
||||
// these full specialisations are always required:
|
||||
template <> struct add_reference<void> { typedef void type; };
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <> struct add_reference<const void> { typedef void type; };
|
||||
template <> struct add_reference<const volatile void> { typedef void type; };
|
||||
template <> struct add_reference<volatile void> { typedef void type; };
|
||||
template <> struct add_reference<const void> { typedef const void type; };
|
||||
template <> struct add_reference<const volatile void> { typedef const volatile void type; };
|
||||
template <> struct add_reference<volatile void> { typedef volatile void type; };
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
@@ -52,7 +52,12 @@ TT_TEST_BEGIN(add_lvalue_reference)
|
||||
add_lvalue_reference_test_13a();
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
BOOST_CHECK_TYPE(tt::add_lvalue_reference<void>::type, void);
|
||||
BOOST_CHECK_TYPE(tt::add_lvalue_reference<const void>::type, const void);
|
||||
BOOST_CHECK_TYPE(tt::add_lvalue_reference<const volatile void>::type, const volatile void);
|
||||
BOOST_CHECK_TYPE(tt::add_lvalue_reference<volatile void>::type, volatile void);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
||||
|
@@ -52,6 +52,11 @@ TT_TEST_BEGIN(add_reference)
|
||||
add_reference_test_13a();
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_TYPE(tt::add_reference<void>::type, void);
|
||||
BOOST_CHECK_TYPE(tt::add_reference<const void>::type, const void);
|
||||
BOOST_CHECK_TYPE(tt::add_reference<const volatile void>::type, const volatile void);
|
||||
BOOST_CHECK_TYPE(tt::add_reference<volatile void>::type, volatile void);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
@@ -69,6 +69,11 @@ TT_TEST_BEGIN(add_rvalue_reference)
|
||||
add_rvalue_reference_test_13a();
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_TYPE(tt::add_rvalue_reference<void>::type, void);
|
||||
BOOST_CHECK_TYPE(tt::add_rvalue_reference<const void>::type, const void);
|
||||
BOOST_CHECK_TYPE(tt::add_rvalue_reference<const volatile void>::type, const volatile void);
|
||||
BOOST_CHECK_TYPE(tt::add_rvalue_reference<volatile void>::type, volatile void);
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user