8#ifndef INCLUDED_BSLSTL_UNORDEREDMULTISET
9#define INCLUDED_BSLSTL_UNORDEREDMULTISET
695#include <bslscm_version.h>
732#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
733# include <initializer_list>
736#ifdef BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER
737#include <type_traits>
740#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
744# define COMPILING_BSLSTL_UNORDEREDMULTISET_H
746# undef COMPILING_BSLSTL_UNORDEREDMULTISET_H
782 typedef KEY ValueType;
787 typedef ::BloombergLP::bslstl::UnorderedSetKeyConfiguration<ValueType>
793 typedef ::BloombergLP::bslstl::HashTable<ListConfiguration,
796 ALLOCATOR> HashTable;
800 typedef ::BloombergLP::bslalg::BidirectionalLink HashTableLink;
804 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
807 template <
class KEY2,
830 typedef ::BloombergLP::bslstl::HashTableIterator<
833 typedef ::BloombergLP::bslstl::HashTableBucketIterator<
843 ::BloombergLP::bslmf::IsBitwiseMoveable,
844 ::BloombergLP::bslmf::IsBitwiseMoveable<HashTable>::value);
855 const HASH& hashFunction = HASH(),
856 const EQUAL& keyEqual = EQUAL(),
857 const ALLOCATOR& basicAllocator = ALLOCATOR());
859 const HASH& hashFunction,
860 const ALLOCATOR& basicAllocator);
862 const ALLOCATOR& basicAllocator);
905 BloombergLP::bslmf::MovableRef<unordered_multiset> original);
936 BloombergLP::bslmf::MovableRef<unordered_multiset> original,
967 template <
class INPUT_ITERATOR>
971 const HASH& hashFunction = HASH(),
972 const EQUAL& keyEqual = EQUAL(),
973 const ALLOCATOR& basicAllocator = ALLOCATOR());
974 template <
class INPUT_ITERATOR>
978 const HASH& hashFunction,
979 const ALLOCATOR& basicAllocator);
980 template <
class INPUT_ITERATOR>
984 const ALLOCATOR& basicAllocator);
985 template <
class INPUT_ITERATOR>
988 const ALLOCATOR& basicAllocator);
990#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
991# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
993 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
994 class = bsl::enable_if_t<
995 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
996 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
1000 std::initializer_list<KEY> values,
1001 size_type initialNumBuckets = 0,
1002 const HASH& hashFunction = HASH(),
1003 const EQUAL& keyEqual = EQUAL(),
1004 const ALLOCATOR& basicAllocator = ALLOCATOR());
1005# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1007 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1008 class = bsl::enable_if_t<bsl::IsStdAllocator<ALLOCATOR>::value>
1012 size_type initialNumBuckets,
1013 const HASH& hashFunction,
1014 const ALLOCATOR& basicAllocator);
1015# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1016 template <class = bsl::enable_if_t<bsl::IsStdAllocator<ALLOCATOR>::value>>
1019 size_type initialNumBuckets,
1020 const ALLOCATOR& basicAllocator);
1021# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1043 template <class = bsl::enable_if_t<bsl::IsStdAllocator<ALLOCATOR>::value>>
1046 const ALLOCATOR& basicAllocator);
1081 operator=(BloombergLP::bslmf::MovableRef<unordered_multiset> rhs)
1083 AllocatorTraits::is_always_equal::value
1084 && std::is_nothrow_move_assignable<HASH>::value
1085 && std::is_nothrow_move_assignable<EQUAL>::value);
1087#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1135 template <class LOOKUP_KEY>
1137 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1138 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1139 pair<iterator, iterator> >::type
1144 HashTableLink *first;
1145 HashTableLink *last;
1146 d_impl.findRange(&first, &last, key);
1198 template <
class LOOKUP_KEY>
1200 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1201 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1233 iterator insert(BloombergLP::bslmf::MovableRef<value_type> value);
1268 BloombergLP::bslmf::MovableRef<value_type> value);
1282 template <
class INPUT_ITERATOR>
1283 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
1285#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1291 void insert(std::initializer_list<KEY> values);
1294#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1304 template <
class... Args>
1324 template <
class... Args>
1366 AllocatorTraits::is_always_equal::value
1367 && bsl::is_nothrow_swappable<HASH>::value
1368 && bsl::is_nothrow_swappable<EQUAL>::value);
1397 template <class LOOKUP_KEY>
1399 BloombergLP::
bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value &&
1400 BloombergLP::
bslmf::IsTransparentPredicate<EQUAL,
1439 template <class LOOKUP_KEY>
1441 BloombergLP::
bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1442 && BloombergLP::
bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1444 find(const LOOKUP_KEY& key)
const
1460 template <
class LOOKUP_KEY>
1462 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1463 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1468 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
1471 for (HashTableLink *cursor = d_impl.find(key);
1473 ++result, cursor = cursor->nextLink()) {
1475 BNode *cursorNode =
static_cast<BNode *
>(cursor);
1478 ListConfiguration::extractKey(cursorNode->value()))) {
1498 template <
class LOOKUP_KEY>
1500 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1501 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1507 HashTableLink *first;
1508 HashTableLink *last;
1509 d_impl.findRange(&first, &last, key);
1581#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1592 class INPUT_ITERATOR,
1593 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1597 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY&>>,
1598 class = bsl::enable_if_t<
1599 std::is_invocable_v<EQUAL, const KEY&, const KEY&>>,
1600 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
1604 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
1607 ALLOCATOR = ALLOCATOR())
1616 class INPUT_ITERATOR,
1617 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1621 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1622 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1627 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1640 class INPUT_ITERATOR,
1641 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1644 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1645 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
1649 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1660 class INPUT_ITERATOR,
1661 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1664 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1665 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1670 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1680 class INPUT_ITERATOR,
1682 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1683 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1687 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1696 class INPUT_ITERATOR,
1697 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1699 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1700 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1705 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1714 class INPUT_ITERATOR,
1716 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1717 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1727 class INPUT_ITERATOR,
1728 class KEY = BloombergLP::bslstl::IteratorUtil::IterVal_t<INPUT_ITERATOR>,
1730 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1731 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1745 class HASH = bsl::hash<KEY>,
1746 class EQUAL = bsl::equal_to<KEY>,
1747 class ALLOCATOR = bsl::allocator<KEY>,
1748 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY&>>,
1749 class = bsl::enable_if_t<
1750 std::is_invocable_v<EQUAL, const KEY&, const KEY&>>,
1751 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
1754 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
1757 ALLOCATOR = ALLOCATOR())
1771 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1772 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1775 std::initializer_list<KEY>,
1776 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1792 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1793 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
1796 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1811 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1812 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1815 std::initializer_list<KEY>,
1816 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1828 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1831 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1842 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1843 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1846 std::initializer_list<KEY>,
1847 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1858 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1870 class DEFAULT_ALLOCATOR = bsl::allocator<KEY>,
1871 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1886template <class KEY, class HASH, class EQUAL, class ALLOCATOR>
1887bool operator==(const unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& lhs,
1888 const unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& rhs);
1890#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1891template <class KEY, class HASH, class EQUAL, class ALLOCATOR>
1892bool operator!=(const unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& lhs,
1893 const unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& rhs);
1908template <class KEY, class HASH, class EQUAL, class ALLOCATOR, class PREDICATE>
1910erase_if(unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& ms,
1911 PREDICATE predicate);
1913template <class KEY, class HASH, class EQUAL, class ALLOCATOR>
1914void swap(unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& a,
1915 unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& b)
1917 BSLS_KEYWORD_NOEXCEPT_OPERATOR(a.swap(b)));
1940template <class KEY, class HASH, class EQUAL, class ALLOCATOR>
1943: d_impl(HASH(), EQUAL(), 0, 1.0f, ALLOCATOR())
1947template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1951 const HASH& hashFunction,
1952 const EQUAL& keyEqual,
1953 const ALLOCATOR& basicAllocator)
1954: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
1958template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1962 const HASH& hashFunction,
1963 const ALLOCATOR& basicAllocator)
1964: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
1968template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1972 const ALLOCATOR& basicAllocator)
1973: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
1977template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1980 const ALLOCATOR& basicAllocator)
1981: d_impl(basicAllocator)
1985template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1989: d_impl(original.d_impl,
1991 original.get_allocator()))
1995template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
1998 BloombergLP::bslmf::MovableRef<unordered_multiset> original)
1999: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl))
2003template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2008: d_impl(original.d_impl, basicAllocator)
2012template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2015 BloombergLP::bslmf::MovableRef<unordered_multiset> original,
2017: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl), basicAllocator)
2021template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2022template <
class INPUT_ITERATOR>
2025 INPUT_ITERATOR first,
2026 INPUT_ITERATOR last,
2028 const HASH& hashFunction,
2029 const EQUAL& keyEqual,
2030 const ALLOCATOR& basicAllocator)
2031: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
2033 this->
insert(first, last);
2036template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2037template <
class INPUT_ITERATOR>
2040 INPUT_ITERATOR first,
2041 INPUT_ITERATOR last,
2043 const HASH& hashFunction,
2044 const ALLOCATOR& basicAllocator)
2045: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2047 this->
insert(first, last);
2050template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2051template <
class INPUT_ITERATOR>
2054 INPUT_ITERATOR first,
2055 INPUT_ITERATOR last,
2057 const ALLOCATOR& basicAllocator)
2058: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2060 this->
insert(first, last);
2063template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2064template <
class INPUT_ITERATOR>
2067 INPUT_ITERATOR first,
2068 INPUT_ITERATOR last,
2069 const ALLOCATOR& basicAllocator)
2070: d_impl(HASH(), EQUAL(), 0, 1.0f, basicAllocator)
2072 this->
insert(first, last);
2075#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2076template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2077#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2078template <
class,
class,
class>
2082 std::initializer_list<KEY> values,
2083 size_type initialNumBuckets,
2084 const hasher& hashFunction,
2085 const key_equal& keyEqual,
2086 const ALLOCATOR& basicAllocator)
2096template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2097#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2098template <
class,
class>
2102 std::initializer_list<KEY> values,
2103 size_type initialNumBuckets,
2104 const HASH& hashFunction,
2105 const ALLOCATOR& basicAllocator)
2106: unordered_multiset(values.
begin(),
2115template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2116#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2121 std::initializer_list<KEY> values,
2122 size_type initialNumBuckets,
2123 const ALLOCATOR& basicAllocator)
2124: unordered_multiset(values.
begin(),
2133template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2134#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2139 std::initializer_list<KEY> values,
2140 const ALLOCATOR& basicAllocator)
2141: unordered_multiset(values.
begin(),
2151template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2159template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2168 d_impl = rhs.d_impl;
2173template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2177 BloombergLP::bslmf::MovableRef<unordered_multiset> rhs)
2179 AllocatorTraits::is_always_equal::value
2180 && std::is_nothrow_move_assignable<HASH>::value
2181 && std::is_nothrow_move_assignable<EQUAL>::value)
2188 d_impl = MoveUtil::move(lvalue.d_impl);
2193#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2194template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2196unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>&
2198 std::initializer_list<KEY> values)
2200 unordered_multiset tmp(values, d_impl.allocator());
2202 d_impl.swap(tmp.d_impl);
2208#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2209template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2210template <
class... Args>
2220template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2221template <
class... Args>
2226 Args&&... arguments)
2228 return iterator(d_impl.emplaceWithHint(hint.node(),
2233template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2238 return iterator(d_impl.elementListRoot());
2241template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2249template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2259template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2269template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2277template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2284template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2291 HashTableLink *first;
2292 HashTableLink *last;
2293 d_impl.findRange(&first, &last, key);
2297template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2304 return iterator(d_impl.remove(position.node()));
2307template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2311 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
2313 HashTableLink *target = d_impl.find(key);
2315 target = d_impl.remove(target);
2318 this->key_eq()(key, ListConfiguration::extractKey(
2319 static_cast<BNode *
>(target)->value()))) {
2320 target = d_impl.remove(target);
2329template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2335#if defined BDE_BUILD_TARGET_SAFE_2
2336 if (first != last) {
2338 const iterator
end = this->
end();
2339 for (; it != first; ++it) {
2343 for (; it != last; ++it) {
2349 while (first != last) {
2350 first = this->
erase(first);
2356template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2362 return iterator(d_impl.insert(value));
2365template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2369 BloombergLP::bslmf::MovableRef<value_type> value)
2371 return iterator(d_impl.insert(MoveUtil::move(value)));
2374template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2381 return iterator(d_impl.insert(value, hint.node()));
2384template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2389 BloombergLP::bslmf::MovableRef<value_type> value)
2391 return iterator(d_impl.insert(MoveUtil::move(value), hint.node()));
2394template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2395template <
class INPUT_ITERATOR>
2398 INPUT_ITERATOR last)
2401 ::BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
2402 if (maxInsertions) {
2403 this->reserve(this->
size() + maxInsertions);
2406 while (first != last) {
2407 d_impl.insert(*first);
2412#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2413template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2416 std::initializer_list<KEY> values)
2418 insert(values.begin(), values.end());
2422template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2425 float newLoadFactor)
2427 d_impl.setMaxLoadFactor(newLoadFactor);
2430template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2435 d_impl.rehashForNumBuckets(numBuckets);
2438template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2443 d_impl.reserveForNumElements(numElements);
2446template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2452 AllocatorTraits::is_always_equal::value
2453 && bsl::is_nothrow_swappable<HASH>::value
2454 && bsl::is_nothrow_swappable<EQUAL>::value)
2456 d_impl.swap(other.d_impl);
2460template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2466 return d_impl.allocator();
2469template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2478template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2487template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2496template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2505template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2515template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2527template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2538template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2548template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2554 return d_impl.bucketIndexForKey(key);
2557template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2563 return d_impl.numBuckets();
2566template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2574 return d_impl.countElementsInBucket(index);
2577template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2582 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
2585 for (HashTableLink *cursor = d_impl.find(key);
2587 ++result, cursor = cursor->nextLink()) {
2589 BNode *cursorNode =
static_cast<BNode *
>(cursor);
2590 if (!this->key_eq()(
2592 ListConfiguration::extractKey(cursorNode->value()))) {
2599template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2608template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2613 return find(key) !=
end();
2617template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2623 return 0 == d_impl.size();
2626template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2632 return d_impl.size();
2635template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2641 return AllocatorTraits::max_size(get_allocator());
2644template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2649 return d_impl.hasher();
2652template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2657 return d_impl.comparator();
2660template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2668 HashTableLink *first;
2669 HashTableLink *last;
2670 d_impl.findRange(&first, &last, key);
2675template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2681 return d_impl.maxNumBuckets();
2685template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2690 return d_impl.loadFactor();
2693template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2698 return d_impl.maxLoadFactor();
2704template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2706bool bsl::operator==(
2710 return lhs.d_impl == rhs.d_impl;
2713#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2714template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2720 return !(lhs == rhs);
2725template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR,
class PREDICATE>
2728bsl::erase_if(unordered_multiset<KEY, HASH, EQUAL, ALLOCATOR>& ms,
2729 PREDICATE predicate)
2731 return BloombergLP::bslstl::AlgorithmUtil::containerEraseIf(ms, predicate);
2734template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2761template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
2770template <
class KEY,
class HASH,
class EQUAL,
class ALLOCATOR>
Definition bslma_bslallocator.h:580
Definition bslstl_pair.h:1210
Definition bslstl_unorderedmultiset.h:770
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2272
void reserve(size_type numElements)
Definition bslstl_unorderedmultiset.h:2441
size_type bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2560
const value_type & const_reference
Definition bslstl_unorderedmultiset.h:823
friend bool operator==(const unordered_multiset< KEY2, HASH2, EQUAL2, ALLOCATOR2 > &, const unordered_multiset< KEY2, HASH2, EQUAL2, ALLOCATOR2 > &)
::BloombergLP::bslstl::HashTableIterator< const value_type, difference_type > iterator
Definition bslstl_unorderedmultiset.h:831
KEY value_type
Definition bslstl_unorderedmultiset.h:818
AllocatorTraits::const_pointer const_pointer
Definition bslstl_unorderedmultiset.h:828
size_type bucket_size(size_type index) const
Definition bslstl_unorderedmultiset.h:2569
size_type bucket(const key_type &key) const
Definition bslstl_unorderedmultiset.h:2551
AllocatorTraits::difference_type difference_type
Definition bslstl_unorderedmultiset.h:826
size_type max_bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2678
iterator const_iterator
Definition bslstl_unorderedmultiset.h:836
local_iterator const_local_iterator
Definition bslstl_unorderedmultiset.h:837
EQUAL key_eq() const
Definition bslstl_unorderedmultiset.h:2655
HASH hash_function() const
Definition bslstl_unorderedmultiset.h:2647
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, iterator >::type find(const LOOKUP_KEY &key)
Definition bslstl_unorderedmultiset.h:1203
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2244
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2638
unordered_multiset &operator=(BloombergLP::bslmf::MovableRef< unordered_multiset > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2236
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2620
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, pair< iterator, iterator > >::type equal_range(const LOOKUP_KEY &key)
Definition bslstl_unorderedmultiset.h:1140
size_type erase(const key_type &key)
Definition bslstl_unorderedmultiset.h:2309
iterator insert(const value_type &value)
Definition bslstl_unorderedmultiset.h:2359
AllocatorTraits::size_type size_type
Definition bslstl_unorderedmultiset.h:825
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_unorderedmultiset.h:2224
AllocatorTraits::pointer pointer
Definition bslstl_unorderedmultiset.h:827
void rehash(size_type numBuckets)
Definition bslstl_unorderedmultiset.h:2433
iterator emplace(Args &&... args)
Definition bslstl_unorderedmultiset.h:2213
unordered_multiset & operator=(const unordered_multiset &rhs)
Definition bslstl_unorderedmultiset.h:2162
bool contains(const key_type &key) const
Definition bslstl_unorderedmultiset.h:2610
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, pair< const_iterator, const_iterator > >::type equal_range(const LOOKUP_KEY &key) const
Definition bslstl_unorderedmultiset.h:1503
float load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2687
value_type & reference
Definition bslstl_unorderedmultiset.h:822
float max_load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2695
HASH hasher
Definition bslstl_unorderedmultiset.h:819
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2499
::BloombergLP::bslstl::HashTableBucketIterator< const value_type, difference_type > local_iterator
Definition bslstl_unorderedmultiset.h:834
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this unordered multiset.
Definition bslstl_unorderedmultiset.h:2629
EQUAL key_equal
Definition bslstl_unorderedmultiset.h:820
~unordered_multiset()
Destroy this object.
Definition bslstl_unorderedmultiset.h:2153
ALLOCATOR allocator_type
Definition bslstl_unorderedmultiset.h:821
BSLMF_NESTED_TRAIT_DECLARATION_IF(unordered_multiset, ::BloombergLP::bslmf::IsBitwiseMoveable, ::BloombergLP::bslmf::IsBitwiseMoveable< HashTable >::value)
void swap(unordered_multiset &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits ALLOCATOR get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:1374
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, size_type >::type count(const LOOKUP_KEY &key) const
Definition bslstl_unorderedmultiset.h:1465
KEY key_type
Definition bslstl_unorderedmultiset.h:817
unordered_multiset()
Definition bslstl_unorderedmultiset.h:1942
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultiset.h:2490
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_NOEXCEPT_OPERATOR(...)
Definition bsls_keyword.h:635
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
Definition bdlb_printmethods.h:283
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4126
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
BSLS_KEYWORD_CONSTEXPR size_t size(const TYPE(&)[DIMENSION]) BSLS_KEYWORD_NOEXCEPT
Return the dimension of the specified array argument.
Definition bslstl_iterator.h:1331
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
deque< VALUE_TYPE, ALLOCATOR >::size_type erase_if(deque< VALUE_TYPE, ALLOCATOR > &deq, PREDICATE predicate)
Definition bslstl_deque.h:4135
bool operator!=(const memory_resource &a, const memory_resource &b)
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bdldfp_decimal.h:5188
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR >::type const_pointer
Definition bslma_allocatortraits.h:1152
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR >::type size_type
Definition bslma_allocatortraits.h:1165
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR >::type pointer
Definition bslma_allocatortraits.h:1149
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR >::type difference_type
Definition bslma_allocatortraits.h:1162
Definition bslmf_enableif.h:525
Definition bslstl_equalto.h:311
Definition bslstl_hash.h:498
Definition bslmf_isconvertible.h:867
t_TYPE type
Definition bslmf_typeidentity.h:216
Definition bslalg_hasstliterators.h:99
Definition bslma_usesbslmaallocator.h:343