]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/is_array_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_array.hpp>
13 #include "check_integral_constant.hpp"
15 struct convertible_to_pointer
17 operator char*() const;
20 TT_TEST_BEGIN(is_array
)
22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int>::value
, false);
23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int*>::value
, false);
24 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const int*>::value
, false);
25 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const volatile int*>::value
, false);
26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int*const>::value
, false);
27 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const int*volatile>::value
, false);
28 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const volatile int*const>::value
, false);
29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int[2]>::value
, true);
30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const int[2]>::value
, true);
31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<const volatile int[2]>::value
, true);
32 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int[2][3]>::value
, true);
33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<UDT
[2]>::value
, true);
34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int(&)[2]>::value
, false);
35 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<int(&&)[2]>::value
, false);
38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<f1
>::value
, false);
39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<void>::value
, false);
40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<test_abc1
>::value
, false);
41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<convertible_to_pointer
>::value
, false);
42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<test_abc1
>::value
, false);
43 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<foo0_t
>::value
, false);
44 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_array
<incomplete_type
>::value
, false);