1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <map>
11 
12 // class map
13 
14 // explicit map(const allocator_type& a);
15 
16 #include <map>
17 #include <cassert>
18 
19 #include "test_allocator.h"
20 #include "min_allocator.h"
21 
main()22 int main()
23 {
24     {
25     typedef std::less<int> C;
26     typedef test_allocator<std::pair<const int, double> > A;
27     std::map<int, double, C, A> m(A(5));
28     assert(m.empty());
29     assert(m.begin() == m.end());
30     assert(m.get_allocator() == A(5));
31     }
32 #if __cplusplus >= 201103L
33     {
34     typedef std::less<int> C;
35     typedef min_allocator<std::pair<const int, double> > A;
36     std::map<int, double, C, A> m(A{});
37     assert(m.empty());
38     assert(m.begin() == m.end());
39     assert(m.get_allocator() == A());
40     }
41 #endif
42 }
43