2025-01-10 02:57:33 +02:00
|
|
|
// Copyright 2025 Peter Dimov
|
|
|
|
// Distributed under the Boost Software License, Version 1.0.
|
2025-02-23 21:04:28 +02:00
|
|
|
// https://www.boost.org/LICENSE_1_0.txt
|
2025-01-10 02:57:33 +02:00
|
|
|
|
|
|
|
#include <boost/array.hpp>
|
|
|
|
#include <boost/core/lightweight_test.hpp>
|
2025-01-10 03:37:10 +02:00
|
|
|
#include <cstddef>
|
2025-01-10 02:57:33 +02:00
|
|
|
|
|
|
|
template<class T, std::size_t N> void test()
|
|
|
|
{
|
2025-01-10 03:37:10 +02:00
|
|
|
boost::array<T, N> a = {{}};
|
2025-01-10 02:57:33 +02:00
|
|
|
|
|
|
|
T (&e)[ N ] = a.elems;
|
|
|
|
|
|
|
|
BOOST_TEST_EQ( static_cast<void const*>( e ), static_cast<void const*>( &a ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
test<int, 1>();
|
|
|
|
test<int, 7>();
|
|
|
|
|
|
|
|
test<int const, 1>();
|
|
|
|
test<int const, 7>();
|
|
|
|
|
|
|
|
return boost::report_errors();
|
|
|
|
}
|