forked from boostorg/container
Added constant static_vector<>/small_vector::static_capacity to use the configured capacity in constant expressions.
This commit is contained in:
@@ -33,6 +33,7 @@ template <typename T, size_t N>
|
||||
void test_ctor_ndc()
|
||||
{
|
||||
static_vector<T, N> s;
|
||||
BOOST_STATIC_ASSERT((static_vector<T, N>::static_capacity) == N);
|
||||
BOOST_TEST_EQ(s.size() , 0u);
|
||||
BOOST_TEST(s.capacity() == N);
|
||||
BOOST_TEST(s.max_size() == N);
|
||||
@@ -43,6 +44,7 @@ template <typename T, size_t N>
|
||||
void test_ctor_nc(size_t n)
|
||||
{
|
||||
static_vector<T, N> s(n);
|
||||
BOOST_STATIC_ASSERT((static_vector<T, N>::static_capacity) == N);
|
||||
BOOST_TEST(s.size() == n);
|
||||
BOOST_TEST(s.capacity() == N);
|
||||
BOOST_TEST(s.max_size() == N);
|
||||
@@ -64,6 +66,7 @@ template <typename T, size_t N>
|
||||
void test_ctor_nd(size_t n, T const& v)
|
||||
{
|
||||
static_vector<T, N> s(n, v);
|
||||
BOOST_STATIC_ASSERT((static_vector<T, N>::static_capacity) == N);
|
||||
BOOST_TEST(s.size() == n);
|
||||
BOOST_TEST(s.capacity() == N);
|
||||
BOOST_TEST_THROWS( s.at(n), std::out_of_range );
|
||||
|
||||
Reference in New Issue
Block a user