8#ifndef INCLUDED_BSLSTL_UNORDEREDMULTIMAP
9#define INCLUDED_BSLSTL_UNORDEREDMULTIMAP
631#include <bslscm_version.h>
666#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
667# include <initializer_list>
670#ifdef BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER
671#include <type_traits>
672 #ifndef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
673 #error Rvalue references curiously absent despite native 'type_traits'.
677#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
681# define COMPILING_BSLSTL_UNORDEREDMULTIMAP_H
683# undef COMPILING_BSLSTL_UNORDEREDMULTIMAP_H
723 typedef ::BloombergLP::bslstl::UnorderedMapKeyConfiguration<
const KEY,
730 typedef ::BloombergLP::bslstl::HashTable<ListConfiguration,
737 typedef ::BloombergLP::bslalg::BidirectionalLink HashTableLink;
741 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
744 template <
class KEY2,
770 typedef ::BloombergLP::bslstl::HashTableIterator<
773 typedef ::BloombergLP::bslstl::HashTableIterator<
776 typedef ::BloombergLP::bslstl::HashTableBucketIterator<
779 typedef ::BloombergLP::bslstl::HashTableBucketIterator<
791 const HASH& hashFunction = HASH(),
792 const EQUAL& keyEqual = EQUAL(),
793 const ALLOCATOR& basicAllocator = ALLOCATOR());
795 const HASH& hashFunction,
796 const ALLOCATOR& basicAllocator);
798 const ALLOCATOR& basicAllocator);
841 BloombergLP::bslmf::MovableRef<unordered_multimap> original);
874 BloombergLP::bslmf::MovableRef<unordered_multimap> original,
907 template <
class INPUT_ITERATOR>
911 const HASH& hashFunction = HASH(),
912 const EQUAL& keyEqual = EQUAL(),
913 const ALLOCATOR& basicAllocator = ALLOCATOR());
914 template <
class INPUT_ITERATOR>
918 const HASH& hashFunction,
919 const ALLOCATOR& basicAllocator);
920 template <
class INPUT_ITERATOR>
924 const ALLOCATOR& basicAllocator);
925 template <
class INPUT_ITERATOR>
928 const ALLOCATOR& basicAllocator);
930#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
931# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
933 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
934 class = bsl::enable_if_t<
935 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
936 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
940 std::initializer_list<value_type> values,
941 size_type initialNumBuckets = 0,
942 const HASH& hashFunction = HASH(),
943 const EQUAL& keyEqual = EQUAL(),
944 const ALLOCATOR& basicAllocator = ALLOCATOR());
945# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
947 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
948 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
952 size_type initialNumBuckets,
953 const HASH& hashFunction,
954 const ALLOCATOR& basicAllocator);
955# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
957 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
961 size_type initialNumBuckets,
962 const ALLOCATOR& basicAllocator);
963# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
988 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
992 const ALLOCATOR& basicAllocator);
1028 operator=(BloombergLP::bslmf::MovableRef<unordered_multimap> rhs)
1030 AllocatorTraits::is_always_equal::value &&
1031 std::is_nothrow_move_assignable<HASH>::value &&
1032 std::is_nothrow_move_assignable<EQUAL>::value);
1034#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1086 template <class LOOKUP_KEY>
1088 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1089 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1090 pair<iterator, iterator> >::type
1095 HashTableLink *first;
1096 HashTableLink *last;
1097 d_impl.findRange(&first, &last, key);
1152 template <
class LOOKUP_KEY>
1154 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1155 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1177#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1178 template <
class ALT_VALUE_TYPE>
1180#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1181 template <
class ALT_VALUE_TYPE>
1192 template <
class ALT_VALUE_TYPE>
1194 ALT_VALUE_TYPE&&>::value,
1220#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1221 template <
class ALT_VALUE_TYPE>
1223#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1224 template <
class ALT_VALUE_TYPE>
1243 template <
class ALT_VALUE_TYPE>
1245 ALT_VALUE_TYPE&&>::value,
1270 template <
class INPUT_ITERATOR>
1271 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
1273#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1279 void insert(std::initializer_list<value_type> values);
1282#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1292 template <
class... Args>
1311 template <
class... Args>
1352 AllocatorTraits::is_always_equal::value &&
1353 bsl::is_nothrow_swappable<HASH>::value &&
1354 bsl::is_nothrow_swappable<EQUAL>::value);
1383 template <class LOOKUP_KEY>
1385 BloombergLP::
bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value &&
1386 BloombergLP::
bslmf::IsTransparentPredicate<EQUAL,
1425 template <class LOOKUP_KEY>
1427 BloombergLP::
bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1428 && BloombergLP::
bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1430 find(const LOOKUP_KEY& key)
const
1446 template <
class LOOKUP_KEY>
1448 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1449 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1454 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
1457 for (HashTableLink *cursor = d_impl.find(key);
1459 ++result, cursor = cursor->nextLink())
1461 BNode *cursorNode =
static_cast<BNode *
>(cursor);
1464 ListConfiguration::extractKey(cursorNode->value()))) {
1486 template <
class LOOKUP_KEY>
1488 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1489 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1495 HashTableLink *first;
1496 HashTableLink *last;
1497 d_impl.findRange(&first, &last, key);
1567#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1577 class INPUT_ITERATOR,
1578 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1580 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1584 class = bsl::enable_if_t<
std::is_invocable_v<HASH, const KEY &>>,
1585 class = bsl::enable_if_t<
1586 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
1587 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1591 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
1594 ALLOCATOR = ALLOCATOR())
1604 class INPUT_ITERATOR,
1608 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1610 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1611 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
1612 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1617 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1631 class INPUT_ITERATOR,
1634 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1636 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1637 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1638 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1642 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1654 class INPUT_ITERATOR,
1657 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1659 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1660 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1661 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1666 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1676 class INPUT_ITERATOR,
1678 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1680 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1681 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1685 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1699 class INPUT_ITERATOR,
1701 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1703 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1704 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1705 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1710 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1721 class INPUT_ITERATOR,
1723 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1725 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1726 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1740 class INPUT_ITERATOR,
1742 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1744 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1745 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1746 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1762 class HASH = bsl::hash<KEY>,
1763 class EQUAL = bsl::equal_to<KEY>,
1764 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1765 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1766 class = bsl::enable_if_t<
1767 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
1768 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1771 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
1774 ALLOCATOR = ALLOCATOR())
1790 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1791 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1794 std::initializer_list<bsl::pair<const KEY, VALUE>>,
1795 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1813 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
1814 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1817 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1833 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1834 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1837 std::initializer_list<bsl::pair<const KEY, VALUE>>,
1838 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1851 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1854 typename bsl::allocator_traits<ALLOCATOR>::size_type,
1871 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1872 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1875 std::initializer_list<bsl::pair<const KEY, VALUE>>,
1876 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
1890 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1909 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1910 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1925template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
1927 const unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& lhs,
1928 const unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& rhs);
1930#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1931template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
1933 const unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& lhs,
1934 const unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& rhs);
1958template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
1959void swap(unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& a,
1960 unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& b)
1972template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
1975: d_impl(HASH(), EQUAL(), 0, 1.0f, ALLOCATOR())
1979template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
1983 const HASH& hashFunction,
1984 const EQUAL& keyEqual,
1985 const ALLOCATOR& basicAllocator)
1986: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
1990template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
1994 const HASH& hashFunction,
1995 const ALLOCATOR& basicAllocator)
1996: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2000template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2004 const ALLOCATOR& basicAllocator)
2005: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2009template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2012 const ALLOCATOR& basicAllocator)
2013: d_impl(basicAllocator)
2017template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2021: d_impl(original.d_impl,
2023 original.get_allocator()))
2027template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2030 BloombergLP::bslmf::MovableRef<unordered_multimap> original)
2031: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl))
2035template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2040: d_impl(original.d_impl, basicAllocator)
2044template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2047 BloombergLP::bslmf::MovableRef<unordered_multimap> original,
2049: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl), basicAllocator)
2053template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2054template <
class INPUT_ITERATOR>
2057 INPUT_ITERATOR first,
2058 INPUT_ITERATOR last,
2060 const HASH& hashFunction,
2061 const EQUAL& keyEqual,
2062 const ALLOCATOR& basicAllocator)
2063: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
2065 this->
insert(first, last);
2068template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2069template <
class INPUT_ITERATOR>
2072 INPUT_ITERATOR first,
2073 INPUT_ITERATOR last,
2075 const HASH& hashFunction,
2076 const ALLOCATOR& basicAllocator)
2077: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2079 this->
insert(first, last);
2082template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2083template <
class INPUT_ITERATOR>
2086 INPUT_ITERATOR first,
2087 INPUT_ITERATOR last,
2089 const ALLOCATOR& basicAllocator)
2090: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
2092 this->
insert(first, last);
2095template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2096template <
class INPUT_ITERATOR>
2099 INPUT_ITERATOR first,
2100 INPUT_ITERATOR last,
2101 const ALLOCATOR& basicAllocator)
2102: d_impl(HASH(), EQUAL(), 0, 1.0f, basicAllocator)
2104 this->
insert(first, last);
2107#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2108template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2109# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2110template <
class,
class,
class>
2114 std::initializer_list<value_type> values,
2115 size_type initialNumBuckets,
2116 const HASH& hashFunction,
2117 const EQUAL& keyEqual,
2118 const ALLOCATOR& basicAllocator)
2128template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2129# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2130template <
class,
class>
2134 std::initializer_list<value_type> values,
2135 size_type initialNumBuckets,
2136 const HASH& hashFunction,
2137 const ALLOCATOR& basicAllocator)
2138: unordered_multimap(values.
begin(),
2147template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2148# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2153 std::initializer_list<value_type> values,
2154 size_type initialNumBuckets,
2155 const ALLOCATOR& basicAllocator)
2156: unordered_multimap(values.
begin(),
2165template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2166# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2171 std::initializer_list<value_type> values,
2172 const ALLOCATOR& basicAllocator)
2173: unordered_multimap(values.
begin(),
2183template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2190template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2198 d_impl = rhs.d_impl;
2203template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2207 BloombergLP::bslmf::MovableRef<unordered_multimap> rhs)
2209 AllocatorTraits::is_always_equal::value &&
2210 std::is_nothrow_move_assignable<HASH>::value &&
2211 std::is_nothrow_move_assignable<EQUAL>::value)
2218 d_impl = MoveUtil::move(lvalue.d_impl);
2223#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2224template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2226unordered_multimap<KEY, VALUE, HASH, EQUAL, ALLOCATOR>&
2228 std::initializer_list<value_type> values)
2230 unordered_multimap tmp(values.begin(), values.end(), d_impl.allocator());
2232 d_impl.swap(tmp.d_impl);
2238#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2239template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2240template <
class... Args>
2250template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2251template <
class... Args>
2258 return iterator(d_impl.emplaceWithHint(hint.node(),
2263template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2269 return iterator(d_impl.elementListRoot());
2272template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2281template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2291template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2302template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2310template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2315 return find(key) !=
end();
2318template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2327template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2334 HashTableLink *first;
2335 HashTableLink *last;
2336 d_impl.findRange(&first, &last, key);
2340template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2348 return iterator(d_impl.remove(position.node()));
2351template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2360template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2369 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
2371 if (HashTableLink *target = d_impl.find(key)) {
2372 target = d_impl.remove(target);
2375 this->key_eq()(key, ListConfiguration::extractKey(
2376 static_cast<BNode *
>(target)->value()))) {
2377 target = d_impl.remove(target);
2386template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2392#if defined BDE_BUILD_TARGET_SAFE_2
2393 if (first != last) {
2395 const iterator
end = this->
end();
2396 for (; it != first; ++it) {
2400 for (; it != last; ++it) {
2406 while (first != last) {
2407 first = this->
erase(first);
2413template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2419 return iterator(d_impl.insert(value));
2422template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2429 return iterator(d_impl.insert(value, hint.node()));
2432template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2433template <
class INPUT_ITERATOR>
2435 INPUT_ITERATOR first,
2436 INPUT_ITERATOR last)
2439 ::BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
2440 if (0 < maxInsertions) {
2441 this->reserve(this->
size() + maxInsertions);
2447 while (first != last) {
2448 d_impl.emplace(*first);
2453#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2454template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2457 std::initializer_list<value_type> values)
2459 insert(values.begin(), values.end());
2463template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2466 float newLoadFactor)
2468 d_impl.setMaxLoadFactor(newLoadFactor);
2471template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2476 d_impl.rehashForNumBuckets(numBuckets);
2479template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2484 d_impl.reserveForNumElements(numElements);
2487template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2492 AllocatorTraits::is_always_equal::value &&
2493 bsl::is_nothrow_swappable<HASH>::value &&
2494 bsl::is_nothrow_swappable<EQUAL>::value)
2496 d_impl.swap(other.d_impl);
2500template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2506 return d_impl.allocator();
2509template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2517template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2526template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2534template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2543template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2546 const_local_iterator
2555template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2567template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2579template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2582 const_local_iterator
2591template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2597 return d_impl.bucketIndexForKey(key);
2600template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2606 return d_impl.numBuckets();
2609template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2617 return d_impl.countElementsInBucket(index);
2620template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2625 typedef ::BloombergLP::bslalg::BidirectionalNode<value_type> BNode;
2628 for (HashTableLink *cursor = d_impl.find(key);
2630 ++result, cursor = cursor->nextLink())
2632 BNode *cursorNode =
static_cast<BNode *
>(cursor);
2633 if (!this->key_eq()(key,
2634 ListConfiguration::extractKey(cursorNode->value()))) {
2642template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2652template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2657 return 0 == d_impl.size();
2660template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2666 return d_impl.size();
2669template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2675 return AllocatorTraits::max_size(get_allocator());
2678template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2683 return d_impl.hasher();
2686template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2691 return d_impl.comparator();
2694template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2699 ALLOCATOR>::const_iterator,
2704 ALLOCATOR>::const_iterator>
2708 HashTableLink *first;
2709 HashTableLink *last;
2710 d_impl.findRange(&first, &last, key);
2715template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2722 return d_impl.maxNumBuckets();
2725template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2731 return d_impl.loadFactor();
2734template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2740 return d_impl.maxLoadFactor();
2746template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2748bool bsl::operator==(
2752 return lhs.d_impl == rhs.d_impl;
2755#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2756template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2762 return !(lhs == rhs);
2767template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2792template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2805template <
class KEY,
class VALUE,
class HASH,
class EQUAL,
class ALLOCATOR>
2818template <
class KEY,
class MAPPED,
class HASH,
class EQUAL,
class ALLOCATOR>
2820 bsl::unordered_multimap<KEY, MAPPED, HASH, EQUAL, ALLOCATOR> >
2821 : ::BloombergLP::bslmf::IsBitwiseMoveable<BloombergLP::bslstl::HashTable<
2822 ::BloombergLP::bslstl::
2823 UnorderedMapKeyConfiguration<KEY, bsl::pair<const KEY, MAPPED> >,
Definition bslma_bslallocator.h:580
Definition bslstl_pair.h:1210
Definition bslstl_unorderedmultimap.h:707
float max_load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2736
friend bool operator==(const unordered_multimap< KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2 > &, const unordered_multimap< KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2 > &)
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_unorderedmultimap.h:1091
unordered_multimap()
Definition bslstl_unorderedmultimap.h:1974
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2654
const value_type & const_reference
Definition bslstl_unorderedmultimap.h:763
EQUAL key_eq() const
Definition bslstl_unorderedmultimap.h:2689
float load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2727
KEY key_type
Definition bslstl_unorderedmultimap.h:755
ALLOCATOR allocator_type
Definition bslstl_unorderedmultimap.h:760
AllocatorTraits::const_pointer const_pointer
Definition bslstl_unorderedmultimap.h:768
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2275
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2672
void reserve(size_type numElements)
Definition bslstl_unorderedmultimap.h:2481
HASH hash_function() const
Definition bslstl_unorderedmultimap.h:2681
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_unorderedmultimap.h:1491
::BloombergLP::bslstl::HashTableIterator< value_type, difference_type > iterator
Definition bslstl_unorderedmultimap.h:771
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_unorderedmultimap.h:1157
unordered_multimap &operator=(BloombergLP::bslmf::MovableRef< unordered_multimap > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2266
size_type bucket(const key_type &key) const
Definition bslstl_unorderedmultimap.h:2594
value_type & reference
Definition bslstl_unorderedmultimap.h:762
HASH hasher
Definition bslstl_unorderedmultimap.h:758
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2528
void swap(unordered_multimap &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:1360
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2537
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, iterator >::type insert(BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
Definition bslstl_unorderedmultimap.h:1197
unordered_multimap & operator=(const unordered_multimap &rhs)
Definition bslstl_unorderedmultimap.h:2192
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_unorderedmultimap.h:1451
::BloombergLP::bslstl::HashTableIterator< const value_type, difference_type > const_iterator
Definition bslstl_unorderedmultimap.h:774
EQUAL key_equal
Definition bslstl_unorderedmultimap.h:759
size_type max_bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2718
size_type bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2603
iterator insert(const value_type &value)
Definition bslstl_unorderedmultimap.h:2416
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this unordered multimap.
Definition bslstl_unorderedmultimap.h:2663
size_type erase(const key_type &key)
Definition bslstl_unorderedmultimap.h:2362
bool contains(const key_type &key) const
Definition bslstl_unorderedmultimap.h:2312
::BloombergLP::bslstl::HashTableBucketIterator< const value_type, difference_type > const_local_iterator
Definition bslstl_unorderedmultimap.h:780
AllocatorTraits::difference_type difference_type
Definition bslstl_unorderedmultimap.h:766
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_unorderedmultimap.h:2254
::BloombergLP::bslstl::HashTableBucketIterator< value_type, difference_type > local_iterator
Definition bslstl_unorderedmultimap.h:777
AllocatorTraits::pointer pointer
Definition bslstl_unorderedmultimap.h:767
bsl::pair< const KEY, VALUE > value_type
Definition bslstl_unorderedmultimap.h:757
AllocatorTraits::size_type size_type
Definition bslstl_unorderedmultimap.h:765
void rehash(size_type numBuckets)
Definition bslstl_unorderedmultimap.h:2473
iterator emplace(Args &&... args)
Definition bslstl_unorderedmultimap.h:2243
size_type bucket_size(size_type index) const
Definition bslstl_unorderedmultimap.h:2612
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmultimap.h:2304
~unordered_multimap()
Destroy this object.
Definition bslstl_unorderedmultimap.h:2184
VALUE mapped_type
Definition bslstl_unorderedmultimap.h:756
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, iterator >::type insert(const_iterator hint, BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
Definition bslstl_unorderedmultimap.h:1248
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#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
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
Definition bslmf_isbitwisemoveable.h:718