1 /* tests using std::get 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)
8 #include <boost/array.hpp>
9 #include <boost/static_assert.hpp>
15 #ifndef BOOST_NO_CXX11_HDR_ARRAY
19 #include <boost/core/lightweight_test_trait.hpp>
23 #ifndef BOOST_NO_CXX11_HDR_ARRAY
27 typedef boost::array< T, 5 > test_type;
29 test_type test_case; // = { 1, 1, 2, 3, 5 };
31 T &aRef = std::get<5> ( test_case ); // should fail to compile
32 BOOST_TEST ( &*test_case.begin () == &aRef );
40 #ifndef BOOST_NO_CXX11_HDR_ARRAY
41 RunStdTests< bool >();
42 RunStdTests< void * >();
43 RunStdTests< long double >();
44 RunStdTests< std::string >();
46 BOOST_STATIC_ASSERT ( false ); // fail on C++03 systems.
49 return boost::report_errors();