]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/extent_test.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / type_traits / test / extent_test.cpp
1
2 // (C) Copyright John Maddock 2005.
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 #include "test.hpp"
8 #include "check_integral_constant.hpp"
9 #ifdef TEST_STD
10 # include <type_traits>
11 #else
12 # include <boost/type_traits/extent.hpp>
13 #endif
14
15 TT_TEST_BEGIN(extent)
16
17 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int>::value, 0);
18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int[]>::value, 0);
19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int[][10]>::value, 0);
20 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int[5][10]>::value, 5);
21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int[5][10][40]>::value, 5);
22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int (&)[5][10]>::value, 0);
23 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int (*)[5][10]>::value, 0);
24 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int,1>::value), 0);
25 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[],1>::value), 0);
26 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[][10],1>::value), 10);
27 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[5][10],1>::value), 10);
28 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[5][10][40],1>::value), 10);
29 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int (&)[5][10],1>::value), 0);
30 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int (*)[5][10],1>::value), 0);
31 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[5][10],2>::value), 0);
32 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[5][10][40],2>::value), 40);
33 BOOST_CHECK_INTEGRAL_CONSTANT((::tt::extent<int[5][10][40],3>::value), 0);
34
35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int*>::value, 0);
36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int&>::value, 0);
37 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::extent<int&&>::value, 0);
39 #endif
40
41 TT_TEST_END
42
43
44
45
46
47
48
49