llvm-project
56 строк · 1.2 Кб
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{
24std::set<int> m;
25assert(m.empty());
26assert(m.begin() == m.end());
27}
28#if TEST_STD_VER >= 11
29{
30std::set<int, std::less<int>, min_allocator<int>> m;
31assert(m.empty());
32assert(m.begin() == m.end());
33}
34{
35typedef explicit_allocator<int> A;
36{
37std::set<int, std::less<int>, A> m;
38assert(m.empty());
39assert(m.begin() == m.end());
40}
41{
42A a;
43std::set<int, std::less<int>, A> m(a);
44assert(m.empty());
45assert(m.begin() == m.end());
46}
47}
48{
49std::set<int> m = {};
50assert(m.empty());
51assert(m.begin() == m.end());
52}
53#endif
54
55return 0;
56}
57