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
// list& operator=(list&& c);
16
#include "../../../MoveOnly.h"
17
#include "../../../test_allocator.h"
21
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
23
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
24
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
25
for (int i = 1; i <= 3; ++i)
30
std::list<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(5));
34
assert(l2.get_allocator() == lo.get_allocator());
37
std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
38
std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
39
for (int i = 1; i <= 3; ++i)
44
std::list<MoveOnly, test_allocator<MoveOnly> > l2(test_allocator<MoveOnly>(6));
48
assert(l2.get_allocator() == test_allocator<MoveOnly>(6));
51
std::list<MoveOnly, other_allocator<MoveOnly> > l(other_allocator<MoveOnly>(5));
52
std::list<MoveOnly, other_allocator<MoveOnly> > lo(other_allocator<MoveOnly>(5));
53
for (int i = 1; i <= 3; ++i)
58
std::list<MoveOnly, other_allocator<MoveOnly> > l2(other_allocator<MoveOnly>(6));
62
assert(l2.get_allocator() == lo.get_allocator());
64
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES