diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 11609ab..91cb6af 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -29,6 +29,7 @@ run array_hash.cpp # run array_typedef_test.cpp ; +run array_elems_test.cpp ; # diff --git a/test/array_elems_test.cpp b/test/array_elems_test.cpp new file mode 100644 index 0000000..0204c66 --- /dev/null +++ b/test/array_elems_test.cpp @@ -0,0 +1,26 @@ +// Copyright 2025 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +template void test() +{ + boost::array a = {}; + + T (&e)[ N ] = a.elems; + + BOOST_TEST_EQ( static_cast( e ), static_cast( &a ) ); +} + +int main() +{ + test(); + test(); + + test(); + test(); + + return boost::report_errors(); +}