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 #ifndef BOOST_NO_CXX11_CONSTEXPR
17 constexpr boost::array<int, 10> arr {{ 0,1,2,3,4,5,6,7,8,9 }};
18 constexpr std::array<int, 10> arr_std {{ 0,1,2,3,4,5,6,7,8,9 }};
23 template <typename T, size_t N>
24 void sink ( boost::array<T,N> &arr ) {}
28 // constexpr int two = arr_std.at (2);
29 constexpr int three = arr.at (3);
30 int whatever [ arr.at(4) ];
35 #else // no constexpr means no constexpr tests!