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// <set>
10
11// class set
12
13// set();
14
15#include <set>
16#include <cassert>
17
18#include "test_macros.h"
19#include "min_allocator.h"
20
21int main(int, char**) {
22 {
23 std::set<int> m;
24 assert(m.empty());
25 assert(m.begin() == m.end());
26 }
27#if TEST_STD_VER >= 11
28 {
29 std::set<int, std::less<int>, min_allocator<int>> m;
30 assert(m.empty());
31 assert(m.begin() == m.end());
32 }
33 {
34 typedef explicit_allocator<int> A;
35 {
36 std::set<int, std::less<int>, A> m;
37 assert(m.empty());
38 assert(m.begin() == m.end());
39 }
40 {
41 A a;
42 std::set<int, std::less<int>, A> m(a);
43 assert(m.empty());
44 assert(m.begin() == m.end());
45 }
46 }
47 {
48 std::set<int> m = {};
49 assert(m.empty());
50 assert(m.begin() == m.end());
51 }
52#endif
53
54 return 0;
55}
56

source code of libcxx/test/std/containers/associative/set/set.cons/default.pass.cpp