Files
boost_array/test/array_constexpr.cpp
T

30 lines
591 B
C++
Raw Normal View History

2013-02-12 18:07:15 +00:00
/* 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)
2024-04-11 11:37:03 -07:00
*/
2013-02-12 18:07:15 +00:00
#include <boost/array.hpp>
#include <boost/config.hpp>
2013-02-12 18:07:15 +00:00
#ifndef BOOST_NO_CXX11_CONSTEXPR
2013-02-12 18:07:15 +00:00
constexpr boost::array<int, 10> arr {{ 0,1,2,3,4,5,6,7,8,9 }};
int main()
2013-02-12 18:07:15 +00:00
{
constexpr int three = arr.at (3);
int whatever [ arr.at(4) ];
(void)three;
2013-10-14 21:31:19 +00:00
(void) whatever;
2013-02-12 18:07:15 +00:00
}
2013-10-14 21:31:19 +00:00
#else // no constexpr means no constexpr tests!
int main()
2013-02-12 18:07:15 +00:00
{
}
2013-02-12 18:07:15 +00:00
#endif