]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/array/test/array_constexpr.cpp
1 /* tests using constexpr on boost:array
2 * (C) Copyright Marshall Clow 2012
3 * Distributed under the Boost Software License, Version 1.0. (See
4 * accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/array.hpp>
12 #ifndef BOOST_NO_CXX11_HDR_ARRAY
16 #define BOOST_TEST_MAIN
17 #include <boost/test/unit_test.hpp>
19 #ifndef BOOST_NO_CXX11_CONSTEXPR
20 constexpr boost::array
<int, 10> arr
{{ 0,1,2,3,4,5,6,7,8,9 }};
21 constexpr std::array
<int, 10> arr_std
{{ 0,1,2,3,4,5,6,7,8,9 }};
26 template <typename T
, size_t N
>
27 void sink ( boost::array
<T
,N
> &arr
) {}
29 BOOST_AUTO_TEST_CASE( test_main
)
31 // constexpr int two = arr_std.at (2);
32 constexpr int three
= arr
.at (3);
33 int whatever
[ arr
.at(4) ];
38 #else // no constexpr means no constexpr tests!
39 BOOST_AUTO_TEST_CASE( test_main
)