Home | History | Annotate | Download | only in unord.multiset
      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 // <unordered_set>
     11 
     12 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
     13 //           class Alloc = allocator<Value>>
     14 // class unordered_multiset
     15 
     16 // void clear()
     17 
     18 #include <unordered_set>
     19 #include <cassert>
     20 
     21 #include "min_allocator.h"
     22 
     23 int main()
     24 {
     25     {
     26         typedef std::unordered_multiset<int> C;
     27         typedef int P;
     28         P a[] =
     29         {
     30             P(1),
     31             P(2),
     32             P(3),
     33             P(4),
     34             P(1),
     35             P(2)
     36         };
     37         C c(a, a + sizeof(a)/sizeof(a[0]));
     38         c.clear();
     39         assert(c.size() == 0);
     40     }
     41 #if __cplusplus >= 201103L
     42     {
     43         typedef std::unordered_multiset<int, std::hash<int>,
     44                                       std::equal_to<int>, min_allocator<int>> C;
     45         typedef int P;
     46         P a[] =
     47         {
     48             P(1),
     49             P(2),
     50             P(3),
     51             P(4),
     52             P(1),
     53             P(2)
     54         };
     55         C c(a, a + sizeof(a)/sizeof(a[0]));
     56         c.clear();
     57         assert(c.size() == 0);
     58     }
     59 #endif
     60 }
     61