1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // vector(vector&& c);
16 #include "test_allocator.h"
17 #include "min_allocator.h"
21 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
23 std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
24 std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
25 for (int i = 1; i <= 3; ++i)
30 std::vector<bool, test_allocator<bool> > l2 = std::move(l);
33 assert(l2.get_allocator() == lo.get_allocator());
36 std::vector<bool, other_allocator<bool> > l(other_allocator<bool>(5));
37 std::vector<bool, other_allocator<bool> > lo(other_allocator<bool>(5));
38 for (int i = 1; i <= 3; ++i)
43 std::vector<bool, other_allocator<bool> > l2 = std::move(l);
46 assert(l2.get_allocator() == lo.get_allocator());
48 #if TEST_STD_VER >= 11
50 std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
51 std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
52 for (int i = 1; i <= 3; ++i)
57 std::vector<bool, min_allocator<bool> > l2 = std::move(l);
60 assert(l2.get_allocator() == lo.get_allocator());
63 #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES