1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
13 // class Alloc = allocator<Value>>
14 // class unordered_multiset
16 // iterator erase(const_iterator p)
18 #include <unordered_set>
21 #include "min_allocator.h"
23 struct TemplateConstructor
26 TemplateConstructor (const T&) {}
29 bool operator==(const TemplateConstructor&, const TemplateConstructor&) { return false; }
30 struct Hash { size_t operator() (const TemplateConstructor &) const { return 0; } };
35 typedef std::unordered_multiset<int> C;
46 C c(a, a + sizeof(a)/sizeof(a[0]));
47 C::const_iterator i = c.find(2);
48 C::const_iterator i_next = i;
50 C::iterator j = c.erase(i);
53 assert(c.size() == 5);
54 assert(c.count(1) == 2);
55 assert(c.count(2) == 1);
56 assert(c.count(3) == 1);
57 assert(c.count(4) == 1);
59 #if TEST_STD_VER >= 11
61 typedef std::unordered_multiset<int, std::hash<int>,
62 std::equal_to<int>, min_allocator<int>> C;
73 C c(a, a + sizeof(a)/sizeof(a[0]));
74 C::const_iterator i = c.find(2);
75 C::const_iterator i_next = i;
77 C::iterator j = c.erase(i);
79 assert(c.size() == 5);
80 assert(c.count(1) == 2);
81 assert(c.count(2) == 1);
82 assert(c.count(3) == 1);
83 assert(c.count(4) == 1);
86 #if TEST_STD_VER >= 14
89 typedef TemplateConstructor T;
90 typedef std::unordered_set<T, Hash> C;
91 typedef C::iterator I;