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 // size_type bucket(const key_type& __k) const;
19 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
22 #include <unordered_set>
25 #include "test_macros.h"
26 #include "min_allocator.h"
31 typedef std::unordered_multiset<int> C;
42 const C c(std::begin(a), std::end(a));
43 size_t bc = c.bucket_count();
45 for (size_t i = 0; i < 13; ++i)
46 LIBCPP_ASSERT(c.bucket(i) == i % bc);
48 #if TEST_STD_VER >= 11
50 typedef std::unordered_multiset<int, std::hash<int>,
51 std::equal_to<int>, min_allocator<int>> C;
62 const C c(std::begin(a), std::end(a));
63 size_t bc = c.bucket_count();
65 for (size_t i = 0; i < 13; ++i)
66 LIBCPP_ASSERT(c.bucket(i) == i % bc);
69 #if _LIBCPP_DEBUG_LEVEL >= 1
71 typedef std::unordered_multiset<int> C;
73 C::size_type i = c.bucket(3);