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 // <map>
10 
11 // class map
12 
13 // bool empty() const;
14 
15 #include <map>
16 #include <cassert>
17 
18 #include "min_allocator.h"
19 
20 int main(int, char**)
21 {
22     {
23     typedef std::map<int, double> M;
24     M m;
25     assert(m.empty());
26     m.insert(M::value_type(1, 1.5));
27     assert(!m.empty());
28     m.clear();
29     assert(m.empty());
30     }
31 #if TEST_STD_VER >= 11
32     {
33     typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
34     M m;
35     assert(m.empty());
36     m.insert(M::value_type(1, 1.5));
37     assert(!m.empty());
38     m.clear();
39     assert(m.empty());
40     }
41 #endif
42 
43   return 0;
44 }
45