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//===----------------------------------------------------------------------===//
8
9// <list>
10
11// explicit list(const Alloc& = Alloc());
12
13#include <list>
14#include <cassert>
15#include "test_macros.h"
16#include "test_allocator.h"
17#include "min_allocator.h"
18
19int main(int, char**) {
20 {
21 std::list<int> l;
22 assert(l.size() == 0);
23 assert(std::distance(l.begin(), l.end()) == 0);
24 }
25 {
26 std::list<int> l((std::allocator<int>()));
27 assert(l.size() == 0);
28 assert(std::distance(l.begin(), l.end()) == 0);
29 }
30 {
31 std::list<int, limited_allocator<int, 4> > l;
32 assert(l.size() == 0);
33 assert(std::distance(l.begin(), l.end()) == 0);
34 }
35#if TEST_STD_VER >= 11
36 {
37 std::list<int, min_allocator<int>> l;
38 assert(l.size() == 0);
39 assert(std::distance(l.begin(), l.end()) == 0);
40 }
41 {
42 std::list<int, min_allocator<int>> l((min_allocator<int>()));
43 assert(l.size() == 0);
44 assert(std::distance(l.begin(), l.end()) == 0);
45 }
46#endif
47
48 return 0;
49}
50

source code of libcxx/test/std/containers/sequences/list/list.cons/default_stack_alloc.pass.cpp