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
18 // const_iterator begin() const;
19 // const_iterator end() const;
20 // const_iterator cbegin() const;
21 // const_iterator cend() const;
23 #include <unordered_set>
26 #include "min_allocator.h"
31 typedef std::unordered_multiset<int> C;
42 C c(a, a + sizeof(a)/sizeof(a[0]));
43 assert(c.bucket_count() >= 7);
44 assert(c.size() == 6);
45 assert(std::distance(c.begin(), c.end()) == c.size());
46 assert(std::distance(c.cbegin(), c.cend()) == c.size());
50 typedef std::unordered_multiset<int> C;
61 const C c(a, a + sizeof(a)/sizeof(a[0]));
62 assert(c.bucket_count() >= 7);
63 assert(c.size() == 6);
64 assert(std::distance(c.begin(), c.end()) == c.size());
65 assert(std::distance(c.cbegin(), c.cend()) == c.size());
68 #if __cplusplus >= 201103L
70 typedef std::unordered_multiset<int, std::hash<int>,
71 std::equal_to<int>, min_allocator<int>> C;
82 C c(a, a + sizeof(a)/sizeof(a[0]));
83 assert(c.bucket_count() >= 7);
84 assert(c.size() == 6);
85 assert(std::distance(c.begin(), c.end()) == c.size());
86 assert(std::distance(c.cbegin(), c.cend()) == c.size());
90 typedef std::unordered_multiset<int, std::hash<int>,
91 std::equal_to<int>, min_allocator<int>> C;
102 const C c(a, a + sizeof(a)/sizeof(a[0]));
103 assert(c.bucket_count() >= 7);
104 assert(c.size() == 6);
105 assert(std::distance(c.begin(), c.end()) == c.size());
106 assert(std::distance(c.cbegin(), c.cend()) == c.size());
110 #if _LIBCPP_STD_VER > 11
112 typedef std::unordered_multiset<int> C;
113 C::iterator ii1{}, ii2{};
114 C::iterator ii4 = ii1;
115 C::const_iterator cii{};
116 assert ( ii1 == ii2 );
117 assert ( ii1 == ii4 );
119 assert (!(ii1 != ii2 ));
121 assert ( (ii1 == cii ));
122 assert ( (cii == ii1 ));
123 assert (!(ii1 != cii ));
124 assert (!(cii != ii1 ));