// Copyright 2025 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #define BOOST_ALLOW_DEPRECATED_SYMBOLS #include #include #include #include #include // c_array and get_c_array are deprecated nonstandard extensions template void test() { boost::array a = {}; T* p1 = a.c_array(); T* p2 = a.data(); BOOST_TEST_EQ( p1, p2 ); } template void test2() { { boost::array a = {{}}; T (&e1)[ N ] = boost::get_c_array( a ); T (&e2)[ N ] = a.elems; BOOST_TEST_EQ( static_cast( e1 ), static_cast( e2 ) ); } { boost::array const a = {{}}; T const (&e1)[ N ] = boost::get_c_array( a ); T const (&e2)[ N ] = a.elems; BOOST_TEST_EQ( static_cast( e1 ), static_cast( e2 ) ); } } int main() { test(); test(); test(); test(); #if BOOST_WORKAROUND(BOOST_MSVC, < 1910) || BOOST_WORKAROUND(BOOST_GCC, < 50000) // = {} doesn't work for const T #else test(); test(); #endif test2(); test2(); test2(); test2(); return boost::report_errors(); }