[libc++] [test] Qualify `next` as `std::next` in a lot of tests. NFCI.

We shouldn't be calling `next` via ADL -- and neither should anybody
in the wild be calling it via ADL, so it's not like we need to test
this ADL ability of `next` in particular.

Reviewed as part of D119860.
This commit is contained in:
Arthur O'Dwyer 2022-02-13 14:50:33 -05:00
parent 7853371146
commit 5ffe11a9fc
107 changed files with 3262 additions and 3262 deletions

View File

@ -43,8 +43,8 @@ void test_basic() {
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -67,8 +67,8 @@ void test_basic() {
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
}

View File

@ -45,16 +45,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -80,16 +80,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -114,16 +114,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
#endif

View File

@ -45,16 +45,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -80,16 +80,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -114,16 +114,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
#endif

View File

@ -140,16 +140,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -190,16 +190,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -226,16 +226,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -261,16 +261,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
assert(balanced_allocs());
@ -297,15 +297,15 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
assert(balanced_allocs());
{
@ -331,15 +331,15 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == V(1, 1));
assert(*next(mo.begin()) == V(2, 1));
assert(*next(mo.begin(), 2) == V(3, 1));
assert(*std::next(mo.begin()) == V(2, 1));
assert(*std::next(mo.begin(), 2) == V(3, 1));
}
assert(balanced_allocs());
#endif

View File

@ -39,8 +39,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -59,8 +59,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
return 0;

View File

@ -39,8 +39,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3));
}
{
@ -60,8 +60,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3));
}

View File

@ -41,8 +41,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3));
assert(m.get_allocator() == A(6));
}
@ -64,8 +64,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3));
assert(m.get_allocator() == A());
}
@ -89,8 +89,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.get_allocator() == a);
}
{
@ -112,8 +112,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.key_comp() == C(3));
assert(m.get_allocator() == a);
}

View File

@ -39,8 +39,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -61,8 +61,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#endif

View File

@ -42,8 +42,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -66,8 +66,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#endif

View File

@ -46,8 +46,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER >= 11
{
@ -72,8 +72,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
#if TEST_STD_VER > 11
{
@ -99,8 +99,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.get_allocator() == a);
}
{
@ -112,8 +112,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(m.get_allocator() == a);
}
}

View File

@ -62,8 +62,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
@ -107,8 +107,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));

View File

@ -41,18 +41,18 @@ int main(int, char**)
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(!r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
}
assert(DefaultOnly::count == 0);
@ -108,18 +108,18 @@ int main(int, char**)
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(!r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
}
assert(DefaultOnly::count == 0);

View File

@ -39,18 +39,18 @@ int main(int, char**)
r = m.emplace_hint(m.end(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace_hint(m.end(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
}
assert(DefaultOnly::count == 0);
@ -104,18 +104,18 @@ int main(int, char**)
r = m.emplace_hint(m.end(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace_hint(m.end(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
}
assert(DefaultOnly::count == 0);

View File

@ -45,87 +45,87 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(i == std::next(m.begin(), 3));
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 5);
assert(next(m.begin(), 3)->second == 5.5);
assert(next(m.begin(), 4)->first == 6);
assert(next(m.begin(), 4)->second == 6.5);
assert(next(m.begin(), 5)->first == 7);
assert(next(m.begin(), 5)->second == 7.5);
assert(next(m.begin(), 6)->first == 8);
assert(next(m.begin(), 6)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 5);
assert(std::next(m.begin(), 3)->second == 5.5);
assert(std::next(m.begin(), 4)->first == 6);
assert(std::next(m.begin(), 4)->second == 6.5);
assert(std::next(m.begin(), 5)->first == 7);
assert(std::next(m.begin(), 5)->second == 7.5);
assert(std::next(m.begin(), 6)->first == 8);
assert(std::next(m.begin(), 6)->second == 8.5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(i == std::next(m.begin()));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 6);
assert(next(m.begin(), 2)->second == 6.5);
assert(next(m.begin(), 3)->first == 7);
assert(next(m.begin(), 3)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 6);
assert(std::next(m.begin(), 2)->second == 6.5);
assert(std::next(m.begin(), 3)->first == 7);
assert(std::next(m.begin(), 3)->second == 7.5);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(i == std::next(m.begin(), 2));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 7);
assert(next(m.begin(), 2)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 7);
assert(std::next(m.begin(), 2)->second == 7.5);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(i == std::next(m.begin(), 2));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(i == std::next(m.begin(), 0));
assert(m.begin()->first == 5);
assert(m.begin()->second == 5.5);
@ -152,87 +152,87 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(i == std::next(m.begin(), 3));
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 5);
assert(next(m.begin(), 3)->second == 5.5);
assert(next(m.begin(), 4)->first == 6);
assert(next(m.begin(), 4)->second == 6.5);
assert(next(m.begin(), 5)->first == 7);
assert(next(m.begin(), 5)->second == 7.5);
assert(next(m.begin(), 6)->first == 8);
assert(next(m.begin(), 6)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 5);
assert(std::next(m.begin(), 3)->second == 5.5);
assert(std::next(m.begin(), 4)->first == 6);
assert(std::next(m.begin(), 4)->second == 6.5);
assert(std::next(m.begin(), 5)->first == 7);
assert(std::next(m.begin(), 5)->second == 7.5);
assert(std::next(m.begin(), 6)->first == 8);
assert(std::next(m.begin(), 6)->second == 8.5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(i == std::next(m.begin()));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 6);
assert(next(m.begin(), 2)->second == 6.5);
assert(next(m.begin(), 3)->first == 7);
assert(next(m.begin(), 3)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 6);
assert(std::next(m.begin(), 2)->second == 6.5);
assert(std::next(m.begin(), 3)->first == 7);
assert(std::next(m.begin(), 3)->second == 7.5);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(i == std::next(m.begin(), 2));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 7);
assert(next(m.begin(), 2)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 7);
assert(std::next(m.begin(), 2)->second == 7.5);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(i == std::next(m.begin(), 2));
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(i == std::next(m.begin(), 0));
assert(m.begin()->first == 5);
assert(m.begin()->second == 5.5);

View File

@ -42,44 +42,44 @@ int main(int, char**)
assert(i == m.begin());
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
i = m.erase(m.cbegin(), next(m.cbegin(), 2));
i = m.erase(m.cbegin(), std::next(m.cbegin(), 2));
assert(m.size() == 6);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 6));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 6));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);
@ -109,44 +109,44 @@ int main(int, char**)
assert(i == m.begin());
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
i = m.erase(m.cbegin(), next(m.cbegin(), 2));
i = m.erase(m.cbegin(), std::next(m.cbegin(), 2));
assert(m.size() == 6);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 6));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 6));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);

View File

@ -42,98 +42,98 @@ int main(int, char**)
assert(m.size() == 8);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
s = m.erase(4);
assert(m.size() == 7);
assert(s == 1);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 5);
assert(next(m.begin(), 3)->second == 5.5);
assert(next(m.begin(), 4)->first == 6);
assert(next(m.begin(), 4)->second == 6.5);
assert(next(m.begin(), 5)->first == 7);
assert(next(m.begin(), 5)->second == 7.5);
assert(next(m.begin(), 6)->first == 8);
assert(next(m.begin(), 6)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 5);
assert(std::next(m.begin(), 3)->second == 5.5);
assert(std::next(m.begin(), 4)->first == 6);
assert(std::next(m.begin(), 4)->second == 6.5);
assert(std::next(m.begin(), 5)->first == 7);
assert(std::next(m.begin(), 5)->second == 7.5);
assert(std::next(m.begin(), 6)->first == 8);
assert(std::next(m.begin(), 6)->second == 8.5);
s = m.erase(1);
assert(m.size() == 6);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
s = m.erase(8);
assert(m.size() == 5);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
s = m.erase(3);
assert(m.size() == 4);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 6);
assert(next(m.begin(), 2)->second == 6.5);
assert(next(m.begin(), 3)->first == 7);
assert(next(m.begin(), 3)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 6);
assert(std::next(m.begin(), 2)->second == 6.5);
assert(std::next(m.begin(), 3)->first == 7);
assert(std::next(m.begin(), 3)->second == 7.5);
s = m.erase(6);
assert(m.size() == 3);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 7);
assert(next(m.begin(), 2)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 7);
assert(std::next(m.begin(), 2)->second == 7.5);
s = m.erase(7);
assert(m.size() == 2);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
s = m.erase(2);
assert(m.size() == 1);
@ -168,98 +168,98 @@ int main(int, char**)
assert(m.size() == 8);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
s = m.erase(4);
assert(m.size() == 7);
assert(s == 1);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 5);
assert(next(m.begin(), 3)->second == 5.5);
assert(next(m.begin(), 4)->first == 6);
assert(next(m.begin(), 4)->second == 6.5);
assert(next(m.begin(), 5)->first == 7);
assert(next(m.begin(), 5)->second == 7.5);
assert(next(m.begin(), 6)->first == 8);
assert(next(m.begin(), 6)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 5);
assert(std::next(m.begin(), 3)->second == 5.5);
assert(std::next(m.begin(), 4)->first == 6);
assert(std::next(m.begin(), 4)->second == 6.5);
assert(std::next(m.begin(), 5)->first == 7);
assert(std::next(m.begin(), 5)->second == 7.5);
assert(std::next(m.begin(), 6)->first == 8);
assert(std::next(m.begin(), 6)->second == 8.5);
s = m.erase(1);
assert(m.size() == 6);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
s = m.erase(8);
assert(m.size() == 5);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 3);
assert(next(m.begin())->second == 3.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin())->first == 3);
assert(std::next(m.begin())->second == 3.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
s = m.erase(3);
assert(m.size() == 4);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 6);
assert(next(m.begin(), 2)->second == 6.5);
assert(next(m.begin(), 3)->first == 7);
assert(next(m.begin(), 3)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 6);
assert(std::next(m.begin(), 2)->second == 6.5);
assert(std::next(m.begin(), 3)->first == 7);
assert(std::next(m.begin(), 3)->second == 7.5);
s = m.erase(6);
assert(m.size() == 3);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(next(m.begin(), 2)->first == 7);
assert(next(m.begin(), 2)->second == 7.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
assert(std::next(m.begin(), 2)->first == 7);
assert(std::next(m.begin(), 2)->second == 7.5);
s = m.erase(7);
assert(m.size() == 2);
assert(s == 1);
assert(m.begin()->first == 2);
assert(m.begin()->second == 2.5);
assert(next(m.begin())->first == 5);
assert(next(m.begin())->second == 5.5);
assert(std::next(m.begin())->first == 5);
assert(std::next(m.begin())->second == 5.5);
s = m.erase(2);
assert(m.size() == 1);

View File

@ -41,8 +41,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
{
typedef std::pair<const int, double> V;
@ -63,8 +63,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
assert(*std::next(m.begin()) == V(2, 1));
assert(*std::next(m.begin(), 2) == V(3, 1));
}
return 0;

View File

@ -42,10 +42,10 @@ int main(int, char**)
assert(m.size() == 3);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 1);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 1);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 1);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 1);
}
#if TEST_STD_VER >= 11
{
@ -68,10 +68,10 @@ int main(int, char**)
assert(m.size() == 3);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 1);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 1);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 1);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 1);
}
#endif

View File

@ -41,56 +41,56 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
{
typedef std::pair<M::const_iterator, M::const_iterator> R;
@ -107,56 +107,56 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -178,56 +178,56 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
{
typedef std::pair<M::const_iterator, M::const_iterator> R;
@ -244,56 +244,56 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
}
#endif
@ -316,108 +316,108 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(C2Int(5));
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(C2Int(7));
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(C2Int(9));
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(C2Int(11));
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(C2Int(13));
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(C2Int(15));
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(C2Int(17));
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(C2Int(19));
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(C2Int(4));
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(C2Int(6));
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(C2Int(8));
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(C2Int(10));
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(C2Int(12));
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(C2Int(14));
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(C2Int(16));
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(C2Int(18));
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(C2Int(20));
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
{
typedef PrivateConstructor PC;
@ -435,56 +435,56 @@ int main(int, char**)
m [ PC::make(19) ] = 12;
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
#endif

View File

@ -43,21 +43,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -76,21 +76,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -114,21 +114,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -147,21 +147,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -186,40 +186,40 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.find(C2Int(5));
assert(r == m.begin());
r = m.find(C2Int(6));
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(C2Int(7));
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(C2Int(8));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(C2Int(9));
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(C2Int(10));
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(C2Int(11));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(C2Int(12));
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(C2Int(4));
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -240,21 +240,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -43,37 +43,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -92,37 +92,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -146,37 +146,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -195,37 +195,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -250,72 +250,72 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.lower_bound(C2Int(5));
assert(r == m.begin());
r = m.lower_bound(C2Int(7));
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(C2Int(9));
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(C2Int(11));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(C2Int(13));
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(C2Int(15));
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(C2Int(17));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(C2Int(19));
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(C2Int(4));
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(C2Int(6));
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(C2Int(8));
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(C2Int(10));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(C2Int(12));
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(C2Int(14));
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(C2Int(16));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(C2Int(18));
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(C2Int(20));
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -336,37 +336,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -40,39 +40,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -89,39 +89,39 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -143,39 +143,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -192,39 +192,39 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -246,39 +246,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -297,39 +297,39 @@ int main(int, char**)
m [ PC::make(19) ] = 12;
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -39,14 +39,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#if TEST_STD_VER >= 11
{
@ -67,14 +67,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#if TEST_STD_VER > 11
{
@ -97,14 +97,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
assert(m.get_allocator() == a);
}
#endif

View File

@ -43,14 +43,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#if TEST_STD_VER >= 11
{
@ -73,14 +73,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#endif

View File

@ -46,14 +46,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#if TEST_STD_VER >= 11
{
@ -78,14 +78,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
{
typedef std::pair<const int, double> V;
@ -109,14 +109,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
}
#endif

View File

@ -62,14 +62,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
@ -113,14 +113,14 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*m.begin() == V(1, 1));
assert(*next(m.begin()) == V(1, 1.5));
assert(*next(m.begin(), 2) == V(1, 2));
assert(*next(m.begin(), 3) == V(2, 1));
assert(*next(m.begin(), 4) == V(2, 1.5));
assert(*next(m.begin(), 5) == V(2, 2));
assert(*next(m.begin(), 6) == V(3, 1));
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
assert(*std::next(m.begin()) == V(1, 1.5));
assert(*std::next(m.begin(), 2) == V(1, 2));
assert(*std::next(m.begin(), 3) == V(2, 1));
assert(*std::next(m.begin(), 4) == V(2, 1.5));
assert(*std::next(m.begin(), 5) == V(2, 2));
assert(*std::next(m.begin(), 6) == V(3, 1));
assert(*std::next(m.begin(), 7) == V(3, 1.5));
assert(*std::next(m.begin(), 8) == V(3, 2));
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));

View File

@ -38,17 +38,17 @@ int main(int, char**)
assert(DefaultOnly::count == 1);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
assert(m.size() == 3);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == DefaultOnly());
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == DefaultOnly());
assert(DefaultOnly::count == 3);
}
assert(DefaultOnly::count == 0);
@ -70,7 +70,7 @@ int main(int, char**)
assert(m.begin()->second == Emplaceable(2, 3.5));
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple(3, 3.5));
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 3);
assert(r->first == 1);
assert(r->second == Emplaceable(3, 3.5));
@ -98,17 +98,17 @@ int main(int, char**)
assert(DefaultOnly::count == 1);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
assert(m.size() == 3);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == DefaultOnly());
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == DefaultOnly());
assert(DefaultOnly::count == 3);
}
assert(DefaultOnly::count == 0);
@ -130,7 +130,7 @@ int main(int, char**)
assert(m.begin()->second == Emplaceable(2, 3.5));
r = m.emplace(std::piecewise_construct, std::forward_as_tuple(1),
std::forward_as_tuple(3, 3.5));
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 3);
assert(r->first == 1);
assert(r->second == Emplaceable(3, 3.5));

View File

@ -39,18 +39,18 @@ int main(int, char**)
r = m.emplace_hint(m.cend(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace_hint(m.cend(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
assert(m.size() == 3);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == DefaultOnly());
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == DefaultOnly());
assert(DefaultOnly::count == 3);
}
assert(DefaultOnly::count == 0);
@ -104,18 +104,18 @@ int main(int, char**)
r = m.emplace_hint(m.cend(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == DefaultOnly());
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == DefaultOnly());
assert(DefaultOnly::count == 2);
r = m.emplace_hint(m.cend(), std::piecewise_construct,
std::forward_as_tuple(1),
std::forward_as_tuple());
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
assert(m.size() == 3);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == DefaultOnly());
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == DefaultOnly());
assert(DefaultOnly::count == 3);
}
assert(DefaultOnly::count == 0);

View File

@ -46,109 +46,109 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 9);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 8);
assert(i == next(m.begin(), 3));
assert(i == std::next(m.begin(), 3));
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 1.5);
assert(next(m.begin(), 4)->first == 2);
assert(next(m.begin(), 4)->second == 2);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 1);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 1.5);
assert(next(m.begin(), 7)->first == 3);
assert(next(m.begin(), 7)->second == 2);
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 1.5);
assert(std::next(m.begin(), 4)->first == 2);
assert(std::next(m.begin(), 4)->second == 2);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 1);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 1.5);
assert(std::next(m.begin(), 7)->first == 3);
assert(std::next(m.begin(), 7)->second == 2);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 7);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 2);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 1.5);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 2);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 1.5);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 2);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 1.5);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 2);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 1.5);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 2);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 6);
assert(i == prev(m.end()));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 2);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 1.5);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 2);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 2);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 1.5);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 2);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 5);
assert(i == next(m.begin()));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 2);
assert(i == std::next(m.begin()));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 2);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 1);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 2);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 1);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 2);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 2);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 2);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(next(m.begin(), 0)->first == 2);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 3);
assert(next(m.begin(), 1)->second == 2);
assert(i == std::next(m.begin(), 0));
assert(std::next(m.begin(), 0)->first == 2);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 3);
assert(std::next(m.begin(), 1)->second == 2);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 1);
assert(i == m.end());
assert(next(m.begin(), 0)->first == 2);
assert(next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 0)->first == 2);
assert(std::next(m.begin(), 0)->second == 1.5);
i = m.erase(m.cbegin());
assert(m.size() == 0);
@ -174,109 +174,109 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 9);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 8);
assert(i == next(m.begin(), 3));
assert(i == std::next(m.begin(), 3));
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 1.5);
assert(next(m.begin(), 4)->first == 2);
assert(next(m.begin(), 4)->second == 2);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 1);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 1.5);
assert(next(m.begin(), 7)->first == 3);
assert(next(m.begin(), 7)->second == 2);
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 1.5);
assert(std::next(m.begin(), 4)->first == 2);
assert(std::next(m.begin(), 4)->second == 2);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 1);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 1.5);
assert(std::next(m.begin(), 7)->first == 3);
assert(std::next(m.begin(), 7)->second == 2);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 7);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 2);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 1.5);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 2);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 1.5);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 2);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 1.5);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 2);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 1.5);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 2);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 6);
assert(i == prev(m.end()));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 2);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 1.5);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 2);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 2);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 1.5);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 2);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 5);
assert(i == next(m.begin()));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 2);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 2);
assert(i == std::next(m.begin()));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 2);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 2);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 1);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 2);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 1);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 2);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 2);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 2);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 2);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 2);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(next(m.begin(), 0)->first == 2);
assert(next(m.begin(), 0)->second == 1.5);
assert(next(m.begin(), 1)->first == 3);
assert(next(m.begin(), 1)->second == 2);
assert(i == std::next(m.begin(), 0));
assert(std::next(m.begin(), 0)->first == 2);
assert(std::next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 1)->first == 3);
assert(std::next(m.begin(), 1)->second == 2);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 1);
assert(i == m.end());
assert(next(m.begin(), 0)->first == 2);
assert(next(m.begin(), 0)->second == 1.5);
assert(std::next(m.begin(), 0)->first == 2);
assert(std::next(m.begin(), 0)->second == 1.5);
i = m.erase(m.cbegin());
assert(m.size() == 0);

View File

@ -42,44 +42,44 @@ int main(int, char**)
assert(i == m.begin());
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
i = m.erase(m.cbegin(), next(m.cbegin(), 2));
i = m.erase(m.cbegin(), std::next(m.cbegin(), 2));
assert(m.size() == 6);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 6));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 6));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);
@ -109,44 +109,44 @@ int main(int, char**)
assert(i == m.begin());
assert(m.begin()->first == 1);
assert(m.begin()->second == 1.5);
assert(next(m.begin())->first == 2);
assert(next(m.begin())->second == 2.5);
assert(next(m.begin(), 2)->first == 3);
assert(next(m.begin(), 2)->second == 3.5);
assert(next(m.begin(), 3)->first == 4);
assert(next(m.begin(), 3)->second == 4.5);
assert(next(m.begin(), 4)->first == 5);
assert(next(m.begin(), 4)->second == 5.5);
assert(next(m.begin(), 5)->first == 6);
assert(next(m.begin(), 5)->second == 6.5);
assert(next(m.begin(), 6)->first == 7);
assert(next(m.begin(), 6)->second == 7.5);
assert(next(m.begin(), 7)->first == 8);
assert(next(m.begin(), 7)->second == 8.5);
assert(std::next(m.begin())->first == 2);
assert(std::next(m.begin())->second == 2.5);
assert(std::next(m.begin(), 2)->first == 3);
assert(std::next(m.begin(), 2)->second == 3.5);
assert(std::next(m.begin(), 3)->first == 4);
assert(std::next(m.begin(), 3)->second == 4.5);
assert(std::next(m.begin(), 4)->first == 5);
assert(std::next(m.begin(), 4)->second == 5.5);
assert(std::next(m.begin(), 5)->first == 6);
assert(std::next(m.begin(), 5)->second == 6.5);
assert(std::next(m.begin(), 6)->first == 7);
assert(std::next(m.begin(), 6)->second == 7.5);
assert(std::next(m.begin(), 7)->first == 8);
assert(std::next(m.begin(), 7)->second == 8.5);
i = m.erase(m.cbegin(), next(m.cbegin(), 2));
i = m.erase(m.cbegin(), std::next(m.cbegin(), 2));
assert(m.size() == 6);
assert(i == m.begin());
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(next(m.begin(), 2)->first == 5);
assert(next(m.begin(), 2)->second == 5.5);
assert(next(m.begin(), 3)->first == 6);
assert(next(m.begin(), 3)->second == 6.5);
assert(next(m.begin(), 4)->first == 7);
assert(next(m.begin(), 4)->second == 7.5);
assert(next(m.begin(), 5)->first == 8);
assert(next(m.begin(), 5)->second == 8.5);
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
assert(std::next(m.begin(), 2)->first == 5);
assert(std::next(m.begin(), 2)->second == 5.5);
assert(std::next(m.begin(), 3)->first == 6);
assert(std::next(m.begin(), 3)->second == 6.5);
assert(std::next(m.begin(), 4)->first == 7);
assert(std::next(m.begin(), 4)->second == 7.5);
assert(std::next(m.begin(), 5)->first == 8);
assert(std::next(m.begin(), 5)->second == 8.5);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 6));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 6));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(next(m.begin(), 0)->first == 3);
assert(next(m.begin(), 0)->second == 3.5);
assert(next(m.begin(), 1)->first == 4);
assert(next(m.begin(), 1)->second == 4.5);
assert(i == std::next(m.begin(), 2));
assert(std::next(m.begin(), 0)->first == 3);
assert(std::next(m.begin(), 0)->second == 3.5);
assert(std::next(m.begin(), 1)->first == 4);
assert(std::next(m.begin(), 1)->second == 4.5);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);

View File

@ -41,44 +41,44 @@ int main(int, char**)
I i = m.erase(2);
assert(m.size() == 6);
assert(i == 3);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(2);
assert(m.size() == 6);
assert(i == 0);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(3);
assert(i == 3);
assert(m.size() == 3);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
i = m.erase(1);
assert(m.size() == 0);
@ -106,44 +106,44 @@ int main(int, char**)
I i = m.erase(2);
assert(m.size() == 6);
assert(i == 3);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(2);
assert(m.size() == 6);
assert(i == 0);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 3);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 3);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 3);
assert(next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 3);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 3);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 3);
assert(std::next(m.begin(), 5)->second == 2);
i = m.erase(3);
assert(i == 3);
assert(m.size() == 3);
assert(next(m.begin(), 0)->first == 1);
assert(next(m.begin(), 0)->second == 1);
assert(next(m.begin(), 1)->first == 1);
assert(next(m.begin(), 1)->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 0)->first == 1);
assert(std::next(m.begin(), 0)->second == 1);
assert(std::next(m.begin(), 1)->first == 1);
assert(std::next(m.begin(), 1)->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
i = m.erase(1);
assert(m.size() == 0);

View File

@ -42,22 +42,22 @@ int main(int, char**)
assert(m.size() == 9);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 2);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 2);
assert(next(m.begin(), 5)->second == 2);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 1);
assert(next(m.begin(), 7)->first == 3);
assert(next(m.begin(), 7)->second == 1.5);
assert(next(m.begin(), 8)->first == 3);
assert(next(m.begin(), 8)->second == 2);
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 2);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 2);
assert(std::next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 1);
assert(std::next(m.begin(), 7)->first == 3);
assert(std::next(m.begin(), 7)->second == 1.5);
assert(std::next(m.begin(), 8)->first == 3);
assert(std::next(m.begin(), 8)->second == 2);
}
#if TEST_STD_VER >= 11
{
@ -80,22 +80,22 @@ int main(int, char**)
assert(m.size() == 9);
assert(m.begin()->first == 1);
assert(m.begin()->second == 1);
assert(next(m.begin())->first == 1);
assert(next(m.begin())->second == 1.5);
assert(next(m.begin(), 2)->first == 1);
assert(next(m.begin(), 2)->second == 2);
assert(next(m.begin(), 3)->first == 2);
assert(next(m.begin(), 3)->second == 1);
assert(next(m.begin(), 4)->first == 2);
assert(next(m.begin(), 4)->second == 1.5);
assert(next(m.begin(), 5)->first == 2);
assert(next(m.begin(), 5)->second == 2);
assert(next(m.begin(), 6)->first == 3);
assert(next(m.begin(), 6)->second == 1);
assert(next(m.begin(), 7)->first == 3);
assert(next(m.begin(), 7)->second == 1.5);
assert(next(m.begin(), 8)->first == 3);
assert(next(m.begin(), 8)->second == 2);
assert(std::next(m.begin())->first == 1);
assert(std::next(m.begin())->second == 1.5);
assert(std::next(m.begin(), 2)->first == 1);
assert(std::next(m.begin(), 2)->second == 2);
assert(std::next(m.begin(), 3)->first == 2);
assert(std::next(m.begin(), 3)->second == 1);
assert(std::next(m.begin(), 4)->first == 2);
assert(std::next(m.begin(), 4)->second == 1.5);
assert(std::next(m.begin(), 5)->first == 2);
assert(std::next(m.begin(), 5)->second == 2);
assert(std::next(m.begin(), 6)->first == 3);
assert(std::next(m.begin(), 6)->second == 1);
assert(std::next(m.begin(), 7)->first == 3);
assert(std::next(m.begin(), 7)->second == 1.5);
assert(std::next(m.begin(), 8)->first == 3);
assert(std::next(m.begin(), 8)->second == 2);
}
#endif

View File

@ -46,19 +46,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
@ -83,19 +83,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
@ -124,19 +124,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
@ -161,19 +161,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
@ -203,19 +203,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());
@ -225,19 +225,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(C2Int(5));
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(C2Int(6));
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(C2Int(7));
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(C2Int(8));
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(C2Int(9));
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(C2Int(10));
assert(r.first == m.end());
assert(r.second == m.end());
@ -265,19 +265,19 @@ int main(int, char**)
assert(r.second == m.begin());
r = m.equal_range(5);
assert(r.first == m.begin());
assert(r.second == next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == m.end());
assert(r.second == m.end());

View File

@ -46,11 +46,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
}
@ -74,11 +74,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
}
@ -106,11 +106,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
}
@ -134,11 +134,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
}
@ -167,11 +167,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
@ -180,11 +180,11 @@ int main(int, char**)
r = m.find(C2Int(6));
assert(r == m.end());
r = m.find(C2Int(7));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(C2Int(8));
assert(r == m.end());
r = m.find(C2Int(9));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(C2Int(10));
assert(r == m.end());
}
@ -210,11 +210,11 @@ int main(int, char**)
r = m.find(6);
assert(r == m.end());
r = m.find(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(8);
assert(r == m.end());
r = m.find(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(10);
assert(r == m.end());
}

View File

@ -46,13 +46,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
}
@ -76,13 +76,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
}
@ -110,13 +110,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
}
@ -140,13 +140,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
}
@ -174,13 +174,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
@ -189,13 +189,13 @@ int main(int, char**)
r = m.lower_bound(C2Int(5));
assert(r == m.begin());
r = m.lower_bound(C2Int(6));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(C2Int(7));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(C2Int(8));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(C2Int(9));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(C2Int(10));
assert(r == m.end());
}
@ -221,13 +221,13 @@ int main(int, char**)
r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(10);
assert(r == m.end());
}

View File

@ -44,15 +44,15 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
}
@ -74,15 +74,15 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
}
@ -108,15 +108,15 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
}
@ -138,15 +138,15 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
}
@ -172,30 +172,30 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
r = m.upper_bound(C2Int(4));
assert(r == m.begin());
r = m.upper_bound(C2Int(5));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(C2Int(6));
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(C2Int(7));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(C2Int(8));
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(C2Int(9));
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(C2Int(10));
}
@ -218,15 +218,15 @@ int main(int, char**)
R r = m.upper_bound(4);
assert(r == m.begin());
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(10);
assert(r == m.end());
}

View File

@ -37,7 +37,7 @@ int main(int, char**)
assert(DefaultOnly::count == 1);
r = m.emplace();
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(*m.begin() == DefaultOnly());
assert(DefaultOnly::count == 2);
@ -52,11 +52,11 @@ int main(int, char**)
assert(m.size() == 1);
assert(*m.begin() == Emplaceable());
r = m.emplace(2, 3.5);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(*r == Emplaceable(2, 3.5));
r = m.emplace(2, 3.5);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
assert(m.size() == 3);
assert(*r == Emplaceable(2, 3.5));
}

View File

@ -52,11 +52,11 @@ int main(int, char**)
assert(m.size() == 1);
assert(*m.begin() == Emplaceable());
r = m.emplace_hint(m.cend(), 2, 3.5);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(*r == Emplaceable(2, 3.5));
r = m.emplace_hint(m.cbegin(), 2, 3.5);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 3);
assert(*r == Emplaceable(2, 3.5));
}

View File

@ -41,26 +41,26 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
{
typedef std::pair<M::const_iterator, M::const_iterator> R;
@ -78,26 +78,26 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
}
#if TEST_STD_VER >= 11
@ -120,26 +120,26 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
{
typedef std::pair<M::const_iterator, M::const_iterator> R;
@ -157,26 +157,26 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
}
#endif
@ -199,26 +199,26 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
{
@ -238,26 +238,26 @@ int main(int, char**)
m.insert ( V::make ( 9 ));
R r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 9));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 9));
assert(r.second == next(m.begin(), 9));
assert(r.first == std::next(m.begin(), 9));
assert(r.second == std::next(m.begin(), 9));
}
#endif

View File

@ -45,61 +45,61 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(i == std::next(m.begin()));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 5);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(m.cbegin());
assert(m.size() == 0);
@ -124,61 +124,61 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(i == std::next(m.begin()));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 5);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(m.cbegin());
assert(m.size() == 0);

View File

@ -37,42 +37,42 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 5), next(m.cbegin(), 5));
I i = m.erase(std::next(m.cbegin(), 5), std::next(m.cbegin(), 5));
assert(m.size() == 8);
assert(i == next(m.begin(), 5));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(i == std::next(m.begin(), 5));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(next(m.cbegin(), 3), next(m.cbegin(), 4));
i = m.erase(std::next(m.cbegin(), 3), std::next(m.cbegin(), 4));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 5));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 7);
assert(*next(m.begin(), 3) == 8);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 3) == 8);
i = m.erase(next(m.cbegin(), 0), next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 0), std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 8);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 8);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);
@ -96,42 +96,42 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 5), next(m.cbegin(), 5));
I i = m.erase(std::next(m.cbegin(), 5), std::next(m.cbegin(), 5));
assert(m.size() == 8);
assert(i == next(m.begin(), 5));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(i == std::next(m.begin(), 5));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(next(m.cbegin(), 3), next(m.cbegin(), 4));
i = m.erase(std::next(m.cbegin(), 3), std::next(m.cbegin(), 4));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 5));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 7);
assert(*next(m.begin(), 3) == 8);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 3) == 8);
i = m.erase(next(m.cbegin(), 0), next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 0), std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 8);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 8);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);

View File

@ -41,32 +41,32 @@ int main(int, char**)
I i = m.erase(6);
assert(m.size() == 9);
assert(i == 0);
assert(*next(m.begin(), 0) == 3);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 5);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 7);
assert(*next(m.begin(), 8) == 7);
assert(*std::next(m.begin(), 0) == 3);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 5);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 7);
assert(*std::next(m.begin(), 8) == 7);
i = m.erase(5);
assert(m.size() == 6);
assert(i == 3);
assert(*next(m.begin(), 0) == 3);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 7);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 0) == 3);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 7);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 7);
i = m.erase(3);
assert(m.size() == 3);
assert(i == 3);
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 7);
assert(*next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 7);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(7);
assert(m.size() == 0);
@ -94,32 +94,32 @@ int main(int, char**)
I i = m.erase(6);
assert(m.size() == 9);
assert(i == 0);
assert(*next(m.begin(), 0) == 3);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 5);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 7);
assert(*next(m.begin(), 8) == 7);
assert(*std::next(m.begin(), 0) == 3);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 5);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 7);
assert(*std::next(m.begin(), 8) == 7);
i = m.erase(5);
assert(m.size() == 6);
assert(i == 3);
assert(*next(m.begin(), 0) == 3);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 7);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 0) == 3);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 7);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 7);
i = m.erase(3);
assert(m.size() == 3);
assert(i == 3);
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 7);
assert(*next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 7);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(7);
assert(m.size() == 0);

View File

@ -42,21 +42,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -75,21 +75,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -113,21 +113,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -146,21 +146,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -185,21 +185,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -220,21 +220,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -41,15 +41,15 @@ int main(int, char**)
m.insert(cpp17_input_iterator<const V*>(ar),
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
}
#if TEST_STD_VER >= 11
{
@ -71,15 +71,15 @@ int main(int, char**)
m.insert(cpp17_input_iterator<const V*>(ar),
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
}
#endif

View File

@ -41,19 +41,19 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
typedef M::const_iterator R;
@ -71,19 +71,19 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
}
#if TEST_STD_VER >= 11
@ -106,19 +106,19 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
typedef M::const_iterator R;
@ -136,19 +136,19 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
}
#endif
@ -173,19 +173,19 @@ int main(int, char**)
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
@ -205,19 +205,19 @@ int main(int, char**)
m.insert ( V::make ( 9 ));
R r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(5);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(7);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(9);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
#endif

View File

@ -43,29 +43,29 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 9);
assert(std::distance(mo.begin(), mo.end()) == 9);
assert(*next(mo.begin(), 0) == 1);
assert(*next(mo.begin(), 1) == 1);
assert(*next(mo.begin(), 2) == 1);
assert(*next(mo.begin(), 3) == 2);
assert(*next(mo.begin(), 4) == 2);
assert(*next(mo.begin(), 5) == 2);
assert(*next(mo.begin(), 6) == 3);
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
assert(*std::next(mo.begin(), 0) == 1);
assert(*std::next(mo.begin(), 1) == 1);
assert(*std::next(mo.begin(), 2) == 1);
assert(*std::next(mo.begin(), 3) == 2);
assert(*std::next(mo.begin(), 4) == 2);
assert(*std::next(mo.begin(), 5) == 2);
assert(*std::next(mo.begin(), 6) == 3);
assert(*std::next(mo.begin(), 7) == 3);
assert(*std::next(mo.begin(), 8) == 3);
}
#if TEST_STD_VER >= 11
{
@ -90,29 +90,29 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 9);
assert(std::distance(mo.begin(), mo.end()) == 9);
assert(*next(mo.begin(), 0) == 1);
assert(*next(mo.begin(), 1) == 1);
assert(*next(mo.begin(), 2) == 1);
assert(*next(mo.begin(), 3) == 2);
assert(*next(mo.begin(), 4) == 2);
assert(*next(mo.begin(), 5) == 2);
assert(*next(mo.begin(), 6) == 3);
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
assert(*std::next(mo.begin(), 0) == 1);
assert(*std::next(mo.begin(), 1) == 1);
assert(*std::next(mo.begin(), 2) == 1);
assert(*std::next(mo.begin(), 3) == 2);
assert(*std::next(mo.begin(), 4) == 2);
assert(*std::next(mo.begin(), 5) == 2);
assert(*std::next(mo.begin(), 6) == 3);
assert(*std::next(mo.begin(), 7) == 3);
assert(*std::next(mo.begin(), 8) == 3);
}
#endif

View File

@ -42,29 +42,29 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 9);
assert(std::distance(mo.begin(), mo.end()) == 9);
assert(*next(mo.begin(), 0) == 1);
assert(*next(mo.begin(), 1) == 1);
assert(*next(mo.begin(), 2) == 1);
assert(*next(mo.begin(), 3) == 2);
assert(*next(mo.begin(), 4) == 2);
assert(*next(mo.begin(), 5) == 2);
assert(*next(mo.begin(), 6) == 3);
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
assert(*std::next(mo.begin(), 0) == 1);
assert(*std::next(mo.begin(), 1) == 1);
assert(*std::next(mo.begin(), 2) == 1);
assert(*std::next(mo.begin(), 3) == 2);
assert(*std::next(mo.begin(), 4) == 2);
assert(*std::next(mo.begin(), 5) == 2);
assert(*std::next(mo.begin(), 6) == 3);
assert(*std::next(mo.begin(), 7) == 3);
assert(*std::next(mo.begin(), 8) == 3);
return 0;
}

View File

@ -44,29 +44,29 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 9);
assert(std::distance(mo.begin(), mo.end()) == 9);
assert(*next(mo.begin(), 0) == 1);
assert(*next(mo.begin(), 1) == 1);
assert(*next(mo.begin(), 2) == 1);
assert(*next(mo.begin(), 3) == 2);
assert(*next(mo.begin(), 4) == 2);
assert(*next(mo.begin(), 5) == 2);
assert(*next(mo.begin(), 6) == 3);
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
assert(*std::next(mo.begin(), 0) == 1);
assert(*std::next(mo.begin(), 1) == 1);
assert(*std::next(mo.begin(), 2) == 1);
assert(*std::next(mo.begin(), 3) == 2);
assert(*std::next(mo.begin(), 4) == 2);
assert(*std::next(mo.begin(), 5) == 2);
assert(*std::next(mo.begin(), 6) == 3);
assert(*std::next(mo.begin(), 7) == 3);
assert(*std::next(mo.begin(), 8) == 3);
}
{
typedef int V;
@ -111,29 +111,29 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 9);
assert(std::distance(mo.begin(), mo.end()) == 9);
assert(*next(mo.begin(), 0) == 1);
assert(*next(mo.begin(), 1) == 1);
assert(*next(mo.begin(), 2) == 1);
assert(*next(mo.begin(), 3) == 2);
assert(*next(mo.begin(), 4) == 2);
assert(*next(mo.begin(), 5) == 2);
assert(*next(mo.begin(), 6) == 3);
assert(*next(mo.begin(), 7) == 3);
assert(*next(mo.begin(), 8) == 3);
assert(*std::next(mo.begin(), 0) == 1);
assert(*std::next(mo.begin(), 1) == 1);
assert(*std::next(mo.begin(), 2) == 1);
assert(*std::next(mo.begin(), 3) == 2);
assert(*std::next(mo.begin(), 4) == 2);
assert(*std::next(mo.begin(), 5) == 2);
assert(*std::next(mo.begin(), 6) == 3);
assert(*std::next(mo.begin(), 7) == 3);
assert(*std::next(mo.begin(), 8) == 3);
}
return 0;

View File

@ -40,15 +40,15 @@ int main(int, char**)
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
}
#if TEST_STD_VER >= 11
{
@ -69,15 +69,15 @@ int main(int, char**)
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
}
#endif

View File

@ -47,15 +47,15 @@ int main(int, char**)
assert(m.get_allocator() == A(7));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
}
#if TEST_STD_VER > 11
{
@ -79,15 +79,15 @@ int main(int, char**)
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(m.get_allocator() == a);
}
#endif

View File

@ -41,15 +41,15 @@ int main(int, char**)
assert(m.value_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
return 0;
}

View File

@ -62,15 +62,15 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
@ -99,15 +99,15 @@ int main(int, char**)
assert(m.key_comp() == C(5));
assert(m.size() == 9);
assert(std::distance(m.begin(), m.end()) == 9);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 1);
assert(*next(m.begin(), 2) == 1);
assert(*next(m.begin(), 3) == 2);
assert(*next(m.begin(), 4) == 2);
assert(*next(m.begin(), 5) == 2);
assert(*next(m.begin(), 6) == 3);
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 1);
assert(*std::next(m.begin(), 2) == 1);
assert(*std::next(m.begin(), 3) == 2);
assert(*std::next(m.begin(), 4) == 2);
assert(*std::next(m.begin(), 5) == 2);
assert(*std::next(m.begin(), 6) == 3);
assert(*std::next(m.begin(), 7) == 3);
assert(*std::next(m.begin(), 8) == 3);
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));

View File

@ -41,19 +41,19 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
typedef M::const_iterator R;
@ -71,19 +71,19 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
}
#if TEST_STD_VER >= 11
@ -106,19 +106,19 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
typedef M::const_iterator R;
@ -136,19 +136,19 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
}
#endif
@ -172,19 +172,19 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
{
@ -204,19 +204,19 @@ int main(int, char**)
m.insert ( V::make ( 9 ));
R r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(5);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(6);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(7);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(8);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(9);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
r = m.upper_bound(11);
assert(r == next(m.begin(), 9));
assert(r == std::next(m.begin(), 9));
}
#endif

View File

@ -56,12 +56,12 @@ int main(int, char**)
assert(*m.begin() == Emplaceable());
r = m.emplace(2, 3.5);
assert(r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(*r.first == Emplaceable(2, 3.5));
r = m.emplace(2, 3.5);
assert(!r.second);
assert(r.first == next(m.begin()));
assert(r.first == std::next(m.begin()));
assert(m.size() == 2);
assert(*r.first == Emplaceable(2, 3.5));
}

View File

@ -52,11 +52,11 @@ int main(int, char**)
assert(m.size() == 1);
assert(*m.begin() == Emplaceable());
r = m.emplace_hint(m.cend(), 2, 3.5);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(*r == Emplaceable(2, 3.5));
r = m.emplace_hint(m.cbegin(), 2, 3.5);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
assert(m.size() == 2);
assert(*r == Emplaceable(2, 3.5));
}

View File

@ -40,56 +40,56 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
{
typedef std::pair<M::const_iterator, M::const_iterator> R;
@ -106,56 +106,56 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -176,56 +176,56 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
#endif
#if TEST_STD_VER > 11
@ -247,56 +247,56 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
}
{
@ -315,56 +315,56 @@ int main(int, char**)
m.insert ( V::make ( 19 ));
R r = m.equal_range(5);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(7);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(9);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(11);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(13);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(15);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(17);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(19);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 8));
r = m.equal_range(4);
assert(r.first == next(m.begin(), 0));
assert(r.second == next(m.begin(), 0));
assert(r.first == std::next(m.begin(), 0));
assert(r.second == std::next(m.begin(), 0));
r = m.equal_range(6);
assert(r.first == next(m.begin(), 1));
assert(r.second == next(m.begin(), 1));
assert(r.first == std::next(m.begin(), 1));
assert(r.second == std::next(m.begin(), 1));
r = m.equal_range(8);
assert(r.first == next(m.begin(), 2));
assert(r.second == next(m.begin(), 2));
assert(r.first == std::next(m.begin(), 2));
assert(r.second == std::next(m.begin(), 2));
r = m.equal_range(10);
assert(r.first == next(m.begin(), 3));
assert(r.second == next(m.begin(), 3));
assert(r.first == std::next(m.begin(), 3));
assert(r.second == std::next(m.begin(), 3));
r = m.equal_range(12);
assert(r.first == next(m.begin(), 4));
assert(r.second == next(m.begin(), 4));
assert(r.first == std::next(m.begin(), 4));
assert(r.second == std::next(m.begin(), 4));
r = m.equal_range(14);
assert(r.first == next(m.begin(), 5));
assert(r.second == next(m.begin(), 5));
assert(r.first == std::next(m.begin(), 5));
assert(r.second == std::next(m.begin(), 5));
r = m.equal_range(16);
assert(r.first == next(m.begin(), 6));
assert(r.second == next(m.begin(), 6));
assert(r.first == std::next(m.begin(), 6));
assert(r.second == std::next(m.begin(), 6));
r = m.equal_range(18);
assert(r.first == next(m.begin(), 7));
assert(r.second == next(m.begin(), 7));
assert(r.first == std::next(m.begin(), 7));
assert(r.second == std::next(m.begin(), 7));
r = m.equal_range(20);
assert(r.first == next(m.begin(), 8));
assert(r.second == next(m.begin(), 8));
assert(r.first == std::next(m.begin(), 8));
assert(r.second == std::next(m.begin(), 8));
}
#endif

View File

@ -45,61 +45,61 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(i == std::next(m.begin()));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 5);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(m.cbegin());
assert(m.size() == 0);
@ -124,61 +124,61 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 3));
I i = m.erase(std::next(m.cbegin(), 3));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 6);
assert(i == m.begin());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 5));
assert(m.size() == 5);
assert(i == m.end());
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(next(m.cbegin(), 1));
i = m.erase(std::next(m.cbegin(), 1));
assert(m.size() == 4);
assert(i == next(m.begin()));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(i == std::next(m.begin()));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 3);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(next(m.cbegin(), 0));
i = m.erase(std::next(m.cbegin(), 0));
assert(m.size() == 1);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 5);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(m.cbegin());
assert(m.size() == 0);

View File

@ -37,42 +37,42 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 5), next(m.cbegin(), 5));
I i = m.erase(std::next(m.cbegin(), 5), std::next(m.cbegin(), 5));
assert(m.size() == 8);
assert(i == next(m.begin(), 5));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(i == std::next(m.begin(), 5));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(next(m.cbegin(), 3), next(m.cbegin(), 4));
i = m.erase(std::next(m.cbegin(), 3), std::next(m.cbegin(), 4));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 5));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 7);
assert(*next(m.begin(), 3) == 8);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 3) == 8);
i = m.erase(next(m.cbegin(), 0), next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 0), std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 8);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 8);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);
@ -96,42 +96,42 @@ int main(int, char**)
};
M m(ar, ar + sizeof(ar)/sizeof(ar[0]));
assert(m.size() == 8);
I i = m.erase(next(m.cbegin(), 5), next(m.cbegin(), 5));
I i = m.erase(std::next(m.cbegin(), 5), std::next(m.cbegin(), 5));
assert(m.size() == 8);
assert(i == next(m.begin(), 5));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(i == std::next(m.begin(), 5));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(next(m.cbegin(), 3), next(m.cbegin(), 4));
i = m.erase(std::next(m.cbegin(), 3), std::next(m.cbegin(), 4));
assert(m.size() == 7);
assert(i == next(m.begin(), 3));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(i == std::next(m.begin(), 3));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(next(m.cbegin(), 2), next(m.cbegin(), 5));
i = m.erase(std::next(m.cbegin(), 2), std::next(m.cbegin(), 5));
assert(m.size() == 4);
assert(i == next(m.begin(), 2));
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 7);
assert(*next(m.begin(), 3) == 8);
assert(i == std::next(m.begin(), 2));
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 3) == 8);
i = m.erase(next(m.cbegin(), 0), next(m.cbegin(), 2));
i = m.erase(std::next(m.cbegin(), 0), std::next(m.cbegin(), 2));
assert(m.size() == 2);
assert(i == next(m.begin(), 0));
assert(*next(m.begin(), 0) == 7);
assert(*next(m.begin(), 1) == 8);
assert(i == std::next(m.begin(), 0));
assert(*std::next(m.begin(), 0) == 7);
assert(*std::next(m.begin(), 1) == 8);
i = m.erase(m.cbegin(), m.cend());
assert(m.size() == 0);

View File

@ -40,70 +40,70 @@ int main(int, char**)
I i = m.erase(9);
assert(m.size() == 8);
assert(i == 0);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(4);
assert(m.size() == 7);
assert(i == 1);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(1);
assert(m.size() == 6);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(8);
assert(m.size() == 5);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(3);
assert(m.size() == 4);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(6);
assert(m.size() == 3);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(7);
assert(m.size() == 2);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(2);
assert(m.size() == 1);
assert(i == 1);
assert(*next(m.begin(), 0) == 5);
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(5);
assert(m.size() == 0);
@ -130,70 +130,70 @@ int main(int, char**)
I i = m.erase(9);
assert(m.size() == 8);
assert(i == 0);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 4);
assert(*next(m.begin(), 4) == 5);
assert(*next(m.begin(), 5) == 6);
assert(*next(m.begin(), 6) == 7);
assert(*next(m.begin(), 7) == 8);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 4);
assert(*std::next(m.begin(), 4) == 5);
assert(*std::next(m.begin(), 5) == 6);
assert(*std::next(m.begin(), 6) == 7);
assert(*std::next(m.begin(), 7) == 8);
i = m.erase(4);
assert(m.size() == 7);
assert(i == 1);
assert(*next(m.begin(), 0) == 1);
assert(*next(m.begin(), 1) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*next(m.begin(), 3) == 5);
assert(*next(m.begin(), 4) == 6);
assert(*next(m.begin(), 5) == 7);
assert(*next(m.begin(), 6) == 8);
assert(*std::next(m.begin(), 0) == 1);
assert(*std::next(m.begin(), 1) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(*std::next(m.begin(), 3) == 5);
assert(*std::next(m.begin(), 4) == 6);
assert(*std::next(m.begin(), 5) == 7);
assert(*std::next(m.begin(), 6) == 8);
i = m.erase(1);
assert(m.size() == 6);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*next(m.begin(), 5) == 8);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 5) == 8);
i = m.erase(8);
assert(m.size() == 5);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 3);
assert(*next(m.begin(), 2) == 5);
assert(*next(m.begin(), 3) == 6);
assert(*next(m.begin(), 4) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 3);
assert(*std::next(m.begin(), 2) == 5);
assert(*std::next(m.begin(), 3) == 6);
assert(*std::next(m.begin(), 4) == 7);
i = m.erase(3);
assert(m.size() == 4);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 6);
assert(*next(m.begin(), 3) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 6);
assert(*std::next(m.begin(), 3) == 7);
i = m.erase(6);
assert(m.size() == 3);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*next(m.begin(), 2) == 7);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 2) == 7);
i = m.erase(7);
assert(m.size() == 2);
assert(i == 1);
assert(*next(m.begin(), 0) == 2);
assert(*next(m.begin(), 1) == 5);
assert(*std::next(m.begin(), 0) == 2);
assert(*std::next(m.begin(), 1) == 5);
i = m.erase(2);
assert(m.size() == 1);
assert(i == 1);
assert(*next(m.begin(), 0) == 5);
assert(*std::next(m.begin(), 0) == 5);
i = m.erase(5);
assert(m.size() == 0);

View File

@ -42,21 +42,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -75,21 +75,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -113,21 +113,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -146,21 +146,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -185,21 +185,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -220,21 +220,21 @@ int main(int, char**)
R r = m.find(5);
assert(r == m.begin());
r = m.find(6);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.find(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.find(8);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.find(9);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.find(10);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.find(11);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.find(12);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.find(4);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -42,8 +42,8 @@ int main(int, char**)
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
}
#if TEST_STD_VER >= 11
{
@ -66,8 +66,8 @@ int main(int, char**)
cpp17_input_iterator<const V*>(ar + sizeof(ar)/sizeof(ar[0])));
assert(m.size() == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
}
#endif

View File

@ -42,37 +42,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -91,37 +91,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -145,37 +145,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -194,37 +194,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -249,37 +249,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -300,37 +300,37 @@ int main(int, char**)
R r = m.lower_bound(5);
assert(r == m.begin());
r = m.lower_bound(7);
assert(r == next(m.begin()));
assert(r == std::next(m.begin()));
r = m.lower_bound(9);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(11);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(13);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(15);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(17);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(19);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.lower_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.lower_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.lower_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.lower_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.lower_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.lower_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.lower_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.lower_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -44,16 +44,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == 1);
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
assert(*std::next(mo.begin()) == 2);
assert(*std::next(mo.begin(), 2) == 3);
}
#if TEST_STD_VER >= 11
{
@ -79,16 +79,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == 1);
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
assert(*std::next(mo.begin()) == 2);
assert(*std::next(mo.begin(), 2) == 3);
}
#endif

View File

@ -43,16 +43,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(7));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == 1);
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
assert(*std::next(mo.begin()) == 2);
assert(*std::next(mo.begin(), 2) == 3);
return 0;
}

View File

@ -45,16 +45,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == 1);
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
assert(*std::next(mo.begin()) == 2);
assert(*std::next(mo.begin(), 2) == 3);
}
{
typedef int V;
@ -95,16 +95,16 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(2));
assert(mo.key_comp() == C(5));
assert(mo.size() == 3);
assert(std::distance(mo.begin(), mo.end()) == 3);
assert(*mo.begin() == 1);
assert(*next(mo.begin()) == 2);
assert(*next(mo.begin(), 2) == 3);
assert(*std::next(mo.begin()) == 2);
assert(*std::next(mo.begin(), 2) == 3);
}
return 0;

View File

@ -41,8 +41,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
}
#if TEST_STD_VER >= 11
{
@ -64,8 +64,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
}
#endif

View File

@ -52,8 +52,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
}
#if TEST_STD_VER > 11
{
@ -78,8 +78,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(m.get_allocator() == a);
}
#endif

View File

@ -42,8 +42,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
return 0;
}

View File

@ -63,8 +63,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
assert(mo.key_comp() == C(5));
@ -94,8 +94,8 @@ int main(int, char**)
assert(m.size() == 3);
assert(std::distance(m.begin(), m.end()) == 3);
assert(*m.begin() == 1);
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
assert(*std::next(m.begin()) == 2);
assert(*std::next(m.begin(), 2) == 3);
assert(mo.get_allocator() == A());
assert(mo.key_comp() == C(5));

View File

@ -40,39 +40,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -89,39 +89,39 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#if TEST_STD_VER >= 11
@ -143,39 +143,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
typedef M::const_iterator R;
@ -192,39 +192,39 @@ int main(int, char**)
};
const M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
}
#endif
@ -247,39 +247,39 @@ int main(int, char**)
};
M m(ar, ar+sizeof(ar)/sizeof(ar[0]));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
{
@ -298,39 +298,39 @@ int main(int, char**)
m.insert ( V::make ( 19 ));
R r = m.upper_bound(5);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(7);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(9);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(11);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(13);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(15);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(17);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(19);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
r = m.upper_bound(4);
assert(r == next(m.begin(), 0));
assert(r == std::next(m.begin(), 0));
r = m.upper_bound(6);
assert(r == next(m.begin(), 1));
assert(r == std::next(m.begin(), 1));
r = m.upper_bound(8);
assert(r == next(m.begin(), 2));
assert(r == std::next(m.begin(), 2));
r = m.upper_bound(10);
assert(r == next(m.begin(), 3));
assert(r == std::next(m.begin(), 3));
r = m.upper_bound(12);
assert(r == next(m.begin(), 4));
assert(r == std::next(m.begin(), 4));
r = m.upper_bound(14);
assert(r == next(m.begin(), 5));
assert(r == std::next(m.begin(), 5));
r = m.upper_bound(16);
assert(r == next(m.begin(), 6));
assert(r == std::next(m.begin(), 6));
r = m.upper_bound(18);
assert(r == next(m.begin(), 7));
assert(r == std::next(m.begin(), 7));
r = m.upper_bound(20);
assert(r == next(m.begin(), 8));
assert(r == std::next(m.begin(), 8));
}
#endif

View File

@ -33,24 +33,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.emplace_after(c.cbegin(), 1, 2.5);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == Emplaceable());
assert(*next(c.begin()) == Emplaceable(1, 2.5));
assert(*std::next(c.begin()) == Emplaceable(1, 2.5));
assert(std::distance(c.begin(), c.end()) == 2);
i = c.emplace_after(next(c.cbegin()), 2, 3.5);
assert(i == next(c.begin(), 2));
i = c.emplace_after(std::next(c.cbegin()), 2, 3.5);
assert(i == std::next(c.begin(), 2));
assert(c.front() == Emplaceable());
assert(*next(c.begin()) == Emplaceable(1, 2.5));
assert(*next(c.begin(), 2) == Emplaceable(2, 3.5));
assert(*std::next(c.begin()) == Emplaceable(1, 2.5));
assert(*std::next(c.begin(), 2) == Emplaceable(2, 3.5));
assert(std::distance(c.begin(), c.end()) == 3);
i = c.emplace_after(c.cbegin(), 3, 4.5);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == Emplaceable());
assert(*next(c.begin(), 1) == Emplaceable(3, 4.5));
assert(*next(c.begin(), 2) == Emplaceable(1, 2.5));
assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(*std::next(c.begin(), 1) == Emplaceable(3, 4.5));
assert(*std::next(c.begin(), 2) == Emplaceable(1, 2.5));
assert(*std::next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(std::distance(c.begin(), c.end()) == 4);
}
{
@ -64,24 +64,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.emplace_after(c.cbegin(), 1, 2.5);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == Emplaceable());
assert(*next(c.begin()) == Emplaceable(1, 2.5));
assert(*std::next(c.begin()) == Emplaceable(1, 2.5));
assert(std::distance(c.begin(), c.end()) == 2);
i = c.emplace_after(next(c.cbegin()), 2, 3.5);
assert(i == next(c.begin(), 2));
i = c.emplace_after(std::next(c.cbegin()), 2, 3.5);
assert(i == std::next(c.begin(), 2));
assert(c.front() == Emplaceable());
assert(*next(c.begin()) == Emplaceable(1, 2.5));
assert(*next(c.begin(), 2) == Emplaceable(2, 3.5));
assert(*std::next(c.begin()) == Emplaceable(1, 2.5));
assert(*std::next(c.begin(), 2) == Emplaceable(2, 3.5));
assert(std::distance(c.begin(), c.end()) == 3);
i = c.emplace_after(c.cbegin(), 3, 4.5);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == Emplaceable());
assert(*next(c.begin(), 1) == Emplaceable(3, 4.5));
assert(*next(c.begin(), 2) == Emplaceable(1, 2.5));
assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(*std::next(c.begin(), 1) == Emplaceable(3, 4.5));
assert(*std::next(c.begin(), 2) == Emplaceable(1, 2.5));
assert(*std::next(c.begin(), 3) == Emplaceable(2, 3.5));
assert(std::distance(c.begin(), c.end()) == 4);
}

View File

@ -42,7 +42,7 @@ int main(int, char**)
c.emplace_front(1, 2.5);
assert(c.front() == Emplaceable(1, 2.5));
#endif
assert(*next(c.begin()) == Emplaceable());
assert(*std::next(c.begin()) == Emplaceable());
assert(std::distance(c.begin(), c.end()) == 2);
}
{
@ -64,7 +64,7 @@ int main(int, char**)
c.emplace_front(1, 2.5);
assert(c.front() == Emplaceable(1, 2.5));
#endif
assert(*next(c.begin()) == Emplaceable());
assert(*std::next(c.begin()) == Emplaceable());
assert(std::distance(c.begin(), c.end()) == 2);
}

View File

@ -24,62 +24,62 @@ int main(int, char**)
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(std::begin(t), std::end(t));
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4), next(c.cbefore_begin(), 4));
assert(i == next(c.cbefore_begin(), 4));
C::iterator i = c.erase_after(std::next(c.cbefore_begin(), 4), std::next(c.cbefore_begin(), 4));
assert(i == std::next(c.cbefore_begin(), 4));
assert(std::distance(c.begin(), c.end()) == 10);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*next(c.begin(), 4) == 4);
assert(*next(c.begin(), 5) == 5);
assert(*next(c.begin(), 6) == 6);
assert(*next(c.begin(), 7) == 7);
assert(*next(c.begin(), 8) == 8);
assert(*next(c.begin(), 9) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 4) == 4);
assert(*std::next(c.begin(), 5) == 5);
assert(*std::next(c.begin(), 6) == 6);
assert(*std::next(c.begin(), 7) == 7);
assert(*std::next(c.begin(), 8) == 8);
assert(*std::next(c.begin(), 9) == 9);
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 5));
assert(i == next(c.begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 2), std::next(c.cbefore_begin(), 5));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 8);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*next(c.begin(), 5) == 7);
assert(*next(c.begin(), 6) == 8);
assert(*next(c.begin(), 7) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 5) == 7);
assert(*std::next(c.begin(), 6) == 8);
assert(*std::next(c.begin(), 7) == 9);
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 3));
assert(i == next(c.begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 2), std::next(c.cbefore_begin(), 3));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 8);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*next(c.begin(), 5) == 7);
assert(*next(c.begin(), 6) == 8);
assert(*next(c.begin(), 7) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 5) == 7);
assert(*std::next(c.begin(), 6) == 8);
assert(*std::next(c.begin(), 7) == 9);
i = c.erase_after(next(c.cbefore_begin(), 5), next(c.cbefore_begin(), 9));
i = c.erase_after(std::next(c.cbefore_begin(), 5), std::next(c.cbefore_begin(), 9));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 0), std::next(c.cbefore_begin(), 2));
assert(i == c.begin());
assert(std::distance(c.begin(), c.end()) == 4);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 4);
assert(*next(c.begin(), 2) == 5);
assert(*next(c.begin(), 3) == 6);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 4);
assert(*std::next(c.begin(), 2) == 5);
assert(*std::next(c.begin(), 3) == 6);
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 5));
i = c.erase_after(std::next(c.cbefore_begin(), 0), std::next(c.cbefore_begin(), 5));
assert(i == c.begin());
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 0);
@ -91,62 +91,62 @@ int main(int, char**)
const T t[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
C c(std::begin(t), std::end(t));
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4), next(c.cbefore_begin(), 4));
assert(i == next(c.cbefore_begin(), 4));
C::iterator i = c.erase_after(std::next(c.cbefore_begin(), 4), std::next(c.cbefore_begin(), 4));
assert(i == std::next(c.cbefore_begin(), 4));
assert(std::distance(c.begin(), c.end()) == 10);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*next(c.begin(), 4) == 4);
assert(*next(c.begin(), 5) == 5);
assert(*next(c.begin(), 6) == 6);
assert(*next(c.begin(), 7) == 7);
assert(*next(c.begin(), 8) == 8);
assert(*next(c.begin(), 9) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 4) == 4);
assert(*std::next(c.begin(), 5) == 5);
assert(*std::next(c.begin(), 6) == 6);
assert(*std::next(c.begin(), 7) == 7);
assert(*std::next(c.begin(), 8) == 8);
assert(*std::next(c.begin(), 9) == 9);
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 5));
assert(i == next(c.begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 2), std::next(c.cbefore_begin(), 5));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 8);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*next(c.begin(), 5) == 7);
assert(*next(c.begin(), 6) == 8);
assert(*next(c.begin(), 7) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 5) == 7);
assert(*std::next(c.begin(), 6) == 8);
assert(*std::next(c.begin(), 7) == 9);
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 3));
assert(i == next(c.begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 2), std::next(c.cbefore_begin(), 3));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 8);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*next(c.begin(), 5) == 7);
assert(*next(c.begin(), 6) == 8);
assert(*next(c.begin(), 7) == 9);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 5) == 7);
assert(*std::next(c.begin(), 6) == 8);
assert(*std::next(c.begin(), 7) == 9);
i = c.erase_after(next(c.cbefore_begin(), 5), next(c.cbefore_begin(), 9));
i = c.erase_after(std::next(c.cbefore_begin(), 5), std::next(c.cbefore_begin(), 9));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 5);
assert(*next(c.begin(), 4) == 6);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 5);
assert(*std::next(c.begin(), 4) == 6);
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 2));
i = c.erase_after(std::next(c.cbefore_begin(), 0), std::next(c.cbefore_begin(), 2));
assert(i == c.begin());
assert(std::distance(c.begin(), c.end()) == 4);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 4);
assert(*next(c.begin(), 2) == 5);
assert(*next(c.begin(), 3) == 6);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 4);
assert(*std::next(c.begin(), 2) == 5);
assert(*std::next(c.begin(), 3) == 6);
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 5));
i = c.erase_after(std::next(c.cbefore_begin(), 0), std::next(c.cbefore_begin(), 5));
assert(i == c.begin());
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 0);

View File

@ -24,33 +24,33 @@ int main(int, char**)
const T t[] = {0, 1, 2, 3, 4};
C c(std::begin(t), std::end(t));
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4));
C::iterator i = c.erase_after(std::next(c.cbefore_begin(), 4));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 4);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
i = c.erase_after(next(c.cbefore_begin(), 0));
i = c.erase_after(std::next(c.cbefore_begin(), 0));
assert(i == c.begin());
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 2);
assert(*next(c.begin(), 2) == 3);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 2);
assert(*std::next(c.begin(), 2) == 3);
i = c.erase_after(next(c.cbefore_begin(), 1));
assert(i == next(c.begin()));
i = c.erase_after(std::next(c.cbefore_begin(), 1));
assert(i == std::next(c.begin()));
assert(std::distance(c.begin(), c.end()) == 2);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 3);
i = c.erase_after(next(c.cbefore_begin(), 1));
i = c.erase_after(std::next(c.cbefore_begin(), 1));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 1);
assert(*next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 0) == 1);
i = c.erase_after(next(c.cbefore_begin(), 0));
i = c.erase_after(std::next(c.cbefore_begin(), 0));
assert(i == c.begin());
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 0);
@ -62,33 +62,33 @@ int main(int, char**)
const T t[] = {0, 1, 2, 3, 4};
C c(std::begin(t), std::end(t));
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4));
C::iterator i = c.erase_after(std::next(c.cbefore_begin(), 4));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 4);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
i = c.erase_after(next(c.cbefore_begin(), 0));
i = c.erase_after(std::next(c.cbefore_begin(), 0));
assert(i == c.begin());
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 2);
assert(*next(c.begin(), 2) == 3);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 2);
assert(*std::next(c.begin(), 2) == 3);
i = c.erase_after(next(c.cbefore_begin(), 1));
assert(i == next(c.begin()));
i = c.erase_after(std::next(c.cbefore_begin(), 1));
assert(i == std::next(c.begin()));
assert(std::distance(c.begin(), c.end()) == 2);
assert(*next(c.begin(), 0) == 1);
assert(*next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 1) == 3);
i = c.erase_after(next(c.cbefore_begin(), 1));
i = c.erase_after(std::next(c.cbefore_begin(), 1));
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 1);
assert(*next(c.begin(), 0) == 1);
assert(*std::next(c.begin(), 0) == 1);
i = c.erase_after(next(c.cbefore_begin(), 0));
i = c.erase_after(std::next(c.cbefore_begin(), 0));
assert(i == c.begin());
assert(i == c.end());
assert(std::distance(c.begin(), c.end()) == 0);

View File

@ -30,24 +30,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.insert_after(c.cbegin(), 1);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
i = c.insert_after(next(c.cbegin()), 2);
assert(i == next(c.begin(), 2));
i = c.insert_after(std::next(c.cbegin()), 2);
assert(i == std::next(c.begin(), 2));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin()) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(std::distance(c.begin(), c.end()) == 3);
i = c.insert_after(c.cbegin(), 3);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 1);
assert(*next(c.begin(), 3) == 2);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 1);
assert(*std::next(c.begin(), 3) == 2);
assert(std::distance(c.begin(), c.end()) == 4);
}
#if TEST_STD_VER >= 11
@ -63,24 +63,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.insert_after(c.cbegin(), 1);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
i = c.insert_after(next(c.cbegin()), 2);
assert(i == next(c.begin(), 2));
i = c.insert_after(std::next(c.cbegin()), 2);
assert(i == std::next(c.begin(), 2));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin()) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(std::distance(c.begin(), c.end()) == 3);
i = c.insert_after(c.cbegin(), 3);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 1);
assert(*next(c.begin(), 3) == 2);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 1);
assert(*std::next(c.begin(), 3) == 2);
assert(std::distance(c.begin(), c.end()) == 4);
}
#endif

View File

@ -30,20 +30,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), {0, 1, 2});
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
i = c.insert_after(c.begin(), {3, 4});
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 1);
assert(*std::next(c.begin(), 4) == 2);
}
{
typedef int T;
@ -55,20 +55,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), {0, 1, 2});
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
i = c.insert_after(c.begin(), {3, 4});
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 1);
assert(*std::next(c.begin(), 4) == 2);
}
return 0;

View File

@ -33,20 +33,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), J(t), J(t+3));
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
i = c.insert_after(c.begin(), J(t+3), J(t+5));
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 1);
assert(*std::next(c.begin(), 4) == 2);
}
#if TEST_STD_VER >= 11
{
@ -61,20 +61,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), J(t), J(t+3));
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
i = c.insert_after(c.begin(), J(t+3), J(t+5));
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 4);
assert(*next(c.begin(), 3) == 1);
assert(*next(c.begin(), 4) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 4);
assert(*std::next(c.begin(), 3) == 1);
assert(*std::next(c.begin(), 4) == 2);
}
#endif

View File

@ -33,24 +33,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.insert_after(c.cbegin(), 1);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
i = c.insert_after(next(c.cbegin()), 2);
assert(i == next(c.begin(), 2));
i = c.insert_after(std::next(c.cbegin()), 2);
assert(i == std::next(c.begin(), 2));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin()) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(std::distance(c.begin(), c.end()) == 3);
i = c.insert_after(c.cbegin(), 3);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 1);
assert(*next(c.begin(), 3) == 2);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 1);
assert(*std::next(c.begin(), 3) == 2);
assert(std::distance(c.begin(), c.end()) == 4);
}
{
@ -65,24 +65,24 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
i = c.insert_after(c.cbegin(), 1);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
i = c.insert_after(next(c.cbegin()), 2);
assert(i == next(c.begin(), 2));
i = c.insert_after(std::next(c.cbegin()), 2);
assert(i == std::next(c.begin(), 2));
assert(c.front() == 0);
assert(*next(c.begin()) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin()) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(std::distance(c.begin(), c.end()) == 3);
i = c.insert_after(c.cbegin(), 3);
assert(i == next(c.begin()));
assert(i == std::next(c.begin()));
assert(c.front() == 0);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 1);
assert(*next(c.begin(), 3) == 2);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 1);
assert(*std::next(c.begin(), 3) == 2);
assert(std::distance(c.begin(), c.end()) == 4);
}

View File

@ -28,20 +28,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), 3, 3);
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 3);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 3);
assert(*std::next(c.begin(), 0) == 3);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 3);
i = c.insert_after(c.begin(), 2, 2);
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 3);
assert(*next(c.begin(), 1) == 2);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*next(c.begin(), 4) == 3);
assert(*std::next(c.begin(), 0) == 3);
assert(*std::next(c.begin(), 1) == 2);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 4) == 3);
}
#if TEST_STD_VER >= 11
{
@ -54,20 +54,20 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 0);
i = c.insert_after(c.cbefore_begin(), 3, 3);
assert(i == next(c.before_begin(), 3));
assert(i == std::next(c.before_begin(), 3));
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 3);
assert(*next(c.begin(), 1) == 3);
assert(*next(c.begin(), 2) == 3);
assert(*std::next(c.begin(), 0) == 3);
assert(*std::next(c.begin(), 1) == 3);
assert(*std::next(c.begin(), 2) == 3);
i = c.insert_after(c.begin(), 2, 2);
assert(i == next(c.begin(), 2));
assert(i == std::next(c.begin(), 2));
assert(std::distance(c.begin(), c.end()) == 5);
assert(*next(c.begin(), 0) == 3);
assert(*next(c.begin(), 1) == 2);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 3);
assert(*next(c.begin(), 4) == 3);
assert(*std::next(c.begin(), 0) == 3);
assert(*std::next(c.begin(), 1) == 2);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 3);
assert(*std::next(c.begin(), 4) == 3);
}
#endif

View File

@ -27,7 +27,7 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
c.push_front(3);
assert(c.front() == 3);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
}
#if TEST_STD_VER >= 11
@ -40,7 +40,7 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
c.push_front(3);
assert(c.front() == 3);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
}
#endif

View File

@ -30,7 +30,7 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
c.push_front(3);
assert(c.front() == 3);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
}
{
@ -42,7 +42,7 @@ int main(int, char**)
assert(std::distance(c.begin(), c.end()) == 1);
c.push_front(3);
assert(c.front() == 3);
assert(*next(c.begin()) == 1);
assert(*std::next(c.begin()) == 1);
assert(std::distance(c.begin(), c.end()) == 2);
}

View File

@ -42,27 +42,27 @@ int main(int, char**)
c.resize(3);
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
c.resize(6);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 0);
assert(*next(c.begin(), 4) == 0);
assert(*next(c.begin(), 5) == 0);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 0);
assert(*std::next(c.begin(), 4) == 0);
assert(*std::next(c.begin(), 5) == 0);
c.resize(6);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 0);
assert(*next(c.begin(), 4) == 0);
assert(*next(c.begin(), 5) == 0);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 0);
assert(*std::next(c.begin(), 4) == 0);
assert(*std::next(c.begin(), 5) == 0);
}
#if TEST_STD_VER >= 11
{
@ -88,27 +88,27 @@ int main(int, char**)
c.resize(3);
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
c.resize(6);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 0);
assert(*next(c.begin(), 4) == 0);
assert(*next(c.begin(), 5) == 0);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 0);
assert(*std::next(c.begin(), 4) == 0);
assert(*std::next(c.begin(), 5) == 0);
c.resize(6);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 0);
assert(*next(c.begin(), 4) == 0);
assert(*next(c.begin(), 5) == 0);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 0);
assert(*std::next(c.begin(), 4) == 0);
assert(*std::next(c.begin(), 5) == 0);
}
#endif

View File

@ -31,27 +31,27 @@ int main(int, char**)
c.resize(3, 10);
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
c.resize(6, 10);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 10);
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 10);
assert(*std::next(c.begin(), 4) == 10);
assert(*std::next(c.begin(), 5) == 10);
c.resize(6, 12);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 10);
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 10);
assert(*std::next(c.begin(), 4) == 10);
assert(*std::next(c.begin(), 5) == 10);
}
#if TEST_STD_VER >= 11
{
@ -62,27 +62,27 @@ int main(int, char**)
c.resize(3, 10);
assert(std::distance(c.begin(), c.end()) == 3);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
c.resize(6, 10);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 10);
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 10);
assert(*std::next(c.begin(), 4) == 10);
assert(*std::next(c.begin(), 5) == 10);
c.resize(6, 12);
assert(std::distance(c.begin(), c.end()) == 6);
assert(*next(c.begin(), 0) == 0);
assert(*next(c.begin(), 1) == 1);
assert(*next(c.begin(), 2) == 2);
assert(*next(c.begin(), 3) == 10);
assert(*next(c.begin(), 4) == 10);
assert(*next(c.begin(), 5) == 10);
assert(*std::next(c.begin(), 0) == 0);
assert(*std::next(c.begin(), 1) == 1);
assert(*std::next(c.begin(), 2) == 2);
assert(*std::next(c.begin(), 3) == 10);
assert(*std::next(c.begin(), 4) == 10);
assert(*std::next(c.begin(), 5) == 10);
}
{
// Test that the allocator's construct method is being used to

View File

@ -51,7 +51,7 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(t2, t2+l);
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2));
testd(c1, p, l);
}
}
@ -67,7 +67,7 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(t2, t2+l);
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2));
testd(c1, p, l);
}
}

View File

@ -87,8 +87,8 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2),
next(c2.cbefore_begin(), f));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2),
std::next(c2.cbefore_begin(), f));
testd(c1, p, f);
}
}
@ -100,8 +100,8 @@ int main(int, char**)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f));
tests(c1, p, f);
}
}
@ -117,8 +117,8 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2),
next(c2.cbefore_begin(), f));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2),
std::next(c2.cbefore_begin(), f));
testd(c1, p, f);
}
}
@ -130,8 +130,8 @@ int main(int, char**)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f));
tests(c1, p, f);
}
}

View File

@ -91,8 +91,8 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2),
next(c2.cbefore_begin(), f), next(c2.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2),
std::next(c2.cbefore_begin(), f), std::next(c2.cbefore_begin(), l));
testd(c1, p, f, l);
}
}
@ -107,16 +107,16 @@ int main(int, char**)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f), next(c1.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
for (ptrdiff_t p = l; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f), next(c1.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
}
@ -135,8 +135,8 @@ int main(int, char**)
C c1(std::begin(t1), std::end(t1));
C c2(std::begin(t2), std::end(t2));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c2),
next(c2.cbefore_begin(), f), next(c2.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c2),
std::next(c2.cbefore_begin(), f), std::next(c2.cbefore_begin(), l));
testd(c1, p, f, l);
}
}
@ -151,16 +151,16 @@ int main(int, char**)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f), next(c1.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
for (ptrdiff_t p = l; p <= size_t1; ++p)
{
C c1(std::begin(t1), std::end(t1));
c1.splice_after(next(c1.cbefore_begin(), p), std::move(c1),
next(c1.cbefore_begin(), f), next(c1.cbefore_begin(), l));
c1.splice_after(std::next(c1.cbefore_begin(), p), std::move(c1),
std::next(c1.cbefore_begin(), f), std::next(c1.cbefore_begin(), l));
tests(c1, p, f, l);
}
}

View File

@ -31,18 +31,18 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator().get_id() == 2);
}
{
@ -58,12 +58,12 @@ int main(int, char**)
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator().get_id() == 2);
}
{
@ -76,9 +76,9 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 0);
@ -110,18 +110,18 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A(1));
}
{
@ -137,12 +137,12 @@ int main(int, char**)
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A(1));
}
{
@ -155,9 +155,9 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 0);
@ -189,18 +189,18 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A());
}
{
@ -216,12 +216,12 @@ int main(int, char**)
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A());
}
{
@ -234,9 +234,9 @@ int main(int, char**)
c1.swap(c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 0);

View File

@ -32,18 +32,18 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator().get_id() == 2);
}
{
@ -59,12 +59,12 @@ int main(int, char**)
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator().get_id() == 2);
}
{
@ -77,9 +77,9 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator().get_id() == 1);
assert(std::distance(c2.begin(), c2.end()) == 0);
@ -111,18 +111,18 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A(1));
}
{
@ -138,12 +138,12 @@ int main(int, char**)
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A(1));
}
{
@ -156,9 +156,9 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A(2));
assert(std::distance(c2.begin(), c2.end()) == 0);
@ -190,18 +190,18 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A());
}
{
@ -217,12 +217,12 @@ int main(int, char**)
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 6);
assert(*next(c2.begin(), 0) == 0);
assert(*next(c2.begin(), 1) == 1);
assert(*next(c2.begin(), 2) == 2);
assert(*next(c2.begin(), 3) == 3);
assert(*next(c2.begin(), 4) == 4);
assert(*next(c2.begin(), 5) == 5);
assert(*std::next(c2.begin(), 0) == 0);
assert(*std::next(c2.begin(), 1) == 1);
assert(*std::next(c2.begin(), 2) == 2);
assert(*std::next(c2.begin(), 3) == 3);
assert(*std::next(c2.begin(), 4) == 4);
assert(*std::next(c2.begin(), 5) == 5);
assert(c2.get_allocator() == A());
}
{
@ -235,9 +235,9 @@ int main(int, char**)
swap(c1, c2);
assert(std::distance(c1.begin(), c1.end()) == 3);
assert(*next(c1.begin(), 0) == 10);
assert(*next(c1.begin(), 1) == 11);
assert(*next(c1.begin(), 2) == 12);
assert(*std::next(c1.begin(), 0) == 10);
assert(*std::next(c1.begin(), 1) == 11);
assert(*std::next(c1.begin(), 2) == 12);
assert(c1.get_allocator() == A());
assert(std::distance(c2.begin(), c2.end()) == 0);

View File

@ -28,7 +28,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
assert(*std::next(l1.begin()) == 3);
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);
@ -50,7 +50,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
assert(*std::next(l1.begin()) == 3);
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);

View File

@ -28,7 +28,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+3);
std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::list<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -36,7 +36,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+3);
std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::list<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -44,7 +44,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+3);
std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::list<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
@ -59,7 +59,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -67,7 +67,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -75,7 +75,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::list<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());

View File

@ -22,9 +22,9 @@ int main(int, char**)
{
{
std::list<int> d(10, 1);
std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
std::list<int>::iterator i = d.insert(std::next(d.cbegin(), 2), {3, 4, 5, 6});
assert(d.size() == 14);
assert(i == next(d.begin(), 2));
assert(i == std::next(d.begin(), 2));
i = d.begin();
assert(*i++ == 1);
assert(*i++ == 1);
@ -43,9 +43,9 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> d(10, 1);
std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
std::list<int, min_allocator<int>>::iterator i = d.insert(std::next(d.cbegin(), 2), {3, 4, 5, 6});
assert(d.size() == 14);
assert(i == next(d.begin(), 2));
assert(i == std::next(d.begin(), 2));
i = d.begin();
assert(*i++ == 1);
assert(*i++ == 1);

View File

@ -25,8 +25,8 @@ void test() {
int a1[] = {1, 2, 3};
int a2[] = {1, 4, 4, 4, 4, 4, 2, 3};
List l1(a1, a1+3);
typename List::iterator i = l1.insert(next(l1.cbegin()), 5, 4);
assert(i == next(l1.begin()));
typename List::iterator i = l1.insert(std::next(l1.cbegin()), 5, 4);
assert(i == std::next(l1.begin()));
assert(l1 == List(a2, a2+8));
#ifndef TEST_HAS_NO_EXCEPTIONS
globalMemCounter.throw_after = 4;

View File

@ -24,8 +24,8 @@ void test()
int a1[] = {1, 2, 3};
int a2[] = {1, 4, 2, 3};
List l1(a1, a1+3);
typename List::iterator i = l1.insert(next(l1.cbegin()), 4);
assert(i == next(l1.begin()));
typename List::iterator i = l1.insert(std::next(l1.cbegin()), 4);
assert(i == std::next(l1.begin()));
assert(l1.size() == 4);
assert(std::distance(l1.begin(), l1.end()) == 4);
assert(l1 == List(a2, a2+4));

View File

@ -196,7 +196,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2;
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -209,7 +209,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2;
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -237,7 +237,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2(a2, a2+1);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
assert(l2.size() == 0);
@ -252,7 +252,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2(a2, a2+1);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
assert(l2.size() == 0);
@ -284,7 +284,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2(a2, a2+2);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 4);
assert(std::distance(l1.begin(), l1.end()) == 4);
assert(l2.size() == 0);
@ -301,7 +301,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+2);
std::list<int> l2(a2, a2+2);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 4);
assert(std::distance(l1.begin(), l1.end()) == 4);
assert(l2.size() == 0);
@ -339,7 +339,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);
@ -360,7 +360,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);
@ -381,7 +381,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(next(l1.begin(), 3), l2);
l1.splice(std::next(l1.begin(), 3), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);
@ -576,7 +576,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2;
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -589,7 +589,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2;
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -617,7 +617,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2(a2, a2+1);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
assert(l2.size() == 0);
@ -632,7 +632,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2(a2, a2+1);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
assert(l2.size() == 0);
@ -664,7 +664,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2(a2, a2+2);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 4);
assert(std::distance(l1.begin(), l1.end()) == 4);
assert(l2.size() == 0);
@ -681,7 +681,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
std::list<int, min_allocator<int>> l2(a2, a2+2);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 4);
assert(std::distance(l1.begin(), l1.end()) == 4);
assert(l2.size() == 0);
@ -719,7 +719,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(next(l1.begin()), l2);
l1.splice(std::next(l1.begin()), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);
@ -740,7 +740,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(next(l1.begin(), 2), l2);
l1.splice(std::next(l1.begin(), 2), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);
@ -761,7 +761,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(next(l1.begin(), 3), l2);
l1.splice(std::next(l1.begin(), 3), l2);
assert(l1.size() == 6);
assert(std::distance(l1.begin(), l1.end()) == 6);
assert(l2.size() == 0);

View File

@ -47,7 +47,7 @@ int main(int, char**)
{
std::list<int> l1;
std::list<int> l2(a2, a2+2);
l1.splice(l1.end(), l2, next(l2.begin()));
l1.splice(l1.end(), l2, std::next(l2.begin()));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 1);
@ -75,7 +75,7 @@ int main(int, char**)
{
std::list<int> l1;
std::list<int> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin()));
l1.splice(l1.end(), l2, std::next(l2.begin()));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 2);
@ -90,7 +90,7 @@ int main(int, char**)
{
std::list<int> l1;
std::list<int> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin(), 2));
l1.splice(l1.end(), l2, std::next(l2.begin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 2);
@ -126,7 +126,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+1);
std::list<int> l2(a2, a2+1);
l1.splice(next(l1.begin()), l2, l2.begin());
l1.splice(std::next(l1.begin()), l2, l2.begin());
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -148,7 +148,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+2);
l1.splice(l1.begin(), l1, next(l1.begin()));
l1.splice(l1.begin(), l1, std::next(l1.begin()));
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int>::const_iterator i = l1.begin();
@ -158,7 +158,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+2);
l1.splice(next(l1.begin()), l1, l1.begin());
l1.splice(std::next(l1.begin()), l1, l1.begin());
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int>::const_iterator i = l1.begin();
@ -168,7 +168,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+2);
l1.splice(next(l1.begin()), l1, next(l1.begin()));
l1.splice(std::next(l1.begin()), l1, std::next(l1.begin()));
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int>::const_iterator i = l1.begin();
@ -204,7 +204,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1;
std::list<int, min_allocator<int>> l2(a2, a2+2);
l1.splice(l1.end(), l2, next(l2.begin()));
l1.splice(l1.end(), l2, std::next(l2.begin()));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 1);
@ -232,7 +232,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1;
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin()));
l1.splice(l1.end(), l2, std::next(l2.begin()));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 2);
@ -247,7 +247,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1;
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin(), 2));
l1.splice(l1.end(), l2, std::next(l2.begin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.begin(), l1.end()) == 1);
assert(l2.size() == 2);
@ -283,7 +283,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+1);
std::list<int, min_allocator<int>> l2(a2, a2+1);
l1.splice(next(l1.begin()), l2, l2.begin());
l1.splice(std::next(l1.begin()), l2, l2.begin());
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(l2.size() == 0);
@ -305,7 +305,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
l1.splice(l1.begin(), l1, next(l1.begin()));
l1.splice(l1.begin(), l1, std::next(l1.begin()));
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -315,7 +315,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
l1.splice(next(l1.begin()), l1, l1.begin());
l1.splice(std::next(l1.begin()), l1, l1.begin());
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -325,7 +325,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+2);
l1.splice(next(l1.begin()), l1, next(l1.begin()));
l1.splice(std::next(l1.begin()), l1, std::next(l1.begin()));
assert(l1.size() == 2);
assert(std::distance(l1.begin(), l1.end()) == 2);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();

View File

@ -22,7 +22,7 @@ int main(int, char**)
int a2[] = {4, 5, 6};
{
std::list<int> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin()));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin()));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int>::const_iterator i = l1.begin();
@ -34,7 +34,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 2));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin(), 2));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int>::const_iterator i = l1.begin();
@ -46,7 +46,7 @@ int main(int, char**)
}
{
std::list<int> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 3));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin(), 3));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int>::const_iterator i = l1.begin();
@ -59,7 +59,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(l1.begin(), l2, next(l2.begin()), l2.end());
l1.splice(l1.begin(), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int>::const_iterator i = l1.begin();
@ -79,7 +79,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(next(l1.begin()), l2, next(l2.begin()), l2.end());
l1.splice(std::next(l1.begin()), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int>::const_iterator i = l1.begin();
@ -99,7 +99,7 @@ int main(int, char**)
{
std::list<int> l1(a1, a1+3);
std::list<int> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin()), l2.end());
l1.splice(l1.end(), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int>::const_iterator i = l1.begin();
@ -119,7 +119,7 @@ int main(int, char**)
#if TEST_STD_VER >= 11
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin()));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin()));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -131,7 +131,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 2));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin(), 2));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -143,7 +143,7 @@ int main(int, char**)
}
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 3));
l1.splice(l1.begin(), l1, std::next(l1.begin()), std::next(l1.begin(), 3));
assert(l1.size() == 3);
assert(std::distance(l1.begin(), l1.end()) == 3);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -156,7 +156,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(l1.begin(), l2, next(l2.begin()), l2.end());
l1.splice(l1.begin(), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -176,7 +176,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(next(l1.begin()), l2, next(l2.begin()), l2.end());
l1.splice(std::next(l1.begin()), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
@ -196,7 +196,7 @@ int main(int, char**)
{
std::list<int, min_allocator<int>> l1(a1, a1+3);
std::list<int, min_allocator<int>> l2(a2, a2+3);
l1.splice(l1.end(), l2, next(l2.begin()), l2.end());
l1.splice(l1.end(), l2, std::next(l2.begin()), l2.end());
assert(l1.size() == 5);
assert(std::distance(l1.begin(), l1.end()) == 5);
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();

View File

@ -29,7 +29,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == true);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == true);
assert(*std::next(l1.begin()) == true);
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);
@ -50,7 +50,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == true);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == true);
assert(*std::next(l1.begin()) == true);
j = l1.erase(j);
assert(j == l1.end());
assert(l1.size() == 1);

View File

@ -29,7 +29,7 @@ int main(int, char**)
}
{
std::vector<bool> l1(a1, a1+3);
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -37,7 +37,7 @@ int main(int, char**)
}
{
std::vector<bool> l1(a1, a1+3);
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -45,7 +45,7 @@ int main(int, char**)
}
{
std::vector<bool> l1(a1, a1+3);
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::vector<bool>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
@ -60,7 +60,7 @@ int main(int, char**)
}
{
std::vector<bool, min_allocator<bool>> l1(a1, a1+3);
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -68,7 +68,7 @@ int main(int, char**)
}
{
std::vector<bool, min_allocator<bool>> l1(a1, a1+3);
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -76,7 +76,7 @@ int main(int, char**)
}
{
std::vector<bool, min_allocator<bool>> l1(a1, a1+3);
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::vector<bool, min_allocator<bool>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());

View File

@ -61,7 +61,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
assert(*std::next(l1.begin()) == 3);
assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(j);
assert(j == l1.end());
@ -87,7 +87,7 @@ int main(int, char**)
assert(std::distance(l1.begin(), l1.end()) == 2);
assert(*j == 3);
assert(*l1.begin() == 1);
assert(*next(l1.begin()) == 3);
assert(*std::next(l1.begin()) == 3);
assert(is_contiguous_container_asan_correct(l1));
j = l1.erase(j);
assert(j == l1.end());

View File

@ -48,7 +48,7 @@ int main(int, char**)
{
std::vector<int> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -58,7 +58,7 @@ int main(int, char**)
{
std::vector<int> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -68,7 +68,7 @@ int main(int, char**)
{
std::vector<int> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::vector<int>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());
@ -100,7 +100,7 @@ int main(int, char**)
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin()));
assert(l1.size() == 2);
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
assert(i == l1.begin());
@ -110,7 +110,7 @@ int main(int, char**)
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 2));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 2));
assert(l1.size() == 1);
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
assert(i == l1.begin());
@ -120,7 +120,7 @@ int main(int, char**)
{
std::vector<int, min_allocator<int>> l1(a1, a1+3);
assert(is_contiguous_container_asan_correct(l1));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin(), 3));
std::vector<int, min_allocator<int>>::iterator i = l1.erase(l1.cbegin(), std::next(l1.cbegin(), 3));
assert(l1.size() == 0);
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
assert(i == l1.begin());

Some files were not shown because too many files have changed in this diff Show More