[DirectX] Set the EnableRawAndStructuredBuffers shader flag (#122667)
[llvm-project.git] / libcxx / test / std / containers / sequences / list / list.cons / copy.pass.cpp
blob153cd2dbc96b605d33c83117ee397995ec519ec1
1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
9 // <list>
11 // list(const list& c);
13 #include <list>
14 #include <cassert>
16 #include "test_macros.h"
17 #include "DefaultOnly.h"
18 #include "test_allocator.h"
19 #include "min_allocator.h"
21 int main(int, char**)
24 std::list<int> l(3, 2);
25 std::list<int> l2 = l;
26 assert(l2 == l);
29 std::list<int, test_allocator<int> > l(3, 2, test_allocator<int>(5));
30 std::list<int, test_allocator<int> > l2 = l;
31 assert(l2 == l);
32 assert(l2.get_allocator() == l.get_allocator());
34 #if TEST_STD_VER >= 11
36 std::list<int, other_allocator<int> > l(3, 2, other_allocator<int>(5));
37 std::list<int, other_allocator<int> > l2 = l;
38 assert(l2 == l);
39 assert(l2.get_allocator() == other_allocator<int>(-2));
42 std::list<int, min_allocator<int>> l(3, 2);
43 std::list<int, min_allocator<int>> l2 = l;
44 assert(l2 == l);
47 std::list<int, min_allocator<int> > l(3, 2, min_allocator<int>());
48 std::list<int, min_allocator<int> > l2 = l;
49 assert(l2 == l);
50 assert(l2.get_allocator() == l.get_allocator());
52 #endif
54 return 0;