Change insert/erase as specified in n2369, the implementation and tests.

I accidently only checked in the documentation from these changes in the
last check in. This contains the rest of it.


[SVN r39950]
This commit is contained in:
Daniel James
2007-10-11 23:49:31 +00:00
parent 2cdb800ec3
commit 50c629dcb0
4 changed files with 26 additions and 68 deletions

View File

@@ -144,10 +144,8 @@ void unordered_test(X&, Key& k, T& t, Hash& hf, Pred& eq)
test::check_return_type<hasher>::equals(b.hash_function());
test::check_return_type<key_equal>::equals(b.key_eq());
iterator q = a.begin();
const_iterator r = a.begin();
const_iterator q = a.cbegin();
test::check_return_type<iterator>::equals(a.insert(q, t));
test::check_return_type<const_iterator>::equals(a.insert(r, t));
// TODO: void return?
a.insert(i, j);
@@ -156,23 +154,13 @@ void unordered_test(X&, Key& k, T& t, Hash& hf, Pred& eq)
BOOST_TEST(a.empty());
if(a.empty()) {
a.insert(t);
q = a.begin();
q = a.cbegin();
test::check_return_type<iterator>::equals(a.erase(q));
}
BOOST_TEST(a.empty());
if(a.empty()) {
a.insert(t);
r = a.begin();
test::check_return_type<const_iterator>::equals(a.erase(r));
}
iterator q1 = a.begin(), q2 = a.end();
const_iterator q1 = a.cbegin(), q2 = a.cend();
test::check_return_type<iterator>::equals(a.erase(q1, q2));
const_iterator r1 = a.begin(), r2 = a.end();
test::check_return_type<const_iterator>::equals(a.erase(r1, r2));
// TODO: void return?
a.clear();