]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_const_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_const.hpp>
13 #include "check_integral_constant.hpp"
15 TT_TEST_BEGIN(is_const
)
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);
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);