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_size(size_type n) 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 assert(c.bucket_count() >= 7);
44 LIBCPP_ASSERT(c.bucket_size(0) == 0);
45 LIBCPP_ASSERT(c.bucket_size(1) == 2);
46 LIBCPP_ASSERT(c.bucket_size(2) == 2);
47 LIBCPP_ASSERT(c.bucket_size(3) == 1);
48 LIBCPP_ASSERT(c.bucket_size(4) == 1);
49 LIBCPP_ASSERT(c.bucket_size(5) == 0);
50 LIBCPP_ASSERT(c.bucket_size(6) == 0);
52 #if TEST_STD_VER >= 11
54 typedef std::unordered_multiset<int, std::hash<int>,
55 std::equal_to<int>, min_allocator<int>> C;
66 const C c(std::begin(a), std::end(a));
67 assert(c.bucket_count() >= 7);
68 LIBCPP_ASSERT(c.bucket_size(0) == 0);
69 LIBCPP_ASSERT(c.bucket_size(1) == 2);
70 LIBCPP_ASSERT(c.bucket_size(2) == 2);
71 LIBCPP_ASSERT(c.bucket_size(3) == 1);
72 LIBCPP_ASSERT(c.bucket_size(4) == 1);
73 LIBCPP_ASSERT(c.bucket_size(5) == 0);
74 LIBCPP_ASSERT(c.bucket_size(6) == 0);
77 #if _LIBCPP_DEBUG_LEVEL >= 1
79 typedef std::unordered_multiset<int> C;
81 C::size_type i = c.bucket_size(3);