mirror of
https://github.com/boostorg/core.git
synced 2025-11-29 05:40:14 +01:00
Print type with cvref qualifiers
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
//
|
||||
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
struct X
|
||||
{
|
||||
@@ -20,6 +21,21 @@ template<class T1, class T2> struct Y
|
||||
typedef T1 type;
|
||||
};
|
||||
|
||||
typedef int I1;
|
||||
typedef const int I2;
|
||||
typedef volatile int I3;
|
||||
typedef const volatile int I4;
|
||||
typedef int& I5;
|
||||
typedef const int& I6;
|
||||
typedef volatile int& I7;
|
||||
typedef const volatile int& I8;
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
typedef int&& I9;
|
||||
typedef const int&& I10;
|
||||
typedef volatile int&& I11;
|
||||
typedef const volatile int&& I12;
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
BOOST_TEST_TRAIT_SAME(char[1], char[2]);
|
||||
@@ -32,6 +48,14 @@ int main()
|
||||
BOOST_TEST_TRAIT_SAME(X, Y<void, void>);
|
||||
BOOST_TEST_TRAIT_SAME(X::type, Y<float, int>::type);
|
||||
BOOST_TEST_TRAIT_SAME(Y<int, float>, Y<int, double>);
|
||||
BOOST_TEST_TRAIT_SAME(I1, I2);
|
||||
BOOST_TEST_TRAIT_SAME(I3, I4);
|
||||
BOOST_TEST_TRAIT_SAME(I5, I6);
|
||||
BOOST_TEST_TRAIT_SAME(I7, I8);
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
BOOST_TEST_TRAIT_SAME(I9, I10);
|
||||
BOOST_TEST_TRAIT_SAME(I11, I12);
|
||||
#endif
|
||||
|
||||
return boost::report_errors() == 10;
|
||||
return boost::report_errors() == 16;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user