Files
array/test/array_constexpr.cpp

30 lines
591 B
C++
Raw Normal View History

/* tests using constexpr on boost:array
* (C) Copyright Marshall Clow 2012
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/array.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX11_CONSTEXPR
constexpr boost::array<int, 10> arr {{ 0,1,2,3,4,5,6,7,8,9 }};
int main()
{
constexpr int three = arr.at (3);
int whatever [ arr.at(4) ];
(void)three;
2013-10-14 21:31:19 +00:00
(void) whatever;
}
2013-10-14 21:31:19 +00:00
#else // no constexpr means no constexpr tests!
int main()
{
}
#endif