diff options
Diffstat (limited to 'libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp')
| -rw-r--r-- | libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp b/libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp index 67a515b2803..5764c61d54e 100644 --- a/libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp +++ b/libcxx/test/containers/sequences/deque/deque.cons/move.pass.cpp @@ -16,6 +16,7 @@ #include "../../../MoveOnly.h" #include "../../../test_allocator.h" +#include "../../../min_allocator.h" int main() { @@ -50,5 +51,22 @@ int main() assert(c1.size() == 0); assert(c3.get_allocator() == c1.get_allocator()); } +#if __cplusplus >= 201103L + { + int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45}; + int* an = ab + sizeof(ab)/sizeof(ab[0]); + typedef min_allocator<MoveOnly> A; + std::deque<MoveOnly, A> c1(A{}); + for (int* p = ab; p < an; ++p) + c1.push_back(MoveOnly(*p)); + std::deque<MoveOnly, A> c2(A{}); + for (int* p = ab; p < an; ++p) + c2.push_back(MoveOnly(*p)); + std::deque<MoveOnly, A> c3 = std::move(c1); + assert(c2 == c3); + assert(c1.size() == 0); + assert(c3.get_allocator() == c1.get_allocator()); + } +#endif #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } |

