]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_const_test.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / type_traits / test / is_const_test.cpp
1
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)
6
7 #ifdef TEST_STD
8 # include <type_traits>
9 #else
10 # include <boost/type_traits/is_const.hpp>
11 #endif
12 #include "test.hpp"
13 #include "check_integral_constant.hpp"
14
15 TT_TEST_BEGIN(is_const)
16
17 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<void>::value, false);
18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const void>::value, true);
19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<test_abc1>::value, false);
20 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const test_abc1>::value, true);
21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<int>::value, false);
22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int>::value, true);
23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const UDT>::value, true);
24 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const volatile UDT>::value, true);
25 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int&>::value, false);
26 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
27 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int&&>::value, false);
28 #endif
29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<cr_type>::value, false);
30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<incomplete_type>::value, false);
31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<foo0_t>::value, false);
32 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int[2]>::value, true);
33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<int[2]>::value, false);
34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<volatile int[2]>::value, false);
35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const volatile int[2]>::value, true);
36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const volatile int[]>::value, true);
37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<volatile int[]>::value, false);
38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<const int[]>::value, true);
39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_const<int[]>::value, false);
40
41 TT_TEST_END
42
43
44
45
46
47
48
49