diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index a2add77..64f49d5 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -32,6 +32,7 @@ run array_typedef_test.cpp ; run array_elems_test.cpp ; run array_init_test.cpp ; run array_copy_test.cpp ; +run array_convert_test.cpp ; # diff --git a/test/array_convert_test.cpp b/test/array_convert_test.cpp new file mode 100644 index 0000000..aa1e9c7 --- /dev/null +++ b/test/array_convert_test.cpp @@ -0,0 +1,38 @@ +// 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 test2() +{ + boost::array a1 = {}; + + boost::array a2; + a2 = a1; + + BOOST_TEST_ALL_EQ( a1.begin(), a1.end(), a2.begin(), a2.end() ); +} + +template void test4() +{ + boost::array a1 = { 1, 2, 3, 4 }; + + boost::array a2; + a2 = a1; + + BOOST_TEST_ALL_EQ( a1.begin(), a1.end(), a2.begin(), a2.end() ); +} + +int main() +{ + test2(); + test2(); + test2(); + + test4(); + + return boost::report_errors(); +}