]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_same_test.cpp
2 // (C) Copyright John Maddock 2000.
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 # include <type_traits>
10 # include <boost/type_traits/is_same.hpp>
13 #include "check_integral_constant.hpp"
15 TT_TEST_BEGIN(is_same
)
17 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, int>::value
), true);
18 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int&, int&>::value
), true);
19 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
20 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int&&, int&&>::value
), true);
22 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, const int>::value
), false);
23 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, int&>::value
), false);
24 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
25 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, int&&>::value
), false);
27 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<const int, int&>::value
), false);
28 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, const int&>::value
), false);
29 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int*, const int*>::value
), false);
30 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int*, int*const>::value
), false);
31 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int, int[2]>::value
), false);
32 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int*, int[2]>::value
), false);
33 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_same
<int[4], int[2]>::value
), false);