Fixed wrong assert in static_vector::insert(pos, val)

Test added.

[SVN r82003]
This commit is contained in:
Adam Wulkiewicz
2012-12-16 01:02:38 +00:00
parent 50bb3d9fdf
commit 8c6d651676
2 changed files with 11 additions and 1 deletions

View File

@@ -363,6 +363,16 @@ void test_insert_nd(T const& v)
for ( size_t i = 0 ; i < h ; ++i )
BOOST_CHECK(s1[i+h] == T(i));
}
{
static_vector<T, N> s1(s);
for ( size_t i = 0 ; i < h ; ++i )
s1.insert(s1.end(), v);
BOOST_CHECK(s1.size() == 2*h);
for ( size_t i = 0 ; i < h ; ++i )
BOOST_CHECK(s1[i] == T(i));
for ( size_t i = 0 ; i < h ; ++i )
BOOST_CHECK(s1[i+h] == v);
}
}
int test_main(int, char* [])