diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 64f49d5..fd065c3 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -33,6 +33,7 @@ run array_elems_test.cpp ; run array_init_test.cpp ; run array_copy_test.cpp ; run array_convert_test.cpp ; +run array_data_test.cpp ; # diff --git a/test/array_data_test.cpp b/test/array_data_test.cpp new file mode 100644 index 0000000..d27fec1 --- /dev/null +++ b/test/array_data_test.cpp @@ -0,0 +1,41 @@ +// Copyright 2025 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include + +template void test() +{ + { + boost::array a = {{}}; + + T* p1 = a.data(); + T* p2 = a.elems; + + BOOST_TEST_EQ( p1, p2 ); + } + + { + boost::array const a = {{}}; + + T const* p1 = a.data(); + T const* p2 = a.elems; + + BOOST_TEST_EQ( p1, p2 ); + } +} + +int main() +{ + // test(); + test(); + test(); + + // test(); + test(); + test(); + + return boost::report_errors(); +}