Home | History | Annotate | Download | only in map.cons
      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 key_compare& comp);
     15 
     16 #include <map>
     17 #include <cassert>
     18 
     19 #include "../../../test_compare.h"
     20 #include "min_allocator.h"
     21 
     22 int main()
     23 {
     24     {
     25     typedef test_compare<std::less<int> > C;
     26     std::map<int, double, C> m(C(3));
     27     assert(m.empty());
     28     assert(m.begin() == m.end());
     29     assert(m.key_comp() == C(3));
     30     }
     31 #if __cplusplus >= 201103L
     32     {
     33     typedef test_compare<std::less<int> > C;
     34     std::map<int, double, C, min_allocator<std::pair<const int, double>>> m(C(3));
     35     assert(m.empty());
     36     assert(m.begin() == m.end());
     37     assert(m.key_comp() == C(3));
     38     }
     39 #endif
     40 }
     41