File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
libcxx/test/std/containers/sequences/vector.bool Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 24
24
template <unsigned N, class A >
25
25
TEST_CONSTEXPR_CXX20 void test (const A& a) {
26
26
std::vector<bool , A> v (N, false , a);
27
- std::vector<bool , A> v0 (N, false , a);
27
+ std::vector<bool , A> original (N, false , a);
28
28
for (unsigned i = 1 ; i < N; i += 2 ) {
29
- v[i] = true ;
30
- v0 [i] = true ;
29
+ v[i] = true ;
30
+ original [i] = true ;
31
31
}
32
32
std::vector<bool , A> v2 = std::move (v);
33
- assert (v2 == v0 );
34
- assert (v.empty ()); // The moved-from vector is guarantted to be empty after move-construction
35
- assert (v2.get_allocator () == v0 .get_allocator ());
33
+ assert (v2 == original );
34
+ assert (v.empty ()); // The moved-from vector is guaranteed to be empty after move-construction
35
+ assert (v2.get_allocator () == original .get_allocator ());
36
36
}
37
37
38
38
TEST_CONSTEXPR_CXX20 bool tests () {
Original file line number Diff line number Diff line change 24
24
template <unsigned N, class A >
25
25
TEST_CONSTEXPR_CXX20 void test (const A& a, const A& a0) {
26
26
std::vector<bool , A> v (N, false , a);
27
- std::vector<bool , A> v0 (N, false , a0);
27
+ std::vector<bool , A> original (N, false , a0);
28
28
for (unsigned i = 1 ; i < N; i += 2 ) {
29
- v[i] = true ;
30
- v0 [i] = true ;
29
+ v[i] = true ;
30
+ original [i] = true ;
31
31
}
32
32
std::vector<bool , A> v2 (std::move (v), a0);
33
- assert (v2 == v0 );
33
+ assert (v2 == original );
34
34
assert (v2.get_allocator () == a0);
35
35
if (a == a0)
36
- assert (v.empty ()); // After container-move, the vector is guarantted to be empty
36
+ assert (v.empty ()); // After container-move, the vector is guaranteed to be empty
37
37
else
38
38
LIBCPP_ASSERT (!v.empty ()); // After element-wise move, the RHS vector is not necessarily empty
39
39
}
You can’t perform that action at this time.
0 commit comments