Added statid_vector::insert(pos, first, last) for non random access iterators.

Added uninitialized_copy_checked() helper method.
Added tests.

[SVN r82027]
This commit is contained in:
Adam Wulkiewicz
2012-12-16 18:31:03 +00:00
parent 7e6f3b197e
commit 32fbcf66ed
2 changed files with 95 additions and 29 deletions

View File

@@ -421,6 +421,23 @@ void test_insert_nd(T const& val)
BOOST_CHECK(s1[j+i+n] == T(j+i));
}
}
{
size_t n = size_t(h/1.5f);
for ( size_t i = 0 ; i <= h ; ++i )
{
static_vector<T, N> s1(s);
std::list<T>::iterator it = l.begin();
std::advance(it, n);
s1.insert(s1.begin() + i, l.begin(), it);
BOOST_CHECK(s1.size() == h+n);
for ( size_t j = 0 ; j < i ; ++j )
BOOST_CHECK(s1[j] == T(j));
for ( size_t j = 0 ; j < n ; ++j )
BOOST_CHECK(s1[j+i] == T(100 + j));
for ( size_t j = 0 ; j < h-i ; ++j )
BOOST_CHECK(s1[j+i+n] == T(j+i));
}
}
}
int test_main(int, char* [])