1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // deque& operator=(const deque& c);
15 #include "test_macros.h"
16 #include "test_allocator.h"
17 #include "min_allocator.h"
31 int ab
[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
32 int* an
= ab
+ sizeof(ab
)/sizeof(ab
[0]);
33 test(std::deque
<int>(ab
, an
));
36 std::deque
<int, test_allocator
<int> > l(3, 2, test_allocator
<int>(5));
37 std::deque
<int, test_allocator
<int> > l2(l
, test_allocator
<int>(3));
40 assert(l2
.get_allocator() == test_allocator
<int>(3));
43 std::deque
<int, other_allocator
<int> > l(3, 2, other_allocator
<int>(5));
44 std::deque
<int, other_allocator
<int> > l2(l
, other_allocator
<int>(3));
47 assert(l2
.get_allocator() == other_allocator
<int>(5));
49 #if TEST_STD_VER >= 11
51 int ab
[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
52 int* an
= ab
+ sizeof(ab
)/sizeof(ab
[0]);
53 test(std::deque
<int, min_allocator
<int>>(ab
, an
));
56 std::deque
<int, min_allocator
<int> > l(3, 2, min_allocator
<int>());
57 std::deque
<int, min_allocator
<int> > l2(l
, min_allocator
<int>());
60 assert(l2
.get_allocator() == min_allocator
<int>());