forked from OSchip/llvm-project
[libc++] [test] Qualify `distance` as `std::distance` in a lot of tests. NFCI.
We shouldn't be calling `distance` 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 `distance` in particular. Differential Revision: https://reviews.llvm.org/D119685
This commit is contained in:
parent
87b218b42b
commit
f33d7493a5
|
@ -41,7 +41,7 @@ void test_basic() {
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -65,7 +65,7 @@ void test_basic() {
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -78,7 +78,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(-2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -112,7 +112,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -120,7 +120,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
|
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(3));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -78,7 +78,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -86,7 +86,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -112,7 +112,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -120,7 +120,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
|
|
@ -138,7 +138,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -146,7 +146,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -188,7 +188,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -196,7 +196,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -224,7 +224,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -232,7 +232,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -259,7 +259,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -267,7 +267,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -295,14 +295,14 @@ int main(int, char**)
|
|||
m = mo;
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
@ -329,14 +329,14 @@ int main(int, char**)
|
|||
m = mo;
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 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));
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -57,7 +57,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
}, C(3));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -58,7 +58,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
}, C(3));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
}, C(3), A(6));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -62,7 +62,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
}, C(3), A());
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -87,7 +87,7 @@ int main(int, char**)
|
|||
}, a);
|
||||
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -110,7 +110,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
}, C(3), a);
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
};
|
||||
std::map<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -59,7 +59,7 @@ int main(int, char**)
|
|||
};
|
||||
std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -40,7 +40,7 @@ int main(int, char**)
|
|||
std::map<int, double, C> m(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -64,7 +64,7 @@ int main(int, char**)
|
|||
std::map<int, double, C, min_allocator<std::pair<const int, double>>> m(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -44,7 +44,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -70,7 +70,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -97,7 +97,7 @@ int main(int, char**)
|
|||
std::map<int, double, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a );
|
||||
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -110,7 +110,7 @@ int main(int, char**)
|
|||
std::map<int, double, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a );
|
||||
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -33,12 +33,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
V ar[] =
|
||||
|
@ -60,7 +60,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -68,7 +68,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef test_less<int> C;
|
||||
|
@ -78,12 +78,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
V ar[] =
|
||||
|
@ -105,7 +105,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -113,7 +113,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**)
|
|||
{2, 2},
|
||||
});
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -61,7 +61,7 @@ int main(int, char**)
|
|||
{2, 2},
|
||||
});
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -68,7 +68,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
|
|
@ -38,7 +38,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -66,7 +66,7 @@ int main(int, char**)
|
|||
{3, 2}
|
||||
};
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
Cmp(4)
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -73,7 +73,7 @@ int main(int, char**)
|
|||
Cmp(4)
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
|
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
Cmp(4), A(5)
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -77,7 +77,7 @@ int main(int, char**)
|
|||
Cmp(4), A()
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -109,7 +109,7 @@ int main(int, char**)
|
|||
}, a);
|
||||
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
M::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
@ -142,7 +142,7 @@ int main(int, char**)
|
|||
Cmp(4), A{}
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 1.5));
|
||||
|
|
|
@ -37,7 +37,7 @@ int main(int, char**)
|
|||
};
|
||||
std::multimap<int, double> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -65,7 +65,7 @@ int main(int, char**)
|
|||
};
|
||||
std::multimap<int, double, std::less<int>, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -95,7 +95,7 @@ int main(int, char**)
|
|||
A a;
|
||||
std::multimap<int, double, std::less<int>, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
std::multimap<int, double, C> m(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -71,7 +71,7 @@ int main(int, char**)
|
|||
std::multimap<int, double, C, min_allocator<V>> m(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -44,7 +44,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -76,7 +76,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -107,7 +107,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A{});
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
|
|
@ -33,12 +33,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
V ar[] =
|
||||
|
@ -60,7 +60,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -74,7 +74,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef test_less<int> C;
|
||||
|
@ -84,12 +84,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
V ar[] =
|
||||
|
@ -111,7 +111,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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));
|
||||
|
@ -125,7 +125,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -42,7 +42,7 @@ int main(int, char**)
|
|||
}
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 2));
|
||||
|
@ -74,7 +74,7 @@ int main(int, char**)
|
|||
}
|
||||
);
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 9);
|
||||
assert(std::distance(m.begin(), m.end()) == 9);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1, 1));
|
||||
assert(*++i == V(1, 2));
|
||||
|
|
|
@ -29,7 +29,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m.insert({1, 2, 3, 4, 5, 6});
|
||||
assert(m.size() == 8);
|
||||
assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
|
||||
assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m.insert({1, 2, 3, 4, 5, 6});
|
||||
assert(m.size() == 8);
|
||||
assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
|
||||
assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -42,7 +42,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -56,7 +56,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 9);
|
||||
assert(distance(mo.begin(), mo.end()) == 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);
|
||||
|
@ -89,7 +89,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(-2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -103,7 +103,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 9);
|
||||
assert(distance(mo.begin(), mo.end()) == 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);
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(3));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -55,7 +55,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 9);
|
||||
assert(distance(mo.begin(), mo.end()) == 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);
|
||||
|
|
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -57,7 +57,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 9);
|
||||
assert(distance(mo.begin(), mo.end()) == 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);
|
||||
|
@ -110,7 +110,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -124,7 +124,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 9);
|
||||
assert(distance(mo.begin(), mo.end()) == 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);
|
||||
|
|
|
@ -27,7 +27,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -56,7 +56,7 @@ int main(int, char**)
|
|||
min_allocator<int> a;
|
||||
C m ({1, 2, 3, 4, 5, 6}, a);
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m({1, 2, 3, 4, 5, 6}, Cmp(10));
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m({1, 2, 3, 4, 5, 6}, Cmp(10), A(4));
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**)
|
|||
std::multiset<V> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -68,7 +68,7 @@ int main(int, char**)
|
|||
std::multiset<V, std::less<V>, min_allocator<V>> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
|
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
assert(m.value_comp() == C(5));
|
||||
assert(m.get_allocator() == A(7));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -78,7 +78,7 @@ int main(int, char**)
|
|||
std::multiset<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
|
||||
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
|
|
@ -40,7 +40,7 @@ int main(int, char**)
|
|||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
|
|
@ -33,12 +33,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int V;
|
||||
|
@ -61,7 +61,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -75,7 +75,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int V;
|
||||
|
@ -98,7 +98,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 9);
|
||||
assert(distance(m.begin(), m.end()) == 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);
|
||||
|
@ -112,7 +112,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -29,7 +29,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m.insert({1, 2, 3, 4, 5, 6});
|
||||
assert(m.size() == 8);
|
||||
assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
|
||||
assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -46,7 +46,7 @@ int main(int, char**)
|
|||
C m = {10, 8};
|
||||
m.insert({1, 2, 3, 4, 5, 6});
|
||||
assert(m.size() == 8);
|
||||
assert(static_cast<std::size_t>(distance(m.begin(), m.end())) == m.size());
|
||||
assert(static_cast<std::size_t>(std::distance(m.begin(), m.end())) == m.size());
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -28,7 +28,7 @@ void basic_test() {
|
|||
C m = {10, 8};
|
||||
m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -43,7 +43,7 @@ void basic_test() {
|
|||
C m = {10, 8};
|
||||
m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -42,7 +42,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -50,7 +50,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 3);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 3);
|
||||
assert(*mo.begin() == 1);
|
||||
assert(*next(mo.begin()) == 2);
|
||||
assert(*next(mo.begin(), 2) == 3);
|
||||
|
@ -77,7 +77,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(-2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -85,7 +85,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 3);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 3);
|
||||
assert(*mo.begin() == 1);
|
||||
assert(*next(mo.begin()) == 2);
|
||||
assert(*next(mo.begin(), 2) == 3);
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(3));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -49,7 +49,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(7));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 3);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 3);
|
||||
assert(*mo.begin() == 1);
|
||||
assert(*next(mo.begin()) == 2);
|
||||
assert(*next(mo.begin(), 2) == 3);
|
||||
|
|
|
@ -43,7 +43,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 3);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 3);
|
||||
assert(*mo.begin() == 1);
|
||||
assert(*next(mo.begin()) == 2);
|
||||
assert(*next(mo.begin(), 2) == 3);
|
||||
|
@ -93,7 +93,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(2));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -101,7 +101,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(2));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 3);
|
||||
assert(distance(mo.begin(), mo.end()) == 3);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 3);
|
||||
assert(*mo.begin() == 1);
|
||||
assert(*next(mo.begin()) == 2);
|
||||
assert(*next(mo.begin(), 2) == 3);
|
||||
|
|
|
@ -27,7 +27,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -41,7 +41,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m = {1, 2, 3, 4, 5, 6};
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m({1, 2, 3, 4, 5, 6}, Cmp(10));
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -30,7 +30,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m({1, 2, 3, 4, 5, 6}, Cmp(10), A(4));
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
typedef C::value_type V;
|
||||
C m({1, 2, 3, 4, 5, 6}, A(4));
|
||||
assert(m.size() == 6);
|
||||
assert(distance(m.begin(), m.end()) == 6);
|
||||
assert(std::distance(m.begin(), m.end()) == 6);
|
||||
C::const_iterator i = m.cbegin();
|
||||
assert(*i == V(1));
|
||||
assert(*++i == V(2));
|
||||
|
|
|
@ -39,7 +39,7 @@ int main(int, char**)
|
|||
std::set<V> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -62,7 +62,7 @@ int main(int, char**)
|
|||
std::set<V, std::less<int>, min_allocator<int>> m(cpp17_input_iterator<const int*>(ar),
|
||||
cpp17_input_iterator<const int*>(ar+sizeof(ar)/sizeof(ar[0])));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
|
|
@ -50,7 +50,7 @@ int main(int, char**)
|
|||
assert(m.value_comp() == C(5));
|
||||
assert(m.get_allocator() == A(7));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -76,7 +76,7 @@ int main(int, char**)
|
|||
std::set<V, C, A> m(ar, ar+sizeof(ar)/sizeof(ar[0]), a);
|
||||
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
|
|
@ -40,7 +40,7 @@ int main(int, char**)
|
|||
cpp17_input_iterator<const V*>(ar+sizeof(ar)/sizeof(ar[0])), C(5));
|
||||
assert(m.value_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
|
|
@ -33,12 +33,12 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 0);
|
||||
assert(distance(m.begin(), m.end()) == 0);
|
||||
assert(std::distance(m.begin(), m.end()) == 0);
|
||||
|
||||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int V;
|
||||
|
@ -61,7 +61,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A(7));
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -69,7 +69,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A(test_alloc_base::moved_value));
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int V;
|
||||
|
@ -92,7 +92,7 @@ int main(int, char**)
|
|||
assert(m.get_allocator() == A());
|
||||
assert(m.key_comp() == C(5));
|
||||
assert(m.size() == 3);
|
||||
assert(distance(m.begin(), m.end()) == 3);
|
||||
assert(std::distance(m.begin(), m.end()) == 3);
|
||||
assert(*m.begin() == 1);
|
||||
assert(*next(m.begin()) == 2);
|
||||
assert(*next(m.begin(), 2) == 3);
|
||||
|
@ -100,7 +100,7 @@ int main(int, char**)
|
|||
assert(mo.get_allocator() == A());
|
||||
assert(mo.key_comp() == C(5));
|
||||
assert(mo.size() == 0);
|
||||
assert(distance(mo.begin(), mo.end()) == 0);
|
||||
assert(std::distance(mo.begin(), mo.end()) == 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -49,7 +49,7 @@ test(C& c1, int size)
|
|||
typename C::size_type c1_osize = c1.size();
|
||||
c1.resize(size);
|
||||
assert(c1.size() == static_cast<std::size_t>(size));
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
CI i = c1.begin();
|
||||
for (int j = 0; static_cast<std::size_t>(j) < std::min(c1_osize, c1.size()); ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
|
|
@ -49,7 +49,7 @@ test(C& c1, int size, int x)
|
|||
typename C::size_type c1_osize = c1.size();
|
||||
c1.resize(size, x);
|
||||
assert(c1.size() == static_cast<std::size_t>(size));
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
CI i = c1.begin();
|
||||
for (int j = 0; static_cast<std::size_t>(j) < std::min(c1_osize, c1.size()); ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
|
|
@ -49,7 +49,7 @@ void
|
|||
test(C& c1, const C& c2)
|
||||
{
|
||||
c1.assign(c2.begin(), c2.end());
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(c1 == c2);
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ testI(C& c1, const C& c2)
|
|||
typedef typename C::const_iterator CI;
|
||||
typedef cpp17_input_iterator<CI> ICI;
|
||||
c1.assign(ICI(c2.begin()), ICI(c2.end()));
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(c1 == c2);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ test(C& c1, int size, int v)
|
|||
typedef typename C::const_iterator CI;
|
||||
c1.assign(size, v);
|
||||
assert(c1.size() == static_cast<std::size_t>(size));
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
for (CI i = c1.begin(); i != c1.end(); ++i)
|
||||
assert(*i == v);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ test(InputIterator f, InputIterator l)
|
|||
typedef typename C::const_iterator const_iterator;
|
||||
C d(f, l);
|
||||
assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
|
||||
assert(*i == *f);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ test(InputIterator f, InputIterator l)
|
|||
typedef typename C::const_iterator const_iterator;
|
||||
C d(f, l);
|
||||
assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
|
||||
assert(*i == *f);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ test(InputIterator f, InputIterator l, const Allocator& a)
|
|||
C d(f, l, a);
|
||||
assert(d.get_allocator() == a);
|
||||
assert(d.size() == static_cast<std::size_t>(std::distance(f, l)));
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i, ++f)
|
||||
assert(*i == *f);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ test2(unsigned n)
|
|||
C d(n, Allocator());
|
||||
assert(static_cast<unsigned>(DefaultOnly::count) == n);
|
||||
assert(d.size() == n);
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
|
||||
assert(*i == T());
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ test1(unsigned n)
|
|||
C d(n);
|
||||
assert(static_cast<unsigned>(DefaultOnly::count) == n);
|
||||
assert(d.size() == n);
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
#if TEST_STD_VER >= 11
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
|
||||
assert(*i == T());
|
||||
|
|
|
@ -26,7 +26,7 @@ test(unsigned n, const T& x)
|
|||
typedef typename C::const_iterator const_iterator;
|
||||
C d(n, x);
|
||||
assert(d.size() == n);
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
|
||||
assert(*i == x);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ test(unsigned n, const T& x, const Allocator& a)
|
|||
C d(n, x, a);
|
||||
assert(d.get_allocator() == a);
|
||||
assert(d.size() == n);
|
||||
assert(static_cast<std::size_t>(distance(d.begin(), d.end())) == d.size());
|
||||
assert(static_cast<std::size_t>(std::distance(d.begin(), d.end())) == d.size());
|
||||
for (const_iterator i = d.begin(), e = d.end(); i != e; ++i)
|
||||
assert(*i == x);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ int main(int, char**)
|
|||
C c;
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -35,10 +35,10 @@ int main(int, char**)
|
|||
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ int main(int, char**)
|
|||
C c;
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -57,10 +57,10 @@ int main(int, char**)
|
|||
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ test(int P, C& c1)
|
|||
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(*i == Emplaceable(1, 2.5));
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ test(C& c1)
|
|||
c1.emplace_back(Emplaceable(1, 2.5));
|
||||
#endif
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(distance(c1.begin(), c1.end())
|
||||
assert(std::distance(c1.begin(), c1.end())
|
||||
== static_cast<std::ptrdiff_t>(c1.size()));
|
||||
I i = c1.end();
|
||||
assert(*--i == Emplaceable(1, 2.5));
|
||||
|
|
|
@ -57,7 +57,7 @@ test(C& c1)
|
|||
c1.emplace_front(Emplaceable(1, 2.5));
|
||||
#endif
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(distance(c1.begin(), c1.end())
|
||||
assert(std::distance(c1.begin(), c1.end())
|
||||
== static_cast<std::ptrdiff_t>(c1.size()));
|
||||
I i = c1.begin();
|
||||
assert(*i == Emplaceable(1, 2.5));
|
||||
|
|
|
@ -67,7 +67,7 @@ test(int P, C& c1)
|
|||
I i = c1.erase(c1.cbegin() + P);
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize - 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
int j = 0;
|
||||
for (; j < P; ++j, ++i)
|
||||
|
|
|
@ -70,7 +70,7 @@ test(int P, C& c1, int size)
|
|||
I i = c1.erase(c1.cbegin() + P, c1.cbegin() + (P + size));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize - size);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
int j = 0;
|
||||
for (; j < P; ++j, ++i)
|
||||
|
|
|
@ -57,7 +57,7 @@ test(int P, const C& c0, const C& c2)
|
|||
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + c2.size());
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
@ -74,7 +74,7 @@ test(int P, const C& c0, const C& c2)
|
|||
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + c2.size());
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
@ -91,7 +91,7 @@ test(int P, const C& c0, const C& c2)
|
|||
CI i = c1.insert(c1.begin() + P, BCI(c2.begin()), BCI(c2.end()));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + c2.size());
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
@ -172,7 +172,7 @@ testI(int P, C& c1, const C& c2)
|
|||
CI i = c1.insert(c1.begin() + P, ICI(c2.begin()), ICI(c2.end()));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + c2.size());
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
|
|
@ -52,7 +52,7 @@ test(int P, C& c1, int x)
|
|||
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, (void) ++i)
|
||||
assert(*i == MoveOnly(j));
|
||||
|
|
|
@ -50,7 +50,7 @@ test(int P, C& c1, int size, int x)
|
|||
CI i = c1.insert(c1.begin() + P, size, x);
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + size);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
@ -120,7 +120,7 @@ self_reference_test()
|
|||
CI jt = c.cbegin() + j;
|
||||
c.insert(it, 5, *jt);
|
||||
assert(c.size() == 25);
|
||||
assert(static_cast<std::size_t>(distance(c.begin(), c.end())) == c.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
|
||||
it = c.cbegin();
|
||||
for (int k = 0; k < i; ++k, ++it)
|
||||
assert(*it == k);
|
||||
|
|
|
@ -48,7 +48,7 @@ test(int P, C& c1, int x)
|
|||
CI i = c1.insert(c1.begin() + P, x);
|
||||
assert(i == c1.begin() + P);
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
i = c1.begin();
|
||||
for (int j = 0; j < P; ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
@ -102,7 +102,7 @@ self_reference_test()
|
|||
CI jt = c.cbegin() + j;
|
||||
c.insert(it, *jt);
|
||||
assert(c.size() == 21);
|
||||
assert(static_cast<std::size_t>(distance(c.begin(), c.end())) == c.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
|
||||
it = c.cbegin();
|
||||
for (int k = 0; k < i; ++k, ++it)
|
||||
assert(*it == k);
|
||||
|
|
|
@ -47,7 +47,7 @@ test(C& c1)
|
|||
std::size_t c1_osize = c1.size();
|
||||
c1.pop_back();
|
||||
assert(c1.size() == c1_osize - 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
I i = c1.begin();
|
||||
for (int j = 0; static_cast<std::size_t>(j) < c1.size(); ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
|
|
@ -47,7 +47,7 @@ test(C& c1)
|
|||
std::size_t c1_osize = c1.size();
|
||||
c1.pop_front();
|
||||
assert(c1.size() == c1_osize - 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
I i = c1.begin();
|
||||
for (int j = 1; static_cast<std::size_t>(j) < c1.size(); ++j, ++i)
|
||||
assert(*i == j);
|
||||
|
|
|
@ -47,7 +47,7 @@ test(C& c1, int x)
|
|||
std::size_t c1_osize = c1.size();
|
||||
c1.push_front(x);
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
I i = c1.begin();
|
||||
assert(*i == x);
|
||||
++i;
|
||||
|
|
|
@ -51,7 +51,7 @@ test(C& c1, int x)
|
|||
std::size_t c1_osize = c1.size();
|
||||
c1.push_front(MoveOnly(x));
|
||||
assert(c1.size() == c1_osize + 1);
|
||||
assert(static_cast<std::size_t>(distance(c1.begin(), c1.end())) == c1.size());
|
||||
assert(static_cast<std::size_t>(std::distance(c1.begin(), c1.end())) == c1.size());
|
||||
I i = c1.begin();
|
||||
assert(*i == MoveOnly(x));
|
||||
++i;
|
||||
|
|
|
@ -25,7 +25,7 @@ int main(int, char**)
|
|||
C c;
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -35,10 +35,10 @@ int main(int, char**)
|
|||
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -47,7 +47,7 @@ int main(int, char**)
|
|||
C c;
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -57,10 +57,10 @@ int main(int, char**)
|
|||
|
||||
ASSERT_NOEXCEPT(c.clear());
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
|
||||
c.clear();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -30,20 +30,20 @@ int main(int, char**)
|
|||
I i = c.emplace_after(c.cbefore_begin());
|
||||
assert(i == c.begin());
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.emplace_after(c.cbegin(), 1, 2.5);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(*next(c.begin()) == Emplaceable(1, 2.5));
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.emplace_after(next(c.cbegin()), 2, 3.5);
|
||||
assert(i == 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(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.emplace_after(c.cbegin(), 3, 4.5);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
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(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
{
|
||||
typedef Emplaceable T;
|
||||
|
@ -61,20 +61,20 @@ int main(int, char**)
|
|||
I i = c.emplace_after(c.cbefore_begin());
|
||||
assert(i == c.begin());
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.emplace_after(c.cbegin(), 1, 2.5);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(*next(c.begin()) == Emplaceable(1, 2.5));
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.emplace_after(next(c.cbegin()), 2, 3.5);
|
||||
assert(i == 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(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.emplace_after(c.cbegin(), 3, 4.5);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -82,7 +82,7 @@ int main(int, char**)
|
|||
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(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -31,19 +31,19 @@ int main(int, char**)
|
|||
T& r1 = c.emplace_front();
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(&r1 == &c.front());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
T& r2 = c.emplace_front(1, 2.5);
|
||||
assert(c.front() == Emplaceable(1, 2.5));
|
||||
assert(&r2 == &c.front());
|
||||
#else
|
||||
c.emplace_front();
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.emplace_front(1, 2.5);
|
||||
assert(c.front() == Emplaceable(1, 2.5));
|
||||
#endif
|
||||
assert(*next(c.begin()) == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
{
|
||||
typedef Emplaceable T;
|
||||
|
@ -53,19 +53,19 @@ int main(int, char**)
|
|||
T& r1 = c.emplace_front();
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(&r1 == &c.front());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
T& r2 = c.emplace_front(1, 2.5);
|
||||
assert(c.front() == Emplaceable(1, 2.5));
|
||||
assert(&r2 == &c.front());
|
||||
#else
|
||||
c.emplace_front();
|
||||
assert(c.front() == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.emplace_front(1, 2.5);
|
||||
assert(c.front() == Emplaceable(1, 2.5));
|
||||
#endif
|
||||
assert(*next(c.begin()) == Emplaceable());
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int, char**)
|
|||
|
||||
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4), next(c.cbefore_begin(), 4));
|
||||
assert(i == next(c.cbefore_begin(), 4));
|
||||
assert(distance(c.begin(), c.end()) == 10);
|
||||
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);
|
||||
|
@ -40,7 +40,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 5));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 8);
|
||||
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);
|
||||
|
@ -52,7 +52,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 3));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 8);
|
||||
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);
|
||||
|
@ -64,7 +64,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 5), next(c.cbefore_begin(), 9));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
@ -73,7 +73,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 2));
|
||||
assert(i == c.begin());
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
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);
|
||||
|
@ -82,7 +82,7 @@ int main(int, char**)
|
|||
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 5));
|
||||
assert(i == c.begin());
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ int main(int, char**)
|
|||
|
||||
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4), next(c.cbefore_begin(), 4));
|
||||
assert(i == next(c.cbefore_begin(), 4));
|
||||
assert(distance(c.begin(), c.end()) == 10);
|
||||
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);
|
||||
|
@ -107,7 +107,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 5));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 8);
|
||||
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);
|
||||
|
@ -119,7 +119,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 2), next(c.cbefore_begin(), 3));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 8);
|
||||
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);
|
||||
|
@ -131,7 +131,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 5), next(c.cbefore_begin(), 9));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
@ -140,7 +140,7 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 2));
|
||||
assert(i == c.begin());
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
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);
|
||||
|
@ -149,7 +149,7 @@ int main(int, char**)
|
|||
i = c.erase_after(next(c.cbefore_begin(), 0), next(c.cbefore_begin(), 5));
|
||||
assert(i == c.begin());
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ int main(int, char**)
|
|||
|
||||
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
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);
|
||||
|
@ -34,26 +34,26 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0));
|
||||
assert(i == c.begin());
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
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);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 1));
|
||||
assert(i == next(c.begin()));
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
assert(*next(c.begin(), 0) == 1);
|
||||
assert(*next(c.begin(), 1) == 3);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 1));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(*next(c.begin(), 0) == 1);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0));
|
||||
assert(i == c.begin());
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ int main(int, char**)
|
|||
|
||||
C::iterator i = c.erase_after(next(c.cbefore_begin(), 4));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
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);
|
||||
|
@ -72,26 +72,26 @@ int main(int, char**)
|
|||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0));
|
||||
assert(i == c.begin());
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
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);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 1));
|
||||
assert(i == next(c.begin()));
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
assert(*next(c.begin(), 0) == 1);
|
||||
assert(*next(c.begin(), 1) == 3);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 1));
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(*next(c.begin(), 0) == 1);
|
||||
|
||||
i = c.erase_after(next(c.cbefore_begin(), 0));
|
||||
assert(i == c.begin());
|
||||
assert(i == c.end());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,20 +27,20 @@ int main(int, char**)
|
|||
assert(i == c.begin());
|
||||
assert(c.front() == 0);
|
||||
assert(c.front() == 0);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 1);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.insert_after(next(c.cbegin()), 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(*next(c.begin(), 2) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 3);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 1) == 3);
|
||||
assert(*next(c.begin(), 2) == 1);
|
||||
assert(*next(c.begin(), 3) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -60,20 +60,20 @@ int main(int, char**)
|
|||
assert(i == c.begin());
|
||||
assert(c.front() == 0);
|
||||
assert(c.front() == 0);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 1);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.insert_after(next(c.cbegin()), 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(*next(c.begin(), 2) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 3);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -81,7 +81,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 1) == 3);
|
||||
assert(*next(c.begin(), 2) == 1);
|
||||
assert(*next(c.begin(), 3) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,18 +27,18 @@ int main(int, char**)
|
|||
C c;
|
||||
I i = c.insert_after(c.cbefore_begin(), {});
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), {3, 4});
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
@ -52,18 +52,18 @@ int main(int, char**)
|
|||
C c;
|
||||
I i = c.insert_after(c.cbefore_begin(), {});
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), {3, 4});
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
|
|
@ -30,18 +30,18 @@ int main(int, char**)
|
|||
const T t[] = {0, 1, 2, 3, 4};
|
||||
I i = c.insert_after(c.cbefore_begin(), J(t), J(t));
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), J(t+3), J(t+5));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
@ -58,18 +58,18 @@ int main(int, char**)
|
|||
const T t[] = {0, 1, 2, 3, 4};
|
||||
I i = c.insert_after(c.cbefore_begin(), J(t), J(t));
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), J(t+3), J(t+5));
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
|
|
@ -30,20 +30,20 @@ int main(int, char**)
|
|||
assert(i == c.begin());
|
||||
assert(c.front() == 0);
|
||||
assert(c.front() == 0);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 1);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.insert_after(next(c.cbegin()), 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(*next(c.begin(), 2) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 3);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -51,7 +51,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 1) == 3);
|
||||
assert(*next(c.begin(), 2) == 1);
|
||||
assert(*next(c.begin(), 3) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
{
|
||||
typedef MoveOnly T;
|
||||
|
@ -62,20 +62,20 @@ int main(int, char**)
|
|||
assert(i == c.begin());
|
||||
assert(c.front() == 0);
|
||||
assert(c.front() == 0);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 1);
|
||||
assert(i == next(c.begin()));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
|
||||
i = c.insert_after(next(c.cbegin()), 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(c.front() == 0);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(*next(c.begin(), 2) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 3);
|
||||
assert(std::distance(c.begin(), c.end()) == 3);
|
||||
|
||||
i = c.insert_after(c.cbegin(), 3);
|
||||
assert(i == next(c.begin()));
|
||||
|
@ -83,7 +83,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 1) == 3);
|
||||
assert(*next(c.begin(), 2) == 1);
|
||||
assert(*next(c.begin(), 3) == 2);
|
||||
assert(distance(c.begin(), c.end()) == 4);
|
||||
assert(std::distance(c.begin(), c.end()) == 4);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -25,18 +25,18 @@ int main(int, char**)
|
|||
C c;
|
||||
I i = c.insert_after(c.cbefore_begin(), 0, 0);
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), 2, 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
@ -51,18 +51,18 @@ int main(int, char**)
|
|||
C c;
|
||||
I i = c.insert_after(c.cbefore_begin(), 0, 0);
|
||||
assert(i == c.before_begin());
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
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(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
i = c.insert_after(c.begin(), 2, 2);
|
||||
assert(i == next(c.begin(), 2));
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
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);
|
||||
|
|
|
@ -27,10 +27,10 @@ int main(int, char**)
|
|||
c.push_front(1);
|
||||
c.push_front(3);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(c.front() == 1);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -40,10 +40,10 @@ int main(int, char**)
|
|||
c.push_front(1);
|
||||
c.push_front(3);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(c.front() == 1);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -53,10 +53,10 @@ int main(int, char**)
|
|||
c.push_front(1);
|
||||
c.push_front(3);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(c.front() == 1);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef MoveOnly T;
|
||||
|
@ -65,10 +65,10 @@ int main(int, char**)
|
|||
c.push_front(1);
|
||||
c.push_front(3);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
assert(c.front() == 1);
|
||||
c.pop_front();
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ int main(int, char**)
|
|||
C c;
|
||||
c.push_front(1);
|
||||
assert(c.front() == 1);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.push_front(3);
|
||||
assert(c.front() == 3);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -37,11 +37,11 @@ int main(int, char**)
|
|||
C c;
|
||||
c.push_front(1);
|
||||
assert(c.front() == 1);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.push_front(3);
|
||||
assert(c.front() == 3);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@ int main(int, char**)
|
|||
C c;
|
||||
c.push_front(1);
|
||||
assert(c.front() == 1);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.push_front(3);
|
||||
assert(c.front() == 3);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
{
|
||||
typedef MoveOnly T;
|
||||
|
@ -39,11 +39,11 @@ int main(int, char**)
|
|||
C c;
|
||||
c.push_front(1);
|
||||
assert(c.front() == 1);
|
||||
assert(distance(c.begin(), c.end()) == 1);
|
||||
assert(std::distance(c.begin(), c.end()) == 1);
|
||||
c.push_front(3);
|
||||
assert(c.front() == 3);
|
||||
assert(*next(c.begin()) == 1);
|
||||
assert(distance(c.begin(), c.end()) == 2);
|
||||
assert(std::distance(c.begin(), c.end()) == 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -24,15 +24,15 @@ int main(int, char**)
|
|||
typedef std::forward_list<T> C;
|
||||
C c;
|
||||
c.resize(0);
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
c.resize(10);
|
||||
assert(distance(c.begin(), c.end()) == 10);
|
||||
assert(std::distance(c.begin(), c.end()) == 10);
|
||||
c.resize(20);
|
||||
assert(distance(c.begin(), c.end()) == 20);
|
||||
assert(std::distance(c.begin(), c.end()) == 20);
|
||||
c.resize(5);
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
assert(std::distance(c.begin(), c.end()) == 5);
|
||||
c.resize(0);
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -41,13 +41,13 @@ int main(int, char**)
|
|||
C c(std::begin(t), std::end(t));
|
||||
|
||||
c.resize(3);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
c.resize(6);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -56,7 +56,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 5) == 0);
|
||||
|
||||
c.resize(6);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -70,15 +70,15 @@ int main(int, char**)
|
|||
typedef std::forward_list<T, min_allocator<T>> C;
|
||||
C c;
|
||||
c.resize(0);
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
c.resize(10);
|
||||
assert(distance(c.begin(), c.end()) == 10);
|
||||
assert(std::distance(c.begin(), c.end()) == 10);
|
||||
c.resize(20);
|
||||
assert(distance(c.begin(), c.end()) == 20);
|
||||
assert(std::distance(c.begin(), c.end()) == 20);
|
||||
c.resize(5);
|
||||
assert(distance(c.begin(), c.end()) == 5);
|
||||
assert(std::distance(c.begin(), c.end()) == 5);
|
||||
c.resize(0);
|
||||
assert(distance(c.begin(), c.end()) == 0);
|
||||
assert(std::distance(c.begin(), c.end()) == 0);
|
||||
}
|
||||
{
|
||||
typedef int T;
|
||||
|
@ -87,13 +87,13 @@ int main(int, char**)
|
|||
C c(std::begin(t), std::end(t));
|
||||
|
||||
c.resize(3);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
c.resize(6);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -102,7 +102,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 5) == 0);
|
||||
|
||||
c.resize(6);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
|
|
@ -30,13 +30,13 @@ int main(int, char**)
|
|||
C c(std::begin(t), std::end(t));
|
||||
|
||||
c.resize(3, 10);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
c.resize(6, 10);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -45,7 +45,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 5) == 10);
|
||||
|
||||
c.resize(6, 12);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -61,13 +61,13 @@ int main(int, char**)
|
|||
C c(std::begin(t), std::end(t));
|
||||
|
||||
c.resize(3, 10);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
||||
c.resize(6, 10);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
@ -76,7 +76,7 @@ int main(int, char**)
|
|||
assert(*next(c.begin(), 5) == 10);
|
||||
|
||||
c.resize(6, 12);
|
||||
assert(distance(c.begin(), c.end()) == 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);
|
||||
|
|
|
@ -25,7 +25,7 @@ void test(int N)
|
|||
for (int i = 0; i < N; ++i)
|
||||
c.push_front(i);
|
||||
c.reverse();
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
typename C::const_iterator j = c.begin();
|
||||
for (int i = 0; i < N; ++i, ++j)
|
||||
assert(*j == i);
|
||||
|
|
|
@ -33,7 +33,7 @@ void test(int N)
|
|||
std::shuffle(v.begin(), v.end(), randomness);
|
||||
C c(v.begin(), v.end());
|
||||
c.sort();
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
typename C::const_iterator j = c.begin();
|
||||
for (int i = 0; i < N; ++i, ++j)
|
||||
assert(*j == i);
|
||||
|
@ -63,7 +63,7 @@ void test_stable(int N)
|
|||
|
||||
C c(v.begin(), v.end());
|
||||
c.sort();
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
|
||||
// Are we sorted?
|
||||
typename C::const_iterator j = c.begin();
|
||||
|
|
|
@ -48,7 +48,7 @@ void test_stable(int N)
|
|||
|
||||
C c(v.begin(), v.end());
|
||||
c.sort(greater);
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
|
||||
// Are we sorted?
|
||||
typename C::const_iterator j = c.begin();
|
||||
|
@ -75,7 +75,7 @@ void test(int N)
|
|||
std::shuffle(v.begin(), v.end(), randomness);
|
||||
C c(v.begin(), v.end());
|
||||
c.sort(std::greater<T>());
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
typename C::const_iterator j = c.begin();
|
||||
for (int i = 0; i < N; ++i, ++j)
|
||||
assert(*j == N-1-i);
|
||||
|
|
|
@ -36,7 +36,7 @@ testd(const C& c, int p, int l)
|
|||
assert(*i == t2[n2]);
|
||||
for (; n1 < size_t1; ++n1, ++i)
|
||||
assert(*i == t1[n1]);
|
||||
assert(distance(c.begin(), c.end()) == size_t1 + l);
|
||||
assert(std::distance(c.begin(), c.end()) == size_t1 + l);
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
|
|
|
@ -36,7 +36,7 @@ testd(const C& c, int p, int f)
|
|||
assert(*i == t2[n2]);
|
||||
for (; n1 < size_t1; ++n1, ++i)
|
||||
assert(*i == t1[n1]);
|
||||
assert(distance(c.begin(), c.end()) == size_t1 + 1);
|
||||
assert(std::distance(c.begin(), c.end()) == size_t1 + 1);
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
@ -72,7 +72,7 @@ tests(const C& c, int p, int f)
|
|||
for (n = p; n < size_t1; ++n, ++i)
|
||||
assert(*i == t1[n]);
|
||||
}
|
||||
assert(distance(c.begin(), c.end()) == size_t1);
|
||||
assert(std::distance(c.begin(), c.end()) == size_t1);
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
|
|
|
@ -37,7 +37,7 @@ testd(const C& c, ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
|
|||
assert(*i == t2[n2]);
|
||||
for (; n1 < size_t1; ++n1, ++i)
|
||||
assert(*i == t1[n1]);
|
||||
assert(distance(c.begin(), c.end()) == size_t1 + (l > f+1 ? l-1-f : 0));
|
||||
assert(std::distance(c.begin(), c.end()) == size_t1 + (l > f+1 ? l-1-f : 0));
|
||||
}
|
||||
|
||||
template <class C>
|
||||
|
@ -74,7 +74,7 @@ tests(const C& c, ptrdiff_t p, ptrdiff_t f, ptrdiff_t l)
|
|||
for (n = p; n < size_t1; ++n, ++i)
|
||||
assert(*i == t1[n]);
|
||||
}
|
||||
assert(distance(c.begin(), c.end()) == size_t1);
|
||||
assert(std::distance(c.begin(), c.end()) == size_t1);
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
|
|
|
@ -30,13 +30,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(1, 2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -54,10 +54,10 @@ int main(int, char**)
|
|||
C c2(A(1, 2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -75,13 +75,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(1, 2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator().get_id() == 2);
|
||||
}
|
||||
{
|
||||
|
@ -92,10 +92,10 @@ int main(int, char**)
|
|||
C c2(A(1, 2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator().get_id() == 2);
|
||||
}
|
||||
|
||||
|
@ -109,13 +109,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -133,10 +133,10 @@ int main(int, char**)
|
|||
C c2(A(2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -154,13 +154,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A(1));
|
||||
}
|
||||
{
|
||||
|
@ -171,10 +171,10 @@ int main(int, char**)
|
|||
C c2(A(2));
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A(1));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
|
@ -188,13 +188,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A());
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -212,10 +212,10 @@ int main(int, char**)
|
|||
C c2(A{});
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -233,13 +233,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A());
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A());
|
||||
}
|
||||
{
|
||||
|
@ -250,10 +250,10 @@ int main(int, char**)
|
|||
C c2(A{});
|
||||
c1.swap(c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -31,13 +31,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(1, 2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -55,10 +55,10 @@ int main(int, char**)
|
|||
C c2(A(1, 2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -76,13 +76,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(1, 2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator().get_id() == 2);
|
||||
}
|
||||
{
|
||||
|
@ -93,10 +93,10 @@ int main(int, char**)
|
|||
C c2(A(1, 2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator().get_id() == 1);
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator().get_id() == 2);
|
||||
}
|
||||
|
||||
|
@ -110,13 +110,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -134,10 +134,10 @@ int main(int, char**)
|
|||
C c2(A(2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -155,13 +155,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A(2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A(1));
|
||||
}
|
||||
{
|
||||
|
@ -172,10 +172,10 @@ int main(int, char**)
|
|||
C c2(A(2));
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A(2));
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A(1));
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
|
@ -189,13 +189,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A());
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -213,10 +213,10 @@ int main(int, char**)
|
|||
C c2(A{});
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 6);
|
||||
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);
|
||||
|
@ -234,13 +234,13 @@ int main(int, char**)
|
|||
C c2(std::begin(t2), std::end(t2), A());
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 3);
|
||||
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(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A());
|
||||
}
|
||||
{
|
||||
|
@ -251,10 +251,10 @@ int main(int, char**)
|
|||
C c2(A{});
|
||||
swap(c1, c2);
|
||||
|
||||
assert(distance(c1.begin(), c1.end()) == 0);
|
||||
assert(std::distance(c1.begin(), c1.end()) == 0);
|
||||
assert(c1.get_allocator() == A());
|
||||
|
||||
assert(distance(c2.begin(), c2.end()) == 0);
|
||||
assert(std::distance(c2.begin(), c2.end()) == 0);
|
||||
assert(c2.get_allocator() == A());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -25,19 +25,19 @@ int main(int, char**)
|
|||
++i;
|
||||
std::list<int>::iterator j = l1.erase(i);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(*j == 3);
|
||||
assert(*l1.begin() == 1);
|
||||
assert(*next(l1.begin()) == 3);
|
||||
j = l1.erase(j);
|
||||
assert(j == l1.end());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(*l1.begin() == 1);
|
||||
j = l1.erase(l1.begin());
|
||||
assert(j == l1.end());
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.begin(), l1.end()) == 0);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 0);
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
|
@ -47,19 +47,19 @@ int main(int, char**)
|
|||
++i;
|
||||
std::list<int, min_allocator<int>>::iterator j = l1.erase(i);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(*j == 3);
|
||||
assert(*l1.begin() == 1);
|
||||
assert(*next(l1.begin()) == 3);
|
||||
j = l1.erase(j);
|
||||
assert(j == l1.end());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(*l1.begin() == 1);
|
||||
j = l1.erase(l1.begin());
|
||||
assert(j == l1.end());
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.begin(), l1.end()) == 0);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,14 +23,14 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+3);
|
||||
std::list<int>::iterator i = l1.erase(l1.cbegin(), l1.cbegin());
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 3);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 3);
|
||||
assert(i == l1.begin());
|
||||
}
|
||||
{
|
||||
std::list<int> l1(a1, a1+3);
|
||||
std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l1.cbegin()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 2);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
|
||||
assert(i == l1.begin());
|
||||
assert(l1 == std::list<int>(a1+1, a1+3));
|
||||
}
|
||||
|
@ -38,7 +38,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));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 1);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
|
||||
assert(i == l1.begin());
|
||||
assert(l1 == std::list<int>(a1+2, a1+3));
|
||||
}
|
||||
|
@ -46,7 +46,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));
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 0);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
|
||||
assert(i == l1.begin());
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
|
@ -54,14 +54,14 @@ 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(), l1.cbegin());
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 3);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 3);
|
||||
assert(i == l1.begin());
|
||||
}
|
||||
{
|
||||
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()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 2);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 2);
|
||||
assert(i == l1.begin());
|
||||
assert((l1 == std::list<int, min_allocator<int>>(a1+1, a1+3)));
|
||||
}
|
||||
|
@ -69,7 +69,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));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 1);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 1);
|
||||
assert(i == l1.begin());
|
||||
assert((l1 == std::list<int, min_allocator<int>>(a1+2, a1+3)));
|
||||
}
|
||||
|
@ -77,7 +77,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));
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.cbegin(), l1.cend()) == 0);
|
||||
assert(std::distance(l1.cbegin(), l1.cend()) == 0);
|
||||
assert(i == l1.begin());
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,7 @@ void test() {
|
|||
typename List::iterator i = l1.insert(l1.begin(), a1, a1+3);
|
||||
assert(i == l1.begin());
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -38,7 +38,7 @@ void test() {
|
|||
i = l1.insert(i, a2, a2+3);
|
||||
assert(*i == 4);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -65,7 +65,7 @@ void test() {
|
|||
}
|
||||
assert(globalMemCounter.checkOutstandingNewEq(save_count));
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
|
|
@ -27,7 +27,7 @@ void test()
|
|||
typename List::iterator i = l1.insert(next(l1.cbegin()), 4);
|
||||
assert(i == next(l1.begin()));
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l1 == List(a2, a2+4));
|
||||
|
||||
#if !defined(TEST_HAS_NO_EXCEPTIONS) && !defined(DISABLE_NEW_COUNT)
|
||||
|
|
|
@ -44,7 +44,7 @@ void test_stable(int N)
|
|||
|
||||
C c(v.begin(), v.end());
|
||||
c.sort();
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
|
||||
// Are we sorted?
|
||||
typename C::const_iterator j = c.begin();
|
||||
|
|
|
@ -64,7 +64,7 @@ void test_stable(int N)
|
|||
|
||||
C c(v.begin(), v.end());
|
||||
c.sort(greater);
|
||||
assert(distance(c.begin(), c.end()) == N);
|
||||
assert(std::distance(c.begin(), c.end()) == N);
|
||||
|
||||
// Are we sorted?
|
||||
typename C::const_iterator j = c.begin();
|
||||
|
|
|
@ -25,18 +25,18 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.begin(), l1.end()) == 0);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 0);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
}
|
||||
{
|
||||
std::list<int> l1;
|
||||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
}
|
||||
|
@ -45,9 +45,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -58,9 +58,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -73,9 +73,9 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -84,9 +84,9 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -108,9 +108,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -121,9 +121,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -136,9 +136,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -151,9 +151,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -168,9 +168,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -185,9 +185,9 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -198,9 +198,9 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -211,9 +211,9 @@ int main(int, char**)
|
|||
std::list<int> l2;
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -224,9 +224,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -239,9 +239,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -254,9 +254,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -269,9 +269,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -286,9 +286,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -303,9 +303,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -320,9 +320,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -341,9 +341,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -362,9 +362,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -383,9 +383,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin(), 3), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -405,18 +405,18 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 0);
|
||||
assert(distance(l1.begin(), l1.end()) == 0);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 0);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
}
|
||||
{
|
||||
std::list<int, min_allocator<int>> l1;
|
||||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
}
|
||||
|
@ -425,9 +425,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -438,9 +438,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -453,9 +453,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -464,9 +464,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -475,9 +475,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -488,9 +488,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -501,9 +501,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -516,9 +516,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -531,9 +531,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -548,9 +548,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -565,9 +565,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -578,9 +578,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -591,9 +591,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2;
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -604,9 +604,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -619,9 +619,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -634,9 +634,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -649,9 +649,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -666,9 +666,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -683,9 +683,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 4);
|
||||
assert(distance(l1.begin(), l1.end()) == 4);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 4);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -700,9 +700,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -721,9 +721,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin()), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -742,9 +742,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin(), 2), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -763,9 +763,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin(), 3), l2);
|
||||
assert(l1.size() == 6);
|
||||
assert(distance(l1.begin(), l1.end()) == 6);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 6);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
|
|
@ -25,9 +25,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 1);
|
||||
assert(distance(l2.begin(), l2.end()) == 1);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 1);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
i = l2.begin();
|
||||
|
@ -49,9 +49,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 1);
|
||||
assert(distance(l2.begin(), l2.end()) == 1);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 1);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
i = l2.begin();
|
||||
|
@ -62,9 +62,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
i = l2.begin();
|
||||
|
@ -77,9 +77,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
i = l2.begin();
|
||||
|
@ -92,9 +92,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin(), 2));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 6);
|
||||
i = l2.begin();
|
||||
|
@ -106,7 +106,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+1);
|
||||
l1.splice(l1.begin(), l1, l1.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -115,9 +115,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2, l2.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -128,9 +128,9 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin()), l2, l2.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -140,7 +140,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+2);
|
||||
l1.splice(l1.begin(), l1, l1.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -150,7 +150,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+2);
|
||||
l1.splice(l1.begin(), l1, next(l1.begin()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -160,7 +160,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+2);
|
||||
l1.splice(next(l1.begin()), l1, l1.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -170,7 +170,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+2);
|
||||
l1.splice(next(l1.begin()), l1, next(l1.begin()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -182,9 +182,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
}
|
||||
|
@ -193,9 +193,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 1);
|
||||
assert(distance(l2.begin(), l2.end()) == 1);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 1);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
i = l2.begin();
|
||||
|
@ -206,9 +206,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+2);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 1);
|
||||
assert(distance(l2.begin(), l2.end()) == 1);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 1);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
i = l2.begin();
|
||||
|
@ -219,9 +219,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, l2.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
i = l2.begin();
|
||||
|
@ -234,9 +234,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
i = l2.begin();
|
||||
|
@ -249,9 +249,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin(), 2));
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
assert(l2.size() == 2);
|
||||
assert(distance(l2.begin(), l2.end()) == 2);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 6);
|
||||
i = l2.begin();
|
||||
|
@ -263,7 +263,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l1(a1, a1+1);
|
||||
l1.splice(l1.begin(), l1, l1.begin());
|
||||
assert(l1.size() == 1);
|
||||
assert(distance(l1.begin(), l1.end()) == 1);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 1);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
}
|
||||
|
@ -272,9 +272,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(l1.begin(), l2, l2.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 4);
|
||||
++i;
|
||||
|
@ -285,9 +285,9 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+1);
|
||||
l1.splice(next(l1.begin()), l2, l2.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
assert(l2.size() == 0);
|
||||
assert(distance(l2.begin(), l2.end()) == 0);
|
||||
assert(std::distance(l2.begin(), l2.end()) == 0);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -297,7 +297,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l1(a1, a1+2);
|
||||
l1.splice(l1.begin(), l1, l1.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -307,7 +307,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l1(a1, a1+2);
|
||||
l1.splice(l1.begin(), l1, next(l1.begin()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -317,7 +317,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l1(a1, a1+2);
|
||||
l1.splice(next(l1.begin()), l1, l1.begin());
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -327,7 +327,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l1(a1, a1+2);
|
||||
l1.splice(next(l1.begin()), l1, next(l1.begin()));
|
||||
assert(l1.size() == 2);
|
||||
assert(distance(l1.begin(), l1.end()) == 2);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 2);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+3);
|
||||
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin()));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -36,7 +36,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+3);
|
||||
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 2));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -48,7 +48,7 @@ int main(int, char**)
|
|||
std::list<int> l1(a1, a1+3);
|
||||
l1.splice(l1.begin(), l1, next(l1.begin()), next(l1.begin(), 3));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -61,7 +61,7 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
++i;
|
||||
|
@ -81,7 +81,7 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin()), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -101,7 +101,7 @@ int main(int, char**)
|
|||
std::list<int> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -121,7 +121,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()));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -133,7 +133,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));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -145,7 +145,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));
|
||||
assert(l1.size() == 3);
|
||||
assert(distance(l1.begin(), l1.end()) == 3);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 3);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 2);
|
||||
++i;
|
||||
|
@ -158,7 +158,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.begin(), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 5);
|
||||
++i;
|
||||
|
@ -178,7 +178,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(next(l1.begin()), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
@ -198,7 +198,7 @@ int main(int, char**)
|
|||
std::list<int, min_allocator<int>> l2(a2, a2+3);
|
||||
l1.splice(l1.end(), l2, next(l2.begin()), l2.end());
|
||||
assert(l1.size() == 5);
|
||||
assert(distance(l1.begin(), l1.end()) == 5);
|
||||
assert(std::distance(l1.begin(), l1.end()) == 5);
|
||||
std::list<int, min_allocator<int>>::const_iterator i = l1.begin();
|
||||
assert(*i == 1);
|
||||
++i;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue