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 // list(const list& c, const allocator_type& a);
15 #include "test_macros.h"
16 #include "DefaultOnly.h"
17 #include "test_allocator.h"
18 #include "min_allocator.h"
23 std::list
<int, test_allocator
<int> > l(3, 2, test_allocator
<int>(5));
24 std::list
<int, test_allocator
<int> > l2(l
, test_allocator
<int>(3));
26 assert(l2
.get_allocator() == test_allocator
<int>(3));
29 std::list
<int, other_allocator
<int> > l(3, 2, other_allocator
<int>(5));
30 std::list
<int, other_allocator
<int> > l2(l
, other_allocator
<int>(3));
32 assert(l2
.get_allocator() == other_allocator
<int>(3));
34 #if TEST_STD_VER >= 11
36 std::list
<int, min_allocator
<int> > l(3, 2, min_allocator
<int>());
37 std::list
<int, min_allocator
<int> > l2(l
, min_allocator
<int>());
39 assert(l2
.get_allocator() == min_allocator
<int>());