]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/type_traits/test/extent_test.cpp
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)
8 #include "check_integral_constant.hpp"
10 # include <type_traits>
12 # include <boost/type_traits/extent.hpp>
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);
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);