]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/array/test/array_constexpr.cpp
update sources to v12.2.3
[ceph.git] / 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)
6 */
7
8 #include <string>
9 #include <iostream>
10 #include <boost/array.hpp>
11 #include <algorithm>
12 #ifndef BOOST_NO_CXX11_HDR_ARRAY
13 #include <array>
14 #endif
15
16 #define BOOST_TEST_MAIN
17 #include <boost/test/unit_test.hpp>
18
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 }};
22
23 template <typename T>
24 void sink ( T t ) {}
25
26 template <typename T, size_t N>
27 void sink ( boost::array<T,N> &arr ) {}
28
29 BOOST_AUTO_TEST_CASE( test_main )
30 {
31 // constexpr int two = arr_std.at (2);
32 constexpr int three = arr.at (3);
33 int whatever [ arr.at(4) ];
34 (void)three;
35 (void) whatever;
36 }
37
38 #else // no constexpr means no constexpr tests!
39 BOOST_AUTO_TEST_CASE( test_main )
40 {
41 }
42 #endif