11#ifndef INCLUDED_BSLSTL_HASHTABLE_CPP03
12#define INCLUDED_BSLSTL_HASHTABLE_CPP03
63#ifdef COMPILING_BSLSTL_HASHTABLE_H
69template <
class KEY_CONFIG,
75template <
class FACTORY>
76class HashTable_ArrayProctor;
78template <
class FACTORY>
79class HashTable_NodeProctor;
81template <
class FUNCTOR>
82class HashTable_ComparatorWrapper;
84template <
class FUNCTOR>
85class HashTable_ComparatorWrapper<const FUNCTOR>;
87template <
class FUNCTOR>
88class HashTable_ComparatorWrapper<FUNCTOR &>;
90template <
class FUNCTOR>
91class HashTable_HashWrapper;
93template <
class FUNCTOR>
94class HashTable_HashWrapper<const FUNCTOR>;
96template <
class FUNCTOR>
97class HashTable_HashWrapper<FUNCTOR &>;
99struct HashTable_ImpDetails;
100struct HashTable_Util;
113template <
class CALLABLE>
114struct CallableVariable {
139template <
class FUNCTOR>
140class HashTable_HashWrapper {
143 mutable FUNCTOR d_functor;
166 template <
class ARG_TYPE>
171 const FUNCTOR&
functor()
const;
182template <
class FUNCTOR>
183class HashTable_HashWrapper<const FUNCTOR> {
186 const FUNCTOR d_functor;
204 template <
class ARG_TYPE>
209 const FUNCTOR&
functor()
const;
220template <
class FUNCTOR>
221class HashTable_HashWrapper<FUNCTOR &> {
231 explicit HashTable_HashWrapper(FUNCTOR& fn);
238 template <
class ARG_TYPE>
239 std::size_t operator()(ARG_TYPE& arg)
const;
243 FUNCTOR& functor()
const;
248template <
class FUNCTOR>
249void swap(HashTable_HashWrapper<FUNCTOR> &a,
250 HashTable_HashWrapper<FUNCTOR> &b);
264template <
class FUNCTOR>
265class HashTable_ComparatorWrapper {
268 mutable FUNCTOR d_functor;
291 template <
class ARG1_TYPE,
class ARG2_TYPE>
292 bool operator()(ARG1_TYPE& arg1, ARG2_TYPE& arg2)
const;
296 const FUNCTOR&
functor()
const;
307template <
class FUNCTOR>
308class HashTable_ComparatorWrapper<const FUNCTOR> {
311 const FUNCTOR d_functor;
329 template <
class ARG1_TYPE,
class ARG2_TYPE>
330 bool operator()(ARG1_TYPE& arg1, ARG2_TYPE& arg2)
const;
334 const FUNCTOR&
functor()
const;
345template <
class FUNCTOR>
346class HashTable_ComparatorWrapper<FUNCTOR &> {
356 explicit HashTable_ComparatorWrapper(FUNCTOR& fn);
363 template <
class ARG1_TYPE,
class ARG2_TYPE>
364 bool operator()(ARG1_TYPE& arg1, ARG2_TYPE& arg2)
const;
368 FUNCTOR& functor()
const;
373template <
class FUNCTOR>
374void swap(HashTable_ComparatorWrapper<FUNCTOR> &lhs,
375 HashTable_ComparatorWrapper<FUNCTOR> &rhs);
381template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
382class HashTable_ImplParameters;
429template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
436 typedef typename KEY_CONFIG::KeyType
KeyType;
437 typedef typename KEY_CONFIG::ValueType
ValueType;
445 HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>
458 typedef typename AllocatorTraits::template rebind_traits<NodeType>
462 ReboundTraits::propagate_on_container_copy_assignment::value ==
463 AllocatorTraits::propagate_on_container_copy_assignment::value);
466 ReboundTraits::propagate_on_container_move_assignment::value ==
467 AllocatorTraits::propagate_on_container_move_assignment::value);
469 BSLMF_ASSERT(ReboundTraits::propagate_on_container_swap::value ==
470 AllocatorTraits::propagate_on_container_swap::value);
474 ImplParameters d_parameters;
481 float d_maxLoadFactor;
517 void quickSwapExchangeAllocators(HashTable *other);
523 void quickSwapRetainAllocators(HashTable *other);
537 void rehashIntoExactlyNumBuckets(
SizeType newNumBuckets,
546 void removeAllAndDeallocate();
567 template <
class DEDUCED_KEY>
569 std::size_t hashValue)
const;
598 explicit HashTable(
const ALLOCATOR& basicAllocator = ALLOCATOR());
619 const COMPARATOR& compare,
621 float initialMaxLoadFactor,
622 const ALLOCATOR& basicAllocator = ALLOCATOR());
648 HashTable(BloombergLP::bslmf::MovableRef<HashTable> original);
660 HashTable(
const HashTable& original,
const ALLOCATOR& basicAllocator);
678 HashTable(BloombergLP::bslmf::MovableRef<HashTable> original,
679 const ALLOCATOR& basicAllocator);
718#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
721#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT
722#define BSLSTL_HASHTABLE_VARIADIC_LIMIT 10
724#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT_A
725#define BSLSTL_HASHTABLE_VARIADIC_LIMIT_A BSLSTL_HASHTABLE_VARIADIC_LIMIT
727#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 0
732#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 1
733 template <
class Args_01>
738#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 2
739 template <
class Args_01,
746#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 3
747 template <
class Args_01,
756#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 4
757 template <
class Args_01,
768#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 5
769 template <
class Args_01,
782#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 6
783 template <
class Args_01,
798#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 7
799 template <
class Args_01,
816#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 8
817 template <
class Args_01,
836#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 9
837 template <
class Args_01,
858#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 10
859 template <
class Args_01,
883#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 0
888#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 1
889 template <
class Args_01>
895#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 2
896 template <
class Args_01,
904#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 3
905 template <
class Args_01,
915#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 4
916 template <
class Args_01,
928#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 5
929 template <
class Args_01,
943#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 6
944 template <
class Args_01,
960#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 7
961 template <
class Args_01,
979#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 8
980 template <
class Args_01,
1000#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 9
1001 template <
class Args_01,
1023#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 10
1024 template <
class Args_01,
1049#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 0
1053#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 1
1054 template <
class Args_01>
1059#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 2
1060 template <
class Args_01,
1067#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 3
1068 template <
class Args_01,
1077#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 4
1078 template <
class Args_01,
1089#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 5
1090 template <
class Args_01,
1103#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 6
1104 template <
class Args_01,
1119#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 7
1120 template <
class Args_01,
1137#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 8
1138 template <
class Args_01,
1157#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 9
1158 template <
class Args_01,
1179#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_A >= 10
1180 template <
class Args_01,
1206 template <
class... Args>
1210 template <
class... Args>
1215 template <
class... Args>
1257 bool *isInsertedFlag,
1276 bool *isInsertedFlag,
1297 template <
class SOURCE_TYPE>
1300 bool *isInsertedFlag,
1319 template <
class SOURCE_TYPE>
1343 template <
class SOURCE_TYPE>
1351 template <
class KEY_ARG,
class BDE_OTHER_TYPE>
1353 bool *isInsertedFlag,
1426 void swap(HashTable& other);
1428#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1431#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT
1432#define BSLSTL_HASHTABLE_VARIADIC_LIMIT 10
1434#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT_C
1435#define BSLSTL_HASHTABLE_VARIADIC_LIMIT_C BSLSTL_HASHTABLE_VARIADIC_LIMIT
1437#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 0
1439 bool *isInsertedFlag,
1444#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 1
1445 template <
class ARGS_01>
1447 bool *isInsertedFlag,
1453#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 2
1454 template <
class ARGS_01,
1457 bool *isInsertedFlag,
1464#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 3
1465 template <
class ARGS_01,
1469 bool *isInsertedFlag,
1477#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 4
1478 template <
class ARGS_01,
1483 bool *isInsertedFlag,
1492#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 5
1493 template <
class ARGS_01,
1499 bool *isInsertedFlag,
1509#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 6
1510 template <
class ARGS_01,
1517 bool *isInsertedFlag,
1528#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 7
1529 template <
class ARGS_01,
1537 bool *isInsertedFlag,
1549#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 8
1550 template <
class ARGS_01,
1559 bool *isInsertedFlag,
1572#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 9
1573 template <
class ARGS_01,
1583 bool *isInsertedFlag,
1597#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 10
1598 template <
class ARGS_01,
1609 bool *isInsertedFlag,
1625#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 0
1627 bool *isInsertedFlag,
1632#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 1
1633 template <
class ARGS_01>
1635 bool *isInsertedFlag,
1641#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 2
1642 template <
class ARGS_01,
1645 bool *isInsertedFlag,
1652#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 3
1653 template <
class ARGS_01,
1657 bool *isInsertedFlag,
1665#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 4
1666 template <
class ARGS_01,
1671 bool *isInsertedFlag,
1680#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 5
1681 template <
class ARGS_01,
1687 bool *isInsertedFlag,
1697#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 6
1698 template <
class ARGS_01,
1705 bool *isInsertedFlag,
1716#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 7
1717 template <
class ARGS_01,
1725 bool *isInsertedFlag,
1737#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 8
1738 template <
class ARGS_01,
1747 bool *isInsertedFlag,
1760#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 9
1761 template <
class ARGS_01,
1771 bool *isInsertedFlag,
1785#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 10
1786 template <
class ARGS_01,
1797 bool *isInsertedFlag,
1814#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 0
1815 template <
class LOOKUP_KEY>
1817 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
1818 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
1820 bool *isInsertedFlag,
1826 const LOOKUP_KEY& lvalue = key;
1827 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
1830 || !d_parameters.comparator()(
1832 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
1834 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
1837 d_parameters.comparator(),
1842 *isInsertedFlag =
false;
1846 if (d_size >= d_capacity) {
1850 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1851 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
1852 std::piecewise_construct,
1854 std::forward_as_tuple());
1856 typedef typename ValueType::second_type MappedType;
1865 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
1870 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
1871 nodeProctor(&d_parameters.nodeFactory(), hint);
1872 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
1873 nodeProctor.release();
1876 *isInsertedFlag =
true;
1881#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 1
1882 template <
class LOOKUP_KEY,
class ARGS_01>
1884 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
1885 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
1887 bool *isInsertedFlag,
1894 const LOOKUP_KEY& lvalue = key;
1895 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
1898 || !d_parameters.comparator()(
1900 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
1902 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
1905 d_parameters.comparator(),
1910 *isInsertedFlag =
false;
1914 if (d_size >= d_capacity) {
1918 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1919 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
1920 std::piecewise_construct,
1922 std::forward_as_tuple(
1925 typedef typename ValueType::second_type MappedType;
1935 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
1940 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
1941 nodeProctor(&d_parameters.nodeFactory(), hint);
1942 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
1943 nodeProctor.release();
1946 *isInsertedFlag =
true;
1951#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 2
1952 template <
class LOOKUP_KEY,
class ARGS_01,
1955 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
1956 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
1958 bool *isInsertedFlag,
1966 const LOOKUP_KEY& lvalue = key;
1967 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
1970 || !d_parameters.comparator()(
1972 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
1974 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
1977 d_parameters.comparator(),
1982 *isInsertedFlag =
false;
1986 if (d_size >= d_capacity) {
1990 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1991 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
1992 std::piecewise_construct,
1994 std::forward_as_tuple(
1998 typedef typename ValueType::second_type MappedType;
2009 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2014 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2015 nodeProctor(&d_parameters.nodeFactory(), hint);
2016 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2017 nodeProctor.release();
2020 *isInsertedFlag =
true;
2025#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 3
2026 template <
class LOOKUP_KEY,
class ARGS_01,
2030 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2031 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2033 bool *isInsertedFlag,
2042 const LOOKUP_KEY& lvalue = key;
2043 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2046 || !d_parameters.comparator()(
2048 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2050 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2053 d_parameters.comparator(),
2058 *isInsertedFlag =
false;
2062 if (d_size >= d_capacity) {
2066 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2067 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2068 std::piecewise_construct,
2070 std::forward_as_tuple(
2075 typedef typename ValueType::second_type MappedType;
2087 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2092 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2093 nodeProctor(&d_parameters.nodeFactory(), hint);
2094 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2095 nodeProctor.release();
2098 *isInsertedFlag =
true;
2103#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 4
2104 template <
class LOOKUP_KEY,
class ARGS_01,
2109 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2110 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2112 bool *isInsertedFlag,
2122 const LOOKUP_KEY& lvalue = key;
2123 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2126 || !d_parameters.comparator()(
2128 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2130 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2133 d_parameters.comparator(),
2138 *isInsertedFlag =
false;
2142 if (d_size >= d_capacity) {
2146 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2147 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2148 std::piecewise_construct,
2150 std::forward_as_tuple(
2156 typedef typename ValueType::second_type MappedType;
2169 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2174 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2175 nodeProctor(&d_parameters.nodeFactory(), hint);
2176 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2177 nodeProctor.release();
2180 *isInsertedFlag =
true;
2185#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 5
2186 template <
class LOOKUP_KEY,
class ARGS_01,
2192 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2193 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2195 bool *isInsertedFlag,
2206 const LOOKUP_KEY& lvalue = key;
2207 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2210 || !d_parameters.comparator()(
2212 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2214 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2217 d_parameters.comparator(),
2222 *isInsertedFlag =
false;
2226 if (d_size >= d_capacity) {
2230 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2231 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2232 std::piecewise_construct,
2234 std::forward_as_tuple(
2241 typedef typename ValueType::second_type MappedType;
2255 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2260 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2261 nodeProctor(&d_parameters.nodeFactory(), hint);
2262 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2263 nodeProctor.release();
2266 *isInsertedFlag =
true;
2271#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 6
2272 template <
class LOOKUP_KEY,
class ARGS_01,
2279 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2280 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2282 bool *isInsertedFlag,
2294 const LOOKUP_KEY& lvalue = key;
2295 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2298 || !d_parameters.comparator()(
2300 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2302 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2305 d_parameters.comparator(),
2310 *isInsertedFlag =
false;
2314 if (d_size >= d_capacity) {
2318 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2319 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2320 std::piecewise_construct,
2322 std::forward_as_tuple(
2330 typedef typename ValueType::second_type MappedType;
2345 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2350 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2351 nodeProctor(&d_parameters.nodeFactory(), hint);
2352 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2353 nodeProctor.release();
2356 *isInsertedFlag =
true;
2361#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 7
2362 template <
class LOOKUP_KEY,
class ARGS_01,
2370 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2371 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2373 bool *isInsertedFlag,
2386 const LOOKUP_KEY& lvalue = key;
2387 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2390 || !d_parameters.comparator()(
2392 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2394 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2397 d_parameters.comparator(),
2402 *isInsertedFlag =
false;
2406 if (d_size >= d_capacity) {
2410 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2411 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2412 std::piecewise_construct,
2414 std::forward_as_tuple(
2423 typedef typename ValueType::second_type MappedType;
2439 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2444 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2445 nodeProctor(&d_parameters.nodeFactory(), hint);
2446 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2447 nodeProctor.release();
2450 *isInsertedFlag =
true;
2455#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 8
2456 template <
class LOOKUP_KEY,
class ARGS_01,
2465 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2466 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2468 bool *isInsertedFlag,
2482 const LOOKUP_KEY& lvalue = key;
2483 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2486 || !d_parameters.comparator()(
2488 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2490 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2493 d_parameters.comparator(),
2498 *isInsertedFlag =
false;
2502 if (d_size >= d_capacity) {
2506 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2507 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2508 std::piecewise_construct,
2510 std::forward_as_tuple(
2520 typedef typename ValueType::second_type MappedType;
2537 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2542 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2543 nodeProctor(&d_parameters.nodeFactory(), hint);
2544 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2545 nodeProctor.release();
2548 *isInsertedFlag =
true;
2553#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 9
2554 template <
class LOOKUP_KEY,
class ARGS_01,
2564 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2565 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2567 bool *isInsertedFlag,
2582 const LOOKUP_KEY& lvalue = key;
2583 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2586 || !d_parameters.comparator()(
2588 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2590 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2593 d_parameters.comparator(),
2598 *isInsertedFlag =
false;
2602 if (d_size >= d_capacity) {
2606 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2607 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2608 std::piecewise_construct,
2610 std::forward_as_tuple(
2621 typedef typename ValueType::second_type MappedType;
2639 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2644 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2645 nodeProctor(&d_parameters.nodeFactory(), hint);
2646 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2647 nodeProctor.release();
2650 *isInsertedFlag =
true;
2655#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_C >= 10
2656 template <
class LOOKUP_KEY,
class ARGS_01,
2667 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2668 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2670 bool *isInsertedFlag,
2686 const LOOKUP_KEY& lvalue = key;
2687 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2690 || !d_parameters.comparator()(
2692 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2694 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2697 d_parameters.comparator(),
2702 *isInsertedFlag =
false;
2706 if (d_size >= d_capacity) {
2710 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2711 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2712 std::piecewise_construct,
2714 std::forward_as_tuple(
2726 typedef typename ValueType::second_type MappedType;
2745 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2750 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2751 nodeProctor(&d_parameters.nodeFactory(), hint);
2752 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2753 nodeProctor.release();
2756 *isInsertedFlag =
true;
2764 template <
class... ARGS>
2766 bool *isInsertedFlag,
2771 template <
class... ARGS>
2773 bool *isInsertedFlag,
2779 template <
class LOOKUP_KEY,
class... ARGS>
2781 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2782 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2784 bool *isInsertedFlag,
2791 const LOOKUP_KEY& lvalue = key;
2792 const std::size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
2795 || !d_parameters.comparator()(
2797 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
2799 hint = bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2802 d_parameters.comparator(),
2807 *isInsertedFlag =
false;
2811 if (d_size >= d_capacity) {
2815 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2816 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2817 std::piecewise_construct,
2821 typedef typename ValueType::second_type MappedType;
2831 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
2836 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
2837 nodeProctor(&d_parameters.nodeFactory(), hint);
2838 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
2839 nodeProctor.release();
2842 *isInsertedFlag =
true;
2887 template <
class LOOKUP_KEY>
2889 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2890 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2892 find(
const LOOKUP_KEY& key)
const
2894 return bslalg::HashTableImpUtil::findTransparent<KEY_CONFIG>(
2897 d_parameters.comparator(),
2898 d_parameters.hashCodeForKey(key));
2933 template <
class LOOKUP_KEY>
2935 BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value
2936 && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value,
2940 const LOOKUP_KEY& key)
const
2945 *first = this->find(key);
2981 const HASHER&
hasher()
const;
3035template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3036void swap(HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& x,
3037 HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& y);
3051template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3053 const HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& lhs,
3054 const HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& rhs);
3069template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3071 const HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& lhs,
3072 const HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>& rhs);
3081template <
class FACTORY>
3082class HashTable_ArrayProctor {
3086 FACTORY *d_factory_p;
3091 HashTable_ArrayProctor(
const HashTable_ArrayProctor&);
3092 HashTable_ArrayProctor& operator=(
const HashTable_ArrayProctor&);
3100 HashTable_ArrayProctor(FACTORY *factory,
3131template <
class FACTORY>
3132class HashTable_NodeProctor {
3136 FACTORY *d_factory_p;
3141 HashTable_NodeProctor(
const HashTable_NodeProctor&);
3142 HashTable_NodeProctor& operator=(
const HashTable_NodeProctor&);
3151 HashTable_NodeProctor(FACTORY *factory,
3173struct HashTable_ImpDetails {
3191 size_t requestedBuckets,
3192 double maxLoadFactor);
3222struct HashTable_Util {
3232 template <
class TYPE>
3234 template <
class TYPE>
3236 template <
class TYPE>
3241 template<
class ALLOCATOR>
3243 std::size_t bucketArraySize,
3244 const ALLOCATOR& allocator);
3251 template<
class ALLOCATOR>
3253 std::size_t bucketArraySize,
3254 const ALLOCATOR& allocator);
3269template <
class HASHER>
3270struct HashTable_BaseHasher
3272 typename CallableVariable<HASHER>::type> >
3276template <
class COMPARATOR>
3277struct HashTable_Comparator
3279 typename CallableVariable<COMPARATOR>::type> >
3287template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3288class HashTable_ImplParameters
3289 :
private HashTable_BaseHasher<HASHER>::Type
3290 ,
private HashTable_Comparator<COMPARATOR>::Type
3302 typedef ALLOCATOR AllocatorType;
3303 typedef ::bsl::allocator_traits<AllocatorType> AllocatorTraits;
3304 typedef typename KEY_CONFIG::ValueType ValueType;
3309 typedef HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>
HashTableType;
3310 typedef typename HashTableType::AllocatorTraits::
3312 typedef typename ReboundTraits::allocator_type
NodeAllocator;
3315 BidirectionalNodePool<typename HashTableType::ValueType, NodeAllocator>
3328 HashTable_ImplParameters(
const HashTable_ImplParameters&);
3329 HashTable_ImplParameters& operator=(
const HashTable_ImplParameters&);
3337 explicit HashTable_ImplParameters(
const ALLOCATOR& allocator);
3342 HashTable_ImplParameters(
const HASHER& hash,
3343 const COMPARATOR& compare,
3344 const ALLOCATOR& allocator);
3349 HashTable_ImplParameters(
const HashTable_ImplParameters& original,
3350 const ALLOCATOR& allocator);
3357 HashTable_ImplParameters(
3388 template <
class DEDUCED_KEY>
3393 const BaseHasher&
hasher()
const;
3416template <
class FUNCTOR>
3423template <
class FUNCTOR>
3425HashTable_HashWrapper<FUNCTOR>::HashTable_HashWrapper(
const FUNCTOR& fn)
3430template <
class FUNCTOR>
3431template <
class ARG_TYPE>
3434HashTable_HashWrapper<FUNCTOR>::operator()(ARG_TYPE& arg)
const
3436 return d_functor(arg);
3439template <
class FUNCTOR>
3441const FUNCTOR& HashTable_HashWrapper<FUNCTOR>::functor()
const
3446template <
class FUNCTOR>
3448void HashTable_HashWrapper<FUNCTOR>::swap(HashTable_HashWrapper &other)
3451 swap(d_functor, other.d_functor);
3456template <
class FUNCTOR>
3458HashTable_HashWrapper<const FUNCTOR>::HashTable_HashWrapper()
3463template <
class FUNCTOR>
3465HashTable_HashWrapper<const FUNCTOR>::HashTable_HashWrapper(
const FUNCTOR& fn)
3470template <
class FUNCTOR>
3471template <
class ARG_TYPE>
3474HashTable_HashWrapper<const FUNCTOR>::operator()(ARG_TYPE& arg)
const
3476 return d_functor(arg);
3479template <
class FUNCTOR>
3481const FUNCTOR& HashTable_HashWrapper<const FUNCTOR>::functor()
const
3488template <
class FUNCTOR>
3490HashTable_HashWrapper<FUNCTOR &>::HashTable_HashWrapper(FUNCTOR& fn)
3495template <
class FUNCTOR>
3496template <
class ARG_TYPE>
3499HashTable_HashWrapper<FUNCTOR &>::operator()(ARG_TYPE& arg)
const
3501 return d_functor(arg);
3504template <
class FUNCTOR>
3506FUNCTOR& HashTable_HashWrapper<FUNCTOR &>::functor()
const
3515template <
class FUNCTOR>
3517HashTable_ComparatorWrapper<FUNCTOR>::HashTable_ComparatorWrapper()
3522template <
class FUNCTOR>
3524HashTable_ComparatorWrapper<FUNCTOR>::
3525HashTable_ComparatorWrapper(
const FUNCTOR& fn)
3530template <
class FUNCTOR>
3531template <
class ARG1_TYPE,
class ARG2_TYPE>
3534HashTable_ComparatorWrapper<FUNCTOR>::operator()(ARG1_TYPE& arg1,
3535 ARG2_TYPE& arg2)
const
3537 return d_functor(arg1, arg2);
3540template <
class FUNCTOR>
3541const FUNCTOR& HashTable_ComparatorWrapper<FUNCTOR>::functor()
const
3546template <
class FUNCTOR>
3549HashTable_ComparatorWrapper<FUNCTOR>::swap(HashTable_ComparatorWrapper &other)
3552 swap(d_functor, other.d_functor);
3557template <
class FUNCTOR>
3559HashTable_ComparatorWrapper<const FUNCTOR>::HashTable_ComparatorWrapper()
3564template <
class FUNCTOR>
3566HashTable_ComparatorWrapper<const FUNCTOR>::
3567HashTable_ComparatorWrapper(
const FUNCTOR& fn)
3572template <
class FUNCTOR>
3573template <
class ARG1_TYPE,
class ARG2_TYPE>
3576HashTable_ComparatorWrapper<const FUNCTOR>::operator()(ARG1_TYPE& arg1,
3577 ARG2_TYPE& arg2)
const
3579 return d_functor(arg1, arg2);
3582template <
class FUNCTOR>
3583const FUNCTOR& HashTable_ComparatorWrapper<const FUNCTOR>::functor()
const
3590template <
class FUNCTOR>
3592HashTable_ComparatorWrapper<FUNCTOR &>::
3593HashTable_ComparatorWrapper(FUNCTOR& fn)
3598template <
class FUNCTOR>
3599template <
class ARG1_TYPE,
class ARG2_TYPE>
3602HashTable_ComparatorWrapper<FUNCTOR &>::operator()(ARG1_TYPE& arg1,
3603 ARG2_TYPE& arg2)
const
3605 return d_functor(arg1, arg2);
3608template <
class FUNCTOR>
3610FUNCTOR& HashTable_ComparatorWrapper<FUNCTOR &>::functor()
const
3620template <
class FACTORY>
3622HashTable_NodeProctor<FACTORY>::HashTable_NodeProctor(
3625: d_factory_p(factory)
3631template <
class FACTORY>
3633HashTable_NodeProctor<FACTORY>::~HashTable_NodeProctor()
3636 d_factory_p->deleteNode(d_node_p);
3641template <
class FACTORY>
3643void HashTable_NodeProctor<FACTORY>::release()
3653template <
class FACTORY>
3655HashTable_ArrayProctor<FACTORY>::HashTable_ArrayProctor(
3658: d_factory_p(factory)
3665template <
class FACTORY>
3667HashTable_ArrayProctor<FACTORY>::~HashTable_ArrayProctor()
3670 HashTable_Util::destroyBucketArray(d_anchor_p->bucketArrayAddress(),
3671 d_anchor_p->bucketArraySize(),
3672 d_factory_p->allocator());
3677 d_factory_p->deleteNode(root);
3684template <
class FACTORY>
3686void HashTable_ArrayProctor<FACTORY>::release()
3695template <
class TYPE>
3697void HashTable_Util::assertNotNullPointer(TYPE&)
3701template <
class TYPE>
3703void HashTable_Util::assertNotNullPointer(TYPE *
const& ptr)
3710template <
class TYPE>
3712void HashTable_Util::assertNotNullPointer(TYPE * & ptr)
3719template <
class ALLOCATOR>
3721void HashTable_Util::destroyBucketArray(
3723 std::size_t bucketArraySize,
3724 const ALLOCATOR& allocator)
3728 (1 < bucketArraySize
3729 && HashTable_ImpDetails::defaultBucketAddress() != data)
3730 || (1 == bucketArraySize
3731 && HashTable_ImpDetails::defaultBucketAddress() == data));
3733#ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
3736 bucketArraySize <= std::numeric_limits<AllocSizeType>::max());
3739 if (HashTable_ImpDetails::defaultBucketAddress() != data) {
3745template <
class ALLOCATOR>
3748 std::size_t bucketArraySize,
3749 const ALLOCATOR& allocator)
3754#ifdef BSLS_ASSERT_SAFE_IS_ACTIVE
3757 bucketArraySize <= std::numeric_limits<AllocSizeType>::max());
3761 Bucket *
data = bslma::AllocatorUtil::allocateObject<Bucket>(allocator,
3764 std::fill_n(data, bucketArraySize, Bucket());
3774template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3776HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3777HashTable_ImplParameters(
const ALLOCATOR& allocator)
3780, d_nodeFactory(allocator)
3784template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3786HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3787HashTable_ImplParameters(
const HASHER& hash,
3788 const COMPARATOR& compare,
3789 const ALLOCATOR& allocator)
3791, BaseComparator(compare)
3792, d_nodeFactory(allocator)
3796template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3798HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3799HashTable_ImplParameters(
const HashTable_ImplParameters& original,
3800 const ALLOCATOR& allocator)
3801: BaseHasher(static_cast<const BaseHasher&>(original))
3802, BaseComparator(static_cast<const BaseComparator&>(original))
3803, d_nodeFactory(allocator)
3807template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3809HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3811: BaseHasher(static_cast<const BaseHasher&>(original))
3812, BaseComparator(static_cast<const BaseComparator&>(original))
3813, d_nodeFactory(MoveUtil::move(MoveUtil::access(original).d_nodeFactory))
3818template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3820typename HashTable_ImplParameters<KEY_CONFIG,
3823 ALLOCATOR>::NodeFactory &
3824HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3827 return d_nodeFactory;
3830template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3832void HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3833quickSwapExchangeAllocators(HashTable_ImplParameters *other)
3838 swap(*
static_cast<BaseHasher*
>(
this), *
static_cast<BaseHasher*
>(other));
3840 swap(*
static_cast<BaseComparator*
>(
this),
3841 *
static_cast<BaseComparator*
>(other));
3843 nodeFactory().swapExchangeAllocators(other->nodeFactory());
3846template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3848void HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3849quickSwapRetainAllocators(HashTable_ImplParameters *other)
3854 swap(*
static_cast<BaseHasher*
>(
this), *
static_cast<BaseHasher*
>(other));
3856 swap(*
static_cast<BaseComparator*
>(
this),
3857 *
static_cast<BaseComparator*
>(other));
3859 nodeFactory().swapRetainAllocators(other->nodeFactory());
3863template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3865const typename HashTable_ImplParameters<KEY_CONFIG,
3868 ALLOCATOR>::BaseComparator &
3869HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3875template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3876template <
class DEDUCED_KEY>
3878std::size_t HashTable_ImplParameters<KEY_CONFIG,
3882hashCodeForKey(DEDUCED_KEY& key)
const
3884 return static_cast<const BaseHasher &
>(*this)(key);
3887template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3889const typename HashTable_ImplParameters<KEY_CONFIG,
3892 ALLOCATOR>::BaseHasher &
3893HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::hasher()
3899template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3901const typename HashTable_ImplParameters<KEY_CONFIG,
3904 ALLOCATOR>::NodeFactory &
3905HashTable_ImplParameters<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3908 return d_nodeFactory;
3911template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3914HashTable_ImplParameters<KEY_CONFIG,
3917 ALLOCATOR>::originalComparator()
const
3919 return static_cast<const BaseComparator *
>(
this)->functor();
3922template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3924const HASHER& HashTable_ImplParameters<KEY_CONFIG,
3927 ALLOCATOR>::originalHasher()
const
3929 return static_cast<const BaseHasher *
>(
this)->functor();
3937template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3939HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3940HashTable(
const ALLOCATOR& basicAllocator)
3941: d_parameters(basicAllocator)
3942, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
3945, d_maxLoadFactor(1.0)
3951template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3953HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3954HashTable(
const HASHER& hash,
3955 const COMPARATOR& compare,
3956 SizeType initialNumBuckets,
3957 float initialMaxLoadFactor,
3958 const ALLOCATOR& basicAllocator)
3959: d_parameters(hash, compare, basicAllocator)
3960, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
3963, d_maxLoadFactor(initialMaxLoadFactor)
3968 HashTable_Util::assertNotNullPointer(hash);
3971 HashTable_Util::assertNotNullPointer(compare);
3974 if (0 != initialNumBuckets) {
3976 size_t numBuckets = HashTable_ImpDetails::growBucketsForLoadFactor(
3979 static_cast<size_t>(initialNumBuckets),
3981 HashTable_Util::initAnchor(&d_anchor, numBuckets, basicAllocator);
3982 d_capacity =
static_cast<SizeType
>(capacity);
3986template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
3988HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
3989HashTable(
const HashTable& original)
3991 original.d_parameters,
3992 AllocatorTraits::select_on_container_copy_construction(original.allocator()))
3993, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
3994, d_size(original.d_size)
3996, d_maxLoadFactor(original.d_maxLoadFactor)
3999 d_parameters.nodeFactory().reserveNodes(original.d_size);
4000 this->copyDataStructure(original.d_anchor.listRootAddress());
4004template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4006HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::HashTable(
4007 BloombergLP::bslmf::MovableRef<HashTable> original)
4008: d_parameters(MoveUtil::move(MoveUtil::access(original).d_parameters))
4009, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
4012, d_maxLoadFactor(1.0)
4014 HashTable& lvalue = original;
4016 swap(d_anchor, lvalue.d_anchor);
4017 swap(d_size, lvalue.d_size);
4018 swap(d_capacity, lvalue.d_capacity);
4019 swap(d_maxLoadFactor, lvalue.d_maxLoadFactor);
4022template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4024HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4025HashTable(
const HashTable& original,
const ALLOCATOR& basicAllocator)
4026: d_parameters(original.d_parameters, basicAllocator)
4027, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
4028, d_size(original.d_size)
4030, d_maxLoadFactor(original.d_maxLoadFactor)
4033 d_parameters.nodeFactory().reserveNodes(original.d_size);
4034 this->copyDataStructure(original.d_anchor.listRootAddress());
4038template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4039HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4041 const ALLOCATOR& basicAllocator)
4042: d_parameters(MoveUtil::access(original).d_parameters.originalHasher(),
4043 MoveUtil::access(original).d_parameters.originalComparator(),
4045, d_anchor(HashTable_ImpDetails::defaultBucketAddress(), 1, 0)
4048, d_maxLoadFactor(1.0)
4050 HashTable& lvalue = original;
4052 basicAllocator == lvalue.allocator())) {
4053 d_parameters.nodeFactory().adopt(
4054 MoveUtil::move(lvalue.d_parameters.nodeFactory()));
4056 swap(d_anchor, lvalue.d_anchor);
4057 swap(d_size, lvalue.d_size);
4058 swap(d_capacity, lvalue.d_capacity);
4059 swap(d_maxLoadFactor, lvalue.d_maxLoadFactor);
4062 d_size = lvalue.d_size;
4063 d_maxLoadFactor = lvalue.d_maxLoadFactor;
4067 HashTable_ImpDetails::defaultBucketAddress(), 1, 0);
4069 swap(anchor, lvalue.d_anchor);
4072 lvalue.d_capacity = 0;
4073 lvalue.d_maxLoadFactor = 1.0f;
4075 HashTable_ArrayProctor<typename ImplParameters::NodeFactory>
4076 arrayProctor(&lvalue.d_parameters.nodeFactory(),
4079 d_parameters.nodeFactory().reserveNodes(d_size);
4087template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4089HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::~HashTable()
4091#if defined(BDE_BUILD_TARGET_SAFE_2)
4104 this->d_parameters.hasher(),
4105 HashTable_ImpDetails::incidentalAllocator()));
4108 this->removeAllAndDeallocate();
4112template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4114HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::copyDataStructure(
4127 size_t numBuckets = HashTable_ImpDetails::growBucketsForLoadFactor(
4129 static_cast<size_t>(d_size),
4134 HashTable_Util::initAnchor(&d_anchor, numBuckets, this->allocator());
4138 HashTable_ArrayProctor<typename ImplParameters::NodeFactory>
4139 arrayProctor(&d_parameters.nodeFactory(), &d_anchor);
4141 d_capacity =
static_cast<SizeType
>(capacity);
4149 size_t hashCode = this->hashCodeForNode(cursor);
4151 d_parameters.nodeFactory().cloneNode(*cursor);
4157 while (0 != (cursor = cursor->
nextLink()));
4161 arrayProctor.release();
4164template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4166HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::moveDataStructure(
4179 size_t numBuckets = HashTable_ImpDetails::growBucketsForLoadFactor(
4181 static_cast<size_t>(d_size),
4186 HashTable_Util::initAnchor(&d_anchor, numBuckets, this->allocator());
4188 d_capacity =
static_cast<SizeType
>(capacity);
4192 HashTable_ArrayProctor<typename ImplParameters::NodeFactory>
4193 arrayProctor(&d_parameters.nodeFactory(), &d_anchor);
4201 size_t hashCode = this->hashCodeForNode(cursor);
4203 d_parameters.nodeFactory().moveIntoNewNode(cursor);
4209 while (0 != (cursor = cursor->
nextLink()));
4213 arrayProctor.release();
4216template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4218HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4219quickSwapExchangeAllocators(HashTable *other)
4223 d_parameters.quickSwapExchangeAllocators(&other->d_parameters);
4226 swap(d_anchor, other->d_anchor);
4227 swap(d_size, other->d_size);
4228 swap(d_capacity, other->d_capacity);
4229 swap(d_maxLoadFactor, other->d_maxLoadFactor);
4232template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4234HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4235quickSwapRetainAllocators(HashTable *other)
4240 d_parameters.quickSwapRetainAllocators(&other->d_parameters);
4243 swap(d_anchor, other->d_anchor);
4244 swap(d_size, other->d_size);
4245 swap(d_capacity, other->d_capacity);
4246 swap(d_maxLoadFactor, other->d_maxLoadFactor);
4249template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4251HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
4252rehashIntoExactlyNumBuckets(SizeType newNumBuckets, SizeType capacity)
4265 HashTable *d_table_p;
4269#if !defined(BSLS_PLATFORM_CMP_MSVC)
4274 Proctor(
const Proctor&);
4275 Proctor& operator=(
const Proctor&);
4280 Proctor(HashTable *table,
4284 , d_originalAnchor_p(originalAnchor)
4285 , d_newAnchor_p(newAnchor)
4294 if (d_originalAnchor_p) {
4300 d_table_p->removeAll();
4307 HashTable_Util::destroyBucketArray(
4310 d_table_p->allocator());
4316 d_originalAnchor_p = 0;
4328 HashTable_Util::initAnchor(&newAnchor,
4329 static_cast<size_t>(newNumBuckets),
4332 Proctor cleanUpIfUserHashThrows(
this, &d_anchor, &newAnchor);
4335 bslalg::HashTableImpUtil::rehash<KEY_CONFIG>(
4338 this->d_parameters.hasher());
4341 cleanUpIfUserHashThrows.dismiss();
4343 d_anchor.
swap(newAnchor);
4344 d_capacity = capacity;
4347template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4350HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::removeAllAndDeallocate()
4352 this->removeAllImp();
4358template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4360HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::removeAllImp()
4369 BidirectionalLink *next;
4372 d_parameters.nodeFactory().deleteNode(
4373 static_cast<NodeType *
>(root));
4375 while(0 != (root = next));
4380template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4381template <
class DEDUCED_KEY>
4384HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::find(
4386 std::size_t hashValue)
const
4388 return bslalg::HashTableImpUtil::find<KEY_CONFIG>(
4391 d_parameters.comparator(),
4395template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4398HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::getBucketAddress(
4399 SizeType bucketIndex)
const
4406template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4409HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::hashCodeForNode(
4414 return d_parameters.hashCodeForKey(
4415 bslalg::HashTableImpUtil::extractKey<KEY_CONFIG>(node));
4419template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4421HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>&
4422HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::operator=(
4423 const HashTable& rhs)
4427 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
4428 HashTable other(rhs, rhs.allocator());
4429 quickSwapExchangeAllocators(&other);
4432 HashTable other(rhs, this->allocator());
4433 quickSwapRetainAllocators(&other);
4439template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4441HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>&
4442HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::operator=(
4445 HashTable& lvalue = rhs;
4447 if (allocator() == lvalue.allocator()) {
4448 HashTable other(MoveUtil::move(lvalue));
4449 quickSwapRetainAllocators(&other);
4452 AllocatorTraits::propagate_on_container_move_assignment::value) {
4453 HashTable other(MoveUtil::move(lvalue));
4454 quickSwapExchangeAllocators(&other);
4457 HashTable other(MoveUtil::move(lvalue), allocator());
4458 quickSwapRetainAllocators(&other);
4464#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
4467#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT
4468#define BSLSTL_HASHTABLE_VARIADIC_LIMIT 10
4470#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT_D
4471#define BSLSTL_HASHTABLE_VARIADIC_LIMIT_D BSLSTL_HASHTABLE_VARIADIC_LIMIT
4473#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 0
4474template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4476HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4482 if (d_size >= d_capacity) {
4483 this->rehashForNumBuckets(numBuckets() * 2);
4488 d_parameters.nodeFactory().emplaceIntoNewNode(
4492 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4493 nodeProctor(&d_parameters.nodeFactory(), newNode);
4496 size_t hashCode = this->d_parameters.hashCodeForKey(
4497 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4499 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4503 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4506 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4508 nodeProctor.release();
4516#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 1
4517template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4518template <
class ARGS_01>
4520HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4526 if (d_size >= d_capacity) {
4527 this->rehashForNumBuckets(numBuckets() * 2);
4532 d_parameters.nodeFactory().emplaceIntoNewNode(
4536 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4537 nodeProctor(&d_parameters.nodeFactory(), newNode);
4540 size_t hashCode = this->d_parameters.hashCodeForKey(
4541 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4543 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4547 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4550 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4552 nodeProctor.release();
4560#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 2
4561template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4562template <
class ARGS_01,
4565HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4572 if (d_size >= d_capacity) {
4573 this->rehashForNumBuckets(numBuckets() * 2);
4578 d_parameters.nodeFactory().emplaceIntoNewNode(
4583 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4584 nodeProctor(&d_parameters.nodeFactory(), newNode);
4587 size_t hashCode = this->d_parameters.hashCodeForKey(
4588 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4590 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4594 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4597 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4599 nodeProctor.release();
4607#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 3
4608template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4609template <
class ARGS_01,
4613HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4621 if (d_size >= d_capacity) {
4622 this->rehashForNumBuckets(numBuckets() * 2);
4627 d_parameters.nodeFactory().emplaceIntoNewNode(
4633 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4634 nodeProctor(&d_parameters.nodeFactory(), newNode);
4637 size_t hashCode = this->d_parameters.hashCodeForKey(
4638 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4640 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4644 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4647 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4649 nodeProctor.release();
4657#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 4
4658template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4659template <
class ARGS_01,
4664HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4673 if (d_size >= d_capacity) {
4674 this->rehashForNumBuckets(numBuckets() * 2);
4679 d_parameters.nodeFactory().emplaceIntoNewNode(
4686 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4687 nodeProctor(&d_parameters.nodeFactory(), newNode);
4690 size_t hashCode = this->d_parameters.hashCodeForKey(
4691 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4693 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4697 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4700 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4702 nodeProctor.release();
4710#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 5
4711template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4712template <
class ARGS_01,
4718HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4728 if (d_size >= d_capacity) {
4729 this->rehashForNumBuckets(numBuckets() * 2);
4734 d_parameters.nodeFactory().emplaceIntoNewNode(
4742 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4743 nodeProctor(&d_parameters.nodeFactory(), newNode);
4746 size_t hashCode = this->d_parameters.hashCodeForKey(
4747 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4749 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4753 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4756 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4758 nodeProctor.release();
4766#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 6
4767template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4768template <
class ARGS_01,
4775HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4786 if (d_size >= d_capacity) {
4787 this->rehashForNumBuckets(numBuckets() * 2);
4792 d_parameters.nodeFactory().emplaceIntoNewNode(
4801 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4802 nodeProctor(&d_parameters.nodeFactory(), newNode);
4805 size_t hashCode = this->d_parameters.hashCodeForKey(
4806 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4808 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4812 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4815 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4817 nodeProctor.release();
4825#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 7
4826template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4827template <
class ARGS_01,
4835HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4847 if (d_size >= d_capacity) {
4848 this->rehashForNumBuckets(numBuckets() * 2);
4853 d_parameters.nodeFactory().emplaceIntoNewNode(
4863 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4864 nodeProctor(&d_parameters.nodeFactory(), newNode);
4867 size_t hashCode = this->d_parameters.hashCodeForKey(
4868 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4870 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4874 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4877 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4879 nodeProctor.release();
4887#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 8
4888template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4889template <
class ARGS_01,
4898HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4911 if (d_size >= d_capacity) {
4912 this->rehashForNumBuckets(numBuckets() * 2);
4917 d_parameters.nodeFactory().emplaceIntoNewNode(
4928 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4929 nodeProctor(&d_parameters.nodeFactory(), newNode);
4932 size_t hashCode = this->d_parameters.hashCodeForKey(
4933 ImpUtil::extractKey<KEY_CONFIG>(newNode));
4935 ImpUtil::extractKey<KEY_CONFIG>(newNode),
4939 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
4942 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
4944 nodeProctor.release();
4952#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 9
4953template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
4954template <
class ARGS_01,
4964HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
4978 if (d_size >= d_capacity) {
4979 this->rehashForNumBuckets(numBuckets() * 2);
4984 d_parameters.nodeFactory().emplaceIntoNewNode(
4996 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
4997 nodeProctor(&d_parameters.nodeFactory(), newNode);
5000 size_t hashCode = this->d_parameters.hashCodeForKey(
5001 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5003 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5007 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5010 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
5012 nodeProctor.release();
5020#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 10
5021template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5022template <
class ARGS_01,
5033HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
5048 if (d_size >= d_capacity) {
5049 this->rehashForNumBuckets(numBuckets() * 2);
5054 d_parameters.nodeFactory().emplaceIntoNewNode(
5067 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5068 nodeProctor(&d_parameters.nodeFactory(), newNode);
5071 size_t hashCode = this->d_parameters.hashCodeForKey(
5072 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5074 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5078 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5081 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
5083 nodeProctor.release();
5092#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 0
5093template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5095HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5101 if (d_size >= d_capacity) {
5102 this->rehashForNumBuckets(numBuckets() * 2);
5107 d_parameters.nodeFactory().emplaceIntoNewNode(
5111 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5112 nodeProctor(&d_parameters.nodeFactory(), newNode);
5115 size_t hashCode = this->d_parameters.hashCodeForKey(
5116 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5118 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5119 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5120 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5124 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5127 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5129 nodeProctor.release();
5137#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 1
5138template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5139template <
class ARGS_01>
5141HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5148 if (d_size >= d_capacity) {
5149 this->rehashForNumBuckets(numBuckets() * 2);
5154 d_parameters.nodeFactory().emplaceIntoNewNode(
5158 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5159 nodeProctor(&d_parameters.nodeFactory(), newNode);
5162 size_t hashCode = this->d_parameters.hashCodeForKey(
5163 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5165 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5166 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5167 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5171 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5174 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5176 nodeProctor.release();
5184#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 2
5185template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5186template <
class ARGS_01,
5189HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5197 if (d_size >= d_capacity) {
5198 this->rehashForNumBuckets(numBuckets() * 2);
5203 d_parameters.nodeFactory().emplaceIntoNewNode(
5208 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5209 nodeProctor(&d_parameters.nodeFactory(), newNode);
5212 size_t hashCode = this->d_parameters.hashCodeForKey(
5213 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5215 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5216 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5217 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5221 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5224 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5226 nodeProctor.release();
5234#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 3
5235template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5236template <
class ARGS_01,
5240HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5249 if (d_size >= d_capacity) {
5250 this->rehashForNumBuckets(numBuckets() * 2);
5255 d_parameters.nodeFactory().emplaceIntoNewNode(
5261 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5262 nodeProctor(&d_parameters.nodeFactory(), newNode);
5265 size_t hashCode = this->d_parameters.hashCodeForKey(
5266 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5268 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5269 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5270 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5274 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5277 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5279 nodeProctor.release();
5287#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 4
5288template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5289template <
class ARGS_01,
5294HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5304 if (d_size >= d_capacity) {
5305 this->rehashForNumBuckets(numBuckets() * 2);
5310 d_parameters.nodeFactory().emplaceIntoNewNode(
5317 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5318 nodeProctor(&d_parameters.nodeFactory(), newNode);
5321 size_t hashCode = this->d_parameters.hashCodeForKey(
5322 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5324 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5325 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5326 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5330 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5333 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5335 nodeProctor.release();
5343#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 5
5344template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5345template <
class ARGS_01,
5351HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5362 if (d_size >= d_capacity) {
5363 this->rehashForNumBuckets(numBuckets() * 2);
5368 d_parameters.nodeFactory().emplaceIntoNewNode(
5376 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5377 nodeProctor(&d_parameters.nodeFactory(), newNode);
5380 size_t hashCode = this->d_parameters.hashCodeForKey(
5381 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5383 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5384 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5385 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5389 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5392 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5394 nodeProctor.release();
5402#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 6
5403template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5404template <
class ARGS_01,
5411HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5423 if (d_size >= d_capacity) {
5424 this->rehashForNumBuckets(numBuckets() * 2);
5429 d_parameters.nodeFactory().emplaceIntoNewNode(
5438 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5439 nodeProctor(&d_parameters.nodeFactory(), newNode);
5442 size_t hashCode = this->d_parameters.hashCodeForKey(
5443 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5445 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5446 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5447 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5451 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5454 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5456 nodeProctor.release();
5464#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 7
5465template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5466template <
class ARGS_01,
5474HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5487 if (d_size >= d_capacity) {
5488 this->rehashForNumBuckets(numBuckets() * 2);
5493 d_parameters.nodeFactory().emplaceIntoNewNode(
5503 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5504 nodeProctor(&d_parameters.nodeFactory(), newNode);
5507 size_t hashCode = this->d_parameters.hashCodeForKey(
5508 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5510 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5511 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5512 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5516 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5519 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5521 nodeProctor.release();
5529#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 8
5530template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5531template <
class ARGS_01,
5540HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5554 if (d_size >= d_capacity) {
5555 this->rehashForNumBuckets(numBuckets() * 2);
5560 d_parameters.nodeFactory().emplaceIntoNewNode(
5571 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5572 nodeProctor(&d_parameters.nodeFactory(), newNode);
5575 size_t hashCode = this->d_parameters.hashCodeForKey(
5576 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5578 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5579 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5580 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5584 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5587 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5589 nodeProctor.release();
5597#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 9
5598template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5599template <
class ARGS_01,
5609HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5624 if (d_size >= d_capacity) {
5625 this->rehashForNumBuckets(numBuckets() * 2);
5630 d_parameters.nodeFactory().emplaceIntoNewNode(
5642 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5643 nodeProctor(&d_parameters.nodeFactory(), newNode);
5646 size_t hashCode = this->d_parameters.hashCodeForKey(
5647 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5649 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5650 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5651 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5655 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5658 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5660 nodeProctor.release();
5668#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 10
5669template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5670template <
class ARGS_01,
5681HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
5697 if (d_size >= d_capacity) {
5698 this->rehashForNumBuckets(numBuckets() * 2);
5703 d_parameters.nodeFactory().emplaceIntoNewNode(
5716 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5717 nodeProctor(&d_parameters.nodeFactory(), newNode);
5720 size_t hashCode = this->d_parameters.hashCodeForKey(
5721 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5723 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
5724 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
5725 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
5729 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5732 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
5734 nodeProctor.release();
5743#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 0
5744template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5746HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
5747 bool *isInsertedFlag)
5754 if (d_size >= d_capacity) {
5755 this->rehashForNumBuckets(numBuckets() * 2);
5760 d_parameters.nodeFactory().emplaceIntoNewNode(
5764 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5765 nodeProctor(&d_parameters.nodeFactory(), newNode);
5768 size_t hashCode = this->d_parameters.hashCodeForKey(
5769 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5771 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5774 *isInsertedFlag = (!position);
5777 if (d_size >= d_capacity) {
5778 this->rehashForNumBuckets(numBuckets() * 2);
5781 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5782 nodeProctor.release();
5792#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 1
5793template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5794template <
class ARGS_01>
5796HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
5797 bool *isInsertedFlag,
5805 if (d_size >= d_capacity) {
5806 this->rehashForNumBuckets(numBuckets() * 2);
5811 d_parameters.nodeFactory().emplaceIntoNewNode(
5815 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5816 nodeProctor(&d_parameters.nodeFactory(), newNode);
5819 size_t hashCode = this->d_parameters.hashCodeForKey(
5820 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5822 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5825 *isInsertedFlag = (!position);
5828 if (d_size >= d_capacity) {
5829 this->rehashForNumBuckets(numBuckets() * 2);
5832 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5833 nodeProctor.release();
5843#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 2
5844template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5845template <
class ARGS_01,
5848HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
5849 bool *isInsertedFlag,
5858 if (d_size >= d_capacity) {
5859 this->rehashForNumBuckets(numBuckets() * 2);
5864 d_parameters.nodeFactory().emplaceIntoNewNode(
5869 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5870 nodeProctor(&d_parameters.nodeFactory(), newNode);
5873 size_t hashCode = this->d_parameters.hashCodeForKey(
5874 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5876 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5879 *isInsertedFlag = (!position);
5882 if (d_size >= d_capacity) {
5883 this->rehashForNumBuckets(numBuckets() * 2);
5886 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5887 nodeProctor.release();
5897#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 3
5898template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5899template <
class ARGS_01,
5903HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
5904 bool *isInsertedFlag,
5914 if (d_size >= d_capacity) {
5915 this->rehashForNumBuckets(numBuckets() * 2);
5920 d_parameters.nodeFactory().emplaceIntoNewNode(
5926 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5927 nodeProctor(&d_parameters.nodeFactory(), newNode);
5930 size_t hashCode = this->d_parameters.hashCodeForKey(
5931 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5933 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5936 *isInsertedFlag = (!position);
5939 if (d_size >= d_capacity) {
5940 this->rehashForNumBuckets(numBuckets() * 2);
5943 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
5944 nodeProctor.release();
5954#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 4
5955template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
5956template <
class ARGS_01,
5961HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
5962 bool *isInsertedFlag,
5973 if (d_size >= d_capacity) {
5974 this->rehashForNumBuckets(numBuckets() * 2);
5979 d_parameters.nodeFactory().emplaceIntoNewNode(
5986 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
5987 nodeProctor(&d_parameters.nodeFactory(), newNode);
5990 size_t hashCode = this->d_parameters.hashCodeForKey(
5991 ImpUtil::extractKey<KEY_CONFIG>(newNode));
5993 ImpUtil::extractKey<KEY_CONFIG>(newNode),
5996 *isInsertedFlag = (!position);
5999 if (d_size >= d_capacity) {
6000 this->rehashForNumBuckets(numBuckets() * 2);
6003 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6004 nodeProctor.release();
6014#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 5
6015template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6016template <
class ARGS_01,
6022HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6023 bool *isInsertedFlag,
6035 if (d_size >= d_capacity) {
6036 this->rehashForNumBuckets(numBuckets() * 2);
6041 d_parameters.nodeFactory().emplaceIntoNewNode(
6049 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6050 nodeProctor(&d_parameters.nodeFactory(), newNode);
6053 size_t hashCode = this->d_parameters.hashCodeForKey(
6054 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6056 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6059 *isInsertedFlag = (!position);
6062 if (d_size >= d_capacity) {
6063 this->rehashForNumBuckets(numBuckets() * 2);
6066 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6067 nodeProctor.release();
6077#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 6
6078template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6079template <
class ARGS_01,
6086HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6087 bool *isInsertedFlag,
6100 if (d_size >= d_capacity) {
6101 this->rehashForNumBuckets(numBuckets() * 2);
6106 d_parameters.nodeFactory().emplaceIntoNewNode(
6115 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6116 nodeProctor(&d_parameters.nodeFactory(), newNode);
6119 size_t hashCode = this->d_parameters.hashCodeForKey(
6120 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6122 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6125 *isInsertedFlag = (!position);
6128 if (d_size >= d_capacity) {
6129 this->rehashForNumBuckets(numBuckets() * 2);
6132 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6133 nodeProctor.release();
6143#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 7
6144template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6145template <
class ARGS_01,
6153HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6154 bool *isInsertedFlag,
6168 if (d_size >= d_capacity) {
6169 this->rehashForNumBuckets(numBuckets() * 2);
6174 d_parameters.nodeFactory().emplaceIntoNewNode(
6184 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6185 nodeProctor(&d_parameters.nodeFactory(), newNode);
6188 size_t hashCode = this->d_parameters.hashCodeForKey(
6189 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6191 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6194 *isInsertedFlag = (!position);
6197 if (d_size >= d_capacity) {
6198 this->rehashForNumBuckets(numBuckets() * 2);
6201 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6202 nodeProctor.release();
6212#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 8
6213template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6214template <
class ARGS_01,
6223HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6224 bool *isInsertedFlag,
6239 if (d_size >= d_capacity) {
6240 this->rehashForNumBuckets(numBuckets() * 2);
6245 d_parameters.nodeFactory().emplaceIntoNewNode(
6256 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6257 nodeProctor(&d_parameters.nodeFactory(), newNode);
6260 size_t hashCode = this->d_parameters.hashCodeForKey(
6261 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6263 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6266 *isInsertedFlag = (!position);
6269 if (d_size >= d_capacity) {
6270 this->rehashForNumBuckets(numBuckets() * 2);
6273 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6274 nodeProctor.release();
6284#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 9
6285template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6286template <
class ARGS_01,
6296HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6297 bool *isInsertedFlag,
6313 if (d_size >= d_capacity) {
6314 this->rehashForNumBuckets(numBuckets() * 2);
6319 d_parameters.nodeFactory().emplaceIntoNewNode(
6331 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6332 nodeProctor(&d_parameters.nodeFactory(), newNode);
6335 size_t hashCode = this->d_parameters.hashCodeForKey(
6336 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6338 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6341 *isInsertedFlag = (!position);
6344 if (d_size >= d_capacity) {
6345 this->rehashForNumBuckets(numBuckets() * 2);
6348 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6349 nodeProctor.release();
6359#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_D >= 10
6360template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6361template <
class ARGS_01,
6372HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6373 bool *isInsertedFlag,
6390 if (d_size >= d_capacity) {
6391 this->rehashForNumBuckets(numBuckets() * 2);
6396 d_parameters.nodeFactory().emplaceIntoNewNode(
6409 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6410 nodeProctor(&d_parameters.nodeFactory(), newNode);
6413 size_t hashCode = this->d_parameters.hashCodeForKey(
6414 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6416 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6419 *isInsertedFlag = (!position);
6422 if (d_size >= d_capacity) {
6423 this->rehashForNumBuckets(numBuckets() * 2);
6426 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6427 nodeProctor.release();
6440template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6441template <
class... ARGS>
6443HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplace(
6449 if (d_size >= d_capacity) {
6450 this->rehashForNumBuckets(numBuckets() * 2);
6455 d_parameters.nodeFactory().emplaceIntoNewNode(
6459 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6460 nodeProctor(&d_parameters.nodeFactory(), newNode);
6463 size_t hashCode = this->d_parameters.hashCodeForKey(
6464 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6466 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6470 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6473 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, position);
6475 nodeProctor.release();
6482template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6483template <
class... ARGS>
6485HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceWithHint(
6492 if (d_size >= d_capacity) {
6493 this->rehashForNumBuckets(numBuckets() * 2);
6498 d_parameters.nodeFactory().emplaceIntoNewNode(
6502 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6503 nodeProctor(&d_parameters.nodeFactory(), newNode);
6506 size_t hashCode = this->d_parameters.hashCodeForKey(
6507 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6509 || !d_parameters.comparator()(ImpUtil::extractKey<KEY_CONFIG>(newNode),
6510 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
6511 hint = this->find(ImpUtil::extractKey<KEY_CONFIG>(newNode), hashCode);
6515 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6518 ImpUtil::insertAtPosition(&d_anchor, newNode, hashCode, hint);
6520 nodeProctor.release();
6527template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6528template <
class... ARGS>
6530HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::emplaceIfMissing(
6531 bool *isInsertedFlag,
6539 if (d_size >= d_capacity) {
6540 this->rehashForNumBuckets(numBuckets() * 2);
6545 d_parameters.nodeFactory().emplaceIntoNewNode(
6549 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6550 nodeProctor(&d_parameters.nodeFactory(), newNode);
6553 size_t hashCode = this->d_parameters.hashCodeForKey(
6554 ImpUtil::extractKey<KEY_CONFIG>(newNode));
6556 ImpUtil::extractKey<KEY_CONFIG>(newNode),
6559 *isInsertedFlag = (!position);
6562 if (d_size >= d_capacity) {
6563 this->rehashForNumBuckets(numBuckets() * 2);
6566 ImpUtil::insertAtFrontOfBucket(&d_anchor, newNode, hashCode);
6567 nodeProctor.release();
6578template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6580HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertIfMissing(
6587template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6589HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertIfMissing(
6593 return tryEmplace(&dummy,
6595 MoveUtil::move(key));
6598template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6600HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertIfMissing(
6601 bool *isInsertedFlag,
6602 const ValueType& value)
6606 size_t hashCode = this->d_parameters.hashCodeForKey(
6607 KEY_CONFIG::extractKey(value));
6609 KEY_CONFIG::extractKey(value),
6612 *isInsertedFlag = (!position);
6615 if (d_size >= d_capacity) {
6616 this->rehashForNumBuckets(numBuckets() * 2);
6619 position = d_parameters.nodeFactory().emplaceIntoNewNode(value);
6629template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6631HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertIfMissing(
6632 bool *isInsertedFlag,
6635 ValueType& lvalue = value;
6639 size_t hashCode = this->d_parameters.hashCodeForKey(
6640 KEY_CONFIG::extractKey(lvalue));
6642 KEY_CONFIG::extractKey(lvalue),
6645 *isInsertedFlag = (!position);
6648 if (d_size >= d_capacity) {
6649 this->rehashForNumBuckets(numBuckets() * 2);
6652 position = d_parameters.nodeFactory().emplaceIntoNewNode(
6653 MoveUtil::move(lvalue));
6663template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6664template <
class SOURCE_TYPE>
6667HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertIfMissing(
6668 bool *isInsertedFlag,
6673 return emplaceIfMissing(isInsertedFlag,
6678template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6679template <
class SOURCE_TYPE>
6682HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insert(
6688template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6689template <
class SOURCE_TYPE>
6692HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insert(
6696 return emplaceWithHint(hint,
6703template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6704template <
class KEY_ARG,
class BDE_OTHER_TYPE>
6706HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::insertOrAssign(
6707 bool *isInsertedFlag,
6714 const KEY_ARG& lvalue = key;
6715 size_t hashCode = this->d_parameters.hashCodeForKey(lvalue);
6717 || !d_parameters.comparator()(lvalue,
6718 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
6719 hint = this->find(lvalue, hashCode);
6723 static_cast<NodeType *
>(hint)->value().second =
6725 *isInsertedFlag =
false;
6729 if (d_size >= d_capacity) {
6730 this->rehashForNumBuckets(numBuckets() * 2);
6733 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
6737 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6738 nodeProctor(&d_parameters.nodeFactory(), hint);
6739 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
6740 nodeProctor.release();
6743 *isInsertedFlag =
true;
6748template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6750HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::rehashForNumBuckets(
6751 SizeType newNumBuckets)
6753 if (newNumBuckets > this->numBuckets()) {
6758 SizeType numBuckets =
static_cast<SizeType
>(
6759 HashTable_ImpDetails::growBucketsForLoadFactor(
6762 static_cast<size_t>(newNumBuckets),
6765 this->rehashIntoExactlyNumBuckets(numBuckets,
6766 static_cast<SizeType
>(capacity));
6770template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6772HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::remove(
6783 hashCodeForNode(node));
6786 d_parameters.nodeFactory().deleteNode(
static_cast<NodeType *
>(node));
6791template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6793HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::removeAll()
6795 this->removeAllImp();
6796 if (HashTable_ImpDetails::defaultBucketAddress() !=
6808template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6811HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::reserveForNumElements(
6812 SizeType numElements)
6814 if (numElements < 1) {
6818 if (numElements > d_capacity) {
6823 SizeType numBuckets =
static_cast<SizeType
>(
6824 HashTable_ImpDetails::growBucketsForLoadFactor(
6827 static_cast<size_t>(this->numBuckets()),
6830 this->rehashIntoExactlyNumBuckets(numBuckets,
6831 static_cast<SizeType
>(capacity));
6835template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6837void HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::setMaxLoadFactor(
6838 float newMaxLoadFactor)
6843 SizeType numBuckets =
static_cast<SizeType
>(
6844 HashTable_ImpDetails::growBucketsForLoadFactor(
6846 std::max<SizeType>(d_size, 1u),
6847 static_cast<size_t>(this->numBuckets()),
6850 this->rehashIntoExactlyNumBuckets(numBuckets,
6851 static_cast<SizeType
>(capacity));
6855 d_maxLoadFactor = newMaxLoadFactor;
6858template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6860HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::swap(HashTable& other)
6864 if (AllocatorTraits::propagate_on_container_swap::value) {
6865 quickSwapExchangeAllocators(&other);
6871 BSLS_ASSERT(d_parameters.nodeFactory().allocator() ==
6872 other.d_parameters.nodeFactory().allocator());
6873 quickSwapRetainAllocators(&other);
6877#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6880#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT
6881#define BSLSTL_HASHTABLE_VARIADIC_LIMIT 10
6883#ifndef BSLSTL_HASHTABLE_VARIADIC_LIMIT_F
6884#define BSLSTL_HASHTABLE_VARIADIC_LIMIT_F BSLSTL_HASHTABLE_VARIADIC_LIMIT
6886#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 0
6887template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6890HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
6891 bool *isInsertedFlag,
6897 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
6900 || !d_parameters.comparator()(key,
6901 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
6902 hint = this->find(key, hashCode);
6906 *isInsertedFlag =
false;
6910 if (d_size >= d_capacity) {
6911 this->rehashForNumBuckets(numBuckets() * 2);
6914#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6915 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
6916 std::piecewise_construct,
6917 std::forward_as_tuple(key),
6918 std::forward_as_tuple());
6920 typedef typename ValueType::second_type MappedType;
6923 AllocatorType alloc = this->allocator();
6926 AllocatorTraits::construct(alloc, defaultMapped.
address());
6929 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
6934 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6935 nodeProctor(&d_parameters.nodeFactory(), hint);
6936 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
6937 nodeProctor.release();
6940 *isInsertedFlag =
true;
6945#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 1
6946template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
6947template <
class ARGS_01>
6950HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
6951 bool *isInsertedFlag,
6958 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
6961 || !d_parameters.comparator()(key,
6962 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
6963 hint = this->find(key, hashCode);
6967 *isInsertedFlag =
false;
6971 if (d_size >= d_capacity) {
6972 this->rehashForNumBuckets(numBuckets() * 2);
6975#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6976 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
6977 std::piecewise_construct,
6978 std::forward_as_tuple(key),
6979 std::forward_as_tuple(
6982 typedef typename ValueType::second_type MappedType;
6985 AllocatorType alloc = this->allocator();
6988 AllocatorTraits::construct(alloc, defaultMapped.
address(),
6993 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
6998 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
6999 nodeProctor(&d_parameters.nodeFactory(), hint);
7000 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7001 nodeProctor.release();
7004 *isInsertedFlag =
true;
7009#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 2
7010template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7011template <
class ARGS_01,
7015HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7016 bool *isInsertedFlag,
7024 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7027 || !d_parameters.comparator()(key,
7028 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7029 hint = this->find(key, hashCode);
7033 *isInsertedFlag =
false;
7037 if (d_size >= d_capacity) {
7038 this->rehashForNumBuckets(numBuckets() * 2);
7041#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7042 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7043 std::piecewise_construct,
7044 std::forward_as_tuple(key),
7045 std::forward_as_tuple(
7049 typedef typename ValueType::second_type MappedType;
7052 AllocatorType alloc = this->allocator();
7055 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7062 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7067 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7068 nodeProctor(&d_parameters.nodeFactory(), hint);
7069 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7070 nodeProctor.release();
7073 *isInsertedFlag =
true;
7078#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 3
7079template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7080template <
class ARGS_01,
7085HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7086 bool *isInsertedFlag,
7095 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7098 || !d_parameters.comparator()(key,
7099 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7100 hint = this->find(key, hashCode);
7104 *isInsertedFlag =
false;
7108 if (d_size >= d_capacity) {
7109 this->rehashForNumBuckets(numBuckets() * 2);
7112#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7113 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7114 std::piecewise_construct,
7115 std::forward_as_tuple(key),
7116 std::forward_as_tuple(
7121 typedef typename ValueType::second_type MappedType;
7124 AllocatorType alloc = this->allocator();
7127 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7136 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7141 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7142 nodeProctor(&d_parameters.nodeFactory(), hint);
7143 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7144 nodeProctor.release();
7147 *isInsertedFlag =
true;
7152#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 4
7153template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7154template <
class ARGS_01,
7160HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7161 bool *isInsertedFlag,
7171 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7174 || !d_parameters.comparator()(key,
7175 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7176 hint = this->find(key, hashCode);
7180 *isInsertedFlag =
false;
7184 if (d_size >= d_capacity) {
7185 this->rehashForNumBuckets(numBuckets() * 2);
7188#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7189 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7190 std::piecewise_construct,
7191 std::forward_as_tuple(key),
7192 std::forward_as_tuple(
7198 typedef typename ValueType::second_type MappedType;
7201 AllocatorType alloc = this->allocator();
7204 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7215 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7220 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7221 nodeProctor(&d_parameters.nodeFactory(), hint);
7222 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7223 nodeProctor.release();
7226 *isInsertedFlag =
true;
7231#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 5
7232template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7233template <
class ARGS_01,
7240HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7241 bool *isInsertedFlag,
7252 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7255 || !d_parameters.comparator()(key,
7256 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7257 hint = this->find(key, hashCode);
7261 *isInsertedFlag =
false;
7265 if (d_size >= d_capacity) {
7266 this->rehashForNumBuckets(numBuckets() * 2);
7269#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7270 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7271 std::piecewise_construct,
7272 std::forward_as_tuple(key),
7273 std::forward_as_tuple(
7280 typedef typename ValueType::second_type MappedType;
7283 AllocatorType alloc = this->allocator();
7286 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7299 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7304 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7305 nodeProctor(&d_parameters.nodeFactory(), hint);
7306 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7307 nodeProctor.release();
7310 *isInsertedFlag =
true;
7315#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 6
7316template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7317template <
class ARGS_01,
7325HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7326 bool *isInsertedFlag,
7338 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7341 || !d_parameters.comparator()(key,
7342 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7343 hint = this->find(key, hashCode);
7347 *isInsertedFlag =
false;
7351 if (d_size >= d_capacity) {
7352 this->rehashForNumBuckets(numBuckets() * 2);
7355#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7356 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7357 std::piecewise_construct,
7358 std::forward_as_tuple(key),
7359 std::forward_as_tuple(
7367 typedef typename ValueType::second_type MappedType;
7370 AllocatorType alloc = this->allocator();
7373 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7388 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7393 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7394 nodeProctor(&d_parameters.nodeFactory(), hint);
7395 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7396 nodeProctor.release();
7399 *isInsertedFlag =
true;
7404#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 7
7405template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7406template <
class ARGS_01,
7415HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7416 bool *isInsertedFlag,
7429 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7432 || !d_parameters.comparator()(key,
7433 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7434 hint = this->find(key, hashCode);
7438 *isInsertedFlag =
false;
7442 if (d_size >= d_capacity) {
7443 this->rehashForNumBuckets(numBuckets() * 2);
7446#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7447 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7448 std::piecewise_construct,
7449 std::forward_as_tuple(key),
7450 std::forward_as_tuple(
7459 typedef typename ValueType::second_type MappedType;
7462 AllocatorType alloc = this->allocator();
7465 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7482 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7487 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7488 nodeProctor(&d_parameters.nodeFactory(), hint);
7489 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7490 nodeProctor.release();
7493 *isInsertedFlag =
true;
7498#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 8
7499template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7500template <
class ARGS_01,
7510HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7511 bool *isInsertedFlag,
7525 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7528 || !d_parameters.comparator()(key,
7529 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7530 hint = this->find(key, hashCode);
7534 *isInsertedFlag =
false;
7538 if (d_size >= d_capacity) {
7539 this->rehashForNumBuckets(numBuckets() * 2);
7542#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7543 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7544 std::piecewise_construct,
7545 std::forward_as_tuple(key),
7546 std::forward_as_tuple(
7556 typedef typename ValueType::second_type MappedType;
7559 AllocatorType alloc = this->allocator();
7562 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7581 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7586 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7587 nodeProctor(&d_parameters.nodeFactory(), hint);
7588 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7589 nodeProctor.release();
7592 *isInsertedFlag =
true;
7597#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 9
7598template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7599template <
class ARGS_01,
7610HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7611 bool *isInsertedFlag,
7626 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7629 || !d_parameters.comparator()(key,
7630 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7631 hint = this->find(key, hashCode);
7635 *isInsertedFlag =
false;
7639 if (d_size >= d_capacity) {
7640 this->rehashForNumBuckets(numBuckets() * 2);
7643#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7644 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7645 std::piecewise_construct,
7646 std::forward_as_tuple(key),
7647 std::forward_as_tuple(
7658 typedef typename ValueType::second_type MappedType;
7661 AllocatorType alloc = this->allocator();
7664 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7685 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7690 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7691 nodeProctor(&d_parameters.nodeFactory(), hint);
7692 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7693 nodeProctor.release();
7696 *isInsertedFlag =
true;
7701#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 10
7702template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7703template <
class ARGS_01,
7715HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7716 bool *isInsertedFlag,
7732 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7735 || !d_parameters.comparator()(key,
7736 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7737 hint = this->find(key, hashCode);
7741 *isInsertedFlag =
false;
7745 if (d_size >= d_capacity) {
7746 this->rehashForNumBuckets(numBuckets() * 2);
7749#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7750 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7751 std::piecewise_construct,
7752 std::forward_as_tuple(key),
7753 std::forward_as_tuple(
7765 typedef typename ValueType::second_type MappedType;
7768 AllocatorType alloc = this->allocator();
7771 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7794 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7799 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7800 nodeProctor(&d_parameters.nodeFactory(), hint);
7801 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7802 nodeProctor.release();
7805 *isInsertedFlag =
true;
7812#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 0
7813template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7816HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7817 bool *isInsertedFlag,
7823 const KeyType& lvalue = key;
7824 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7827 || !d_parameters.comparator()(lvalue,
7828 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7829 hint = this->find(lvalue, hashCode);
7833 *isInsertedFlag =
false;
7837 if (d_size >= d_capacity) {
7838 this->rehashForNumBuckets(numBuckets() * 2);
7841#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7842 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7843 std::piecewise_construct,
7844 std::forward_as_tuple(MoveUtil::move(key)),
7845 std::forward_as_tuple(
7848 typedef typename ValueType::second_type MappedType;
7851 AllocatorType alloc = this->allocator();
7854 AllocatorTraits::construct(alloc, defaultMapped.
address());
7857 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7858 MoveUtil::move(key),
7862 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7863 nodeProctor(&d_parameters.nodeFactory(), hint);
7864 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7865 nodeProctor.release();
7868 *isInsertedFlag =
true;
7873#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 1
7874template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7875template <
class ARGS_01>
7878HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7879 bool *isInsertedFlag,
7886 const KeyType& lvalue = key;
7887 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7890 || !d_parameters.comparator()(lvalue,
7891 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7892 hint = this->find(lvalue, hashCode);
7896 *isInsertedFlag =
false;
7900 if (d_size >= d_capacity) {
7901 this->rehashForNumBuckets(numBuckets() * 2);
7904#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7905 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7906 std::piecewise_construct,
7907 std::forward_as_tuple(MoveUtil::move(key)),
7908 std::forward_as_tuple(
7912 typedef typename ValueType::second_type MappedType;
7915 AllocatorType alloc = this->allocator();
7918 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7923 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7924 MoveUtil::move(key),
7928 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
7929 nodeProctor(&d_parameters.nodeFactory(), hint);
7930 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
7931 nodeProctor.release();
7934 *isInsertedFlag =
true;
7939#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 2
7940template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
7941template <
class ARGS_01,
7945HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
7946 bool *isInsertedFlag,
7954 const KeyType& lvalue = key;
7955 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
7958 || !d_parameters.comparator()(lvalue,
7959 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
7960 hint = this->find(lvalue, hashCode);
7964 *isInsertedFlag =
false;
7968 if (d_size >= d_capacity) {
7969 this->rehashForNumBuckets(numBuckets() * 2);
7972#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7973 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7974 std::piecewise_construct,
7975 std::forward_as_tuple(MoveUtil::move(key)),
7976 std::forward_as_tuple(
7982 typedef typename ValueType::second_type MappedType;
7985 AllocatorType alloc = this->allocator();
7988 AllocatorTraits::construct(alloc, defaultMapped.
address(),
7995 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
7996 MoveUtil::move(key),
8000 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8001 nodeProctor(&d_parameters.nodeFactory(), hint);
8002 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8003 nodeProctor.release();
8006 *isInsertedFlag =
true;
8011#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 3
8012template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8013template <
class ARGS_01,
8018HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8019 bool *isInsertedFlag,
8028 const KeyType& lvalue = key;
8029 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8032 || !d_parameters.comparator()(lvalue,
8033 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8034 hint = this->find(lvalue, hashCode);
8038 *isInsertedFlag =
false;
8042 if (d_size >= d_capacity) {
8043 this->rehashForNumBuckets(numBuckets() * 2);
8046#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8047 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8048 std::piecewise_construct,
8049 std::forward_as_tuple(MoveUtil::move(key)),
8050 std::forward_as_tuple(
8058 typedef typename ValueType::second_type MappedType;
8061 AllocatorType alloc = this->allocator();
8064 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8073 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8074 MoveUtil::move(key),
8078 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8079 nodeProctor(&d_parameters.nodeFactory(), hint);
8080 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8081 nodeProctor.release();
8084 *isInsertedFlag =
true;
8089#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 4
8090template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8091template <
class ARGS_01,
8097HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8098 bool *isInsertedFlag,
8108 const KeyType& lvalue = key;
8109 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8112 || !d_parameters.comparator()(lvalue,
8113 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8114 hint = this->find(lvalue, hashCode);
8118 *isInsertedFlag =
false;
8122 if (d_size >= d_capacity) {
8123 this->rehashForNumBuckets(numBuckets() * 2);
8126#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8127 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8128 std::piecewise_construct,
8129 std::forward_as_tuple(MoveUtil::move(key)),
8130 std::forward_as_tuple(
8140 typedef typename ValueType::second_type MappedType;
8143 AllocatorType alloc = this->allocator();
8146 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8157 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8158 MoveUtil::move(key),
8162 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8163 nodeProctor(&d_parameters.nodeFactory(), hint);
8164 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8165 nodeProctor.release();
8168 *isInsertedFlag =
true;
8173#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 5
8174template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8175template <
class ARGS_01,
8182HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8183 bool *isInsertedFlag,
8194 const KeyType& lvalue = key;
8195 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8198 || !d_parameters.comparator()(lvalue,
8199 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8200 hint = this->find(lvalue, hashCode);
8204 *isInsertedFlag =
false;
8208 if (d_size >= d_capacity) {
8209 this->rehashForNumBuckets(numBuckets() * 2);
8212#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8213 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8214 std::piecewise_construct,
8215 std::forward_as_tuple(MoveUtil::move(key)),
8216 std::forward_as_tuple(
8228 typedef typename ValueType::second_type MappedType;
8231 AllocatorType alloc = this->allocator();
8234 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8247 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8248 MoveUtil::move(key),
8252 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8253 nodeProctor(&d_parameters.nodeFactory(), hint);
8254 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8255 nodeProctor.release();
8258 *isInsertedFlag =
true;
8263#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 6
8264template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8265template <
class ARGS_01,
8273HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8274 bool *isInsertedFlag,
8286 const KeyType& lvalue = key;
8287 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8290 || !d_parameters.comparator()(lvalue,
8291 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8292 hint = this->find(lvalue, hashCode);
8296 *isInsertedFlag =
false;
8300 if (d_size >= d_capacity) {
8301 this->rehashForNumBuckets(numBuckets() * 2);
8304#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8305 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8306 std::piecewise_construct,
8307 std::forward_as_tuple(MoveUtil::move(key)),
8308 std::forward_as_tuple(
8322 typedef typename ValueType::second_type MappedType;
8325 AllocatorType alloc = this->allocator();
8328 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8343 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8344 MoveUtil::move(key),
8348 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8349 nodeProctor(&d_parameters.nodeFactory(), hint);
8350 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8351 nodeProctor.release();
8354 *isInsertedFlag =
true;
8359#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 7
8360template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8361template <
class ARGS_01,
8370HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8371 bool *isInsertedFlag,
8384 const KeyType& lvalue = key;
8385 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8388 || !d_parameters.comparator()(lvalue,
8389 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8390 hint = this->find(lvalue, hashCode);
8394 *isInsertedFlag =
false;
8398 if (d_size >= d_capacity) {
8399 this->rehashForNumBuckets(numBuckets() * 2);
8402#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8403 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8404 std::piecewise_construct,
8405 std::forward_as_tuple(MoveUtil::move(key)),
8406 std::forward_as_tuple(
8422 typedef typename ValueType::second_type MappedType;
8425 AllocatorType alloc = this->allocator();
8428 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8445 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8446 MoveUtil::move(key),
8450 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8451 nodeProctor(&d_parameters.nodeFactory(), hint);
8452 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8453 nodeProctor.release();
8456 *isInsertedFlag =
true;
8461#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 8
8462template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8463template <
class ARGS_01,
8473HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8474 bool *isInsertedFlag,
8488 const KeyType& lvalue = key;
8489 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8492 || !d_parameters.comparator()(lvalue,
8493 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8494 hint = this->find(lvalue, hashCode);
8498 *isInsertedFlag =
false;
8502 if (d_size >= d_capacity) {
8503 this->rehashForNumBuckets(numBuckets() * 2);
8506#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8507 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8508 std::piecewise_construct,
8509 std::forward_as_tuple(MoveUtil::move(key)),
8510 std::forward_as_tuple(
8528 typedef typename ValueType::second_type MappedType;
8531 AllocatorType alloc = this->allocator();
8534 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8553 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8554 MoveUtil::move(key),
8558 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8559 nodeProctor(&d_parameters.nodeFactory(), hint);
8560 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8561 nodeProctor.release();
8564 *isInsertedFlag =
true;
8569#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 9
8570template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8571template <
class ARGS_01,
8582HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8583 bool *isInsertedFlag,
8598 const KeyType& lvalue = key;
8599 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8602 || !d_parameters.comparator()(lvalue,
8603 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8604 hint = this->find(lvalue, hashCode);
8608 *isInsertedFlag =
false;
8612 if (d_size >= d_capacity) {
8613 this->rehashForNumBuckets(numBuckets() * 2);
8616#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8617 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8618 std::piecewise_construct,
8619 std::forward_as_tuple(MoveUtil::move(key)),
8620 std::forward_as_tuple(
8640 typedef typename ValueType::second_type MappedType;
8643 AllocatorType alloc = this->allocator();
8646 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8667 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8668 MoveUtil::move(key),
8672 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8673 nodeProctor(&d_parameters.nodeFactory(), hint);
8674 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8675 nodeProctor.release();
8678 *isInsertedFlag =
true;
8683#if BSLSTL_HASHTABLE_VARIADIC_LIMIT_F >= 10
8684template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8685template <
class ARGS_01,
8697HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8698 bool *isInsertedFlag,
8714 const KeyType& lvalue = key;
8715 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8718 || !d_parameters.comparator()(lvalue,
8719 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8720 hint = this->find(lvalue, hashCode);
8724 *isInsertedFlag =
false;
8728 if (d_size >= d_capacity) {
8729 this->rehashForNumBuckets(numBuckets() * 2);
8732#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8733 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8734 std::piecewise_construct,
8735 std::forward_as_tuple(MoveUtil::move(key)),
8736 std::forward_as_tuple(
8758 typedef typename ValueType::second_type MappedType;
8761 AllocatorType alloc = this->allocator();
8764 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8787 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8788 MoveUtil::move(key),
8792 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8793 nodeProctor(&d_parameters.nodeFactory(), hint);
8794 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8795 nodeProctor.release();
8798 *isInsertedFlag =
true;
8806template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8807template <
class... ARGS>
8810HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8811 bool *isInsertedFlag,
8818 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8821 || !d_parameters.comparator()(key,
8822 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8823 hint = this->find(key, hashCode);
8827 *isInsertedFlag =
false;
8831 if (d_size >= d_capacity) {
8832 this->rehashForNumBuckets(numBuckets() * 2);
8835#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8836 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8837 std::piecewise_construct,
8838 std::forward_as_tuple(key),
8841 typedef typename ValueType::second_type MappedType;
8844 AllocatorType alloc = this->allocator();
8847 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8852 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8857 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8858 nodeProctor(&d_parameters.nodeFactory(), hint);
8859 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8860 nodeProctor.release();
8863 *isInsertedFlag =
true;
8868template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8869template <
class... ARGS>
8872HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::tryEmplace(
8873 bool *isInsertedFlag,
8880 const KeyType& lvalue = key;
8881 const size_t hashCode = this->d_parameters.hashCodeForKey(key);
8884 || !d_parameters.comparator()(lvalue,
8885 ImpUtil::extractKey<KEY_CONFIG>(hint))) {
8886 hint = this->find(lvalue, hashCode);
8890 *isInsertedFlag =
false;
8894 if (d_size >= d_capacity) {
8895 this->rehashForNumBuckets(numBuckets() * 2);
8898#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8899 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8900 std::piecewise_construct,
8901 std::forward_as_tuple(MoveUtil::move(key)),
8902 std::forward_as_tuple(
8906 typedef typename ValueType::second_type MappedType;
8909 AllocatorType alloc = this->allocator();
8912 AllocatorTraits::construct(alloc, defaultMapped.
address(),
8917 hint = d_parameters.nodeFactory().emplaceIntoNewNode(
8918 MoveUtil::move(key),
8922 HashTable_NodeProctor<typename ImplParameters::NodeFactory>
8923 nodeProctor(&d_parameters.nodeFactory(), hint);
8924 ImpUtil::insertAtFrontOfBucket(&d_anchor, hint, hashCode);
8925 nodeProctor.release();
8928 *isInsertedFlag =
true;
8935template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8937ALLOCATOR HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::
8940 return d_parameters.nodeFactory().allocator();
8943template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8946HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::bucketAtIndex(
8947 SizeType index)
const
8954template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8956typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
8957HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::bucketIndexForKey(
8958 const KeyType& key)
const
8961 HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType SizeType;
8970 size_t hashCode = this->d_parameters.hashCodeForKey(key);
8976template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8979HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::comparator()
const
8981 return d_parameters.originalComparator();
8984template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8986typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
8987HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::countElementsInBucket(
8988 SizeType index)
const
8992 return static_cast<SizeType
>(bucketAtIndex(index).countElements());
8995template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
8998HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::elementListRoot()
const
9003template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9006HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::find(
9007 const KeyType& key)
const
9009 return bslalg::HashTableImpUtil::find<KEY_CONFIG>(
9012 d_parameters.comparator(),
9013 d_parameters.hashCodeForKey(key));
9016template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9018HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::findEndOfRange(
9032 KeyRef k = ImpUtil::extractKey<KEY_CONFIG>(first);
9034 while (0 != (first = first->
nextLink()) &&
9035 d_parameters.comparator()(k,ImpUtil::extractKey<KEY_CONFIG>(first)))
9042template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9045HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::findRange(
9048 const KeyType& key)
const
9053 *first = this->find(key);
9054 *last = *first ? this->findEndOfRange(*first) : 0;
9057template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9059HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::hasSameValue(
9060 const HashTable& other)
const
9074 typedef typename KEY_CONFIG::ValueType ValueType;
9075 typedef typename ::bsl::allocator_traits<ALLOCATOR>::size_type SizeType;
9080 if (this->
size() != other.size()) {
9090 ImpUtil::find<KEY_CONFIG>(other.d_anchor,
9091 ImpUtil::extractKey<KEY_CONFIG>(cursor),
9092 other.d_parameters.comparator(),
9093 other.d_parameters.hashCodeForKey(
9094 ImpUtil::extractKey<KEY_CONFIG>(cursor)));
9107 while (endWalker != endRange) {
9109 if (rhsWalker == rhsLast) {
9116 if (rhsWalker != rhsLast) {
9125 while (cursor != endRange &&
9126 (ImpUtil::extractValue<KEY_CONFIG>(cursor) ==
9127 ImpUtil::extractValue<KEY_CONFIG>(rhsFirst)))
9133 if (cursor == endRange) {
9154 const ValueType& valueAtMarker =
9155 ImpUtil::extractValue<KEY_CONFIG>(marker);
9157 if (cursor != marker) {
9161 while (scanner != marker &&
9162 ImpUtil::extractValue<KEY_CONFIG>(scanner) != valueAtMarker) {
9165 if (scanner != marker) {
9170 SizeType matches = 0;
9174 if (ImpUtil::extractValue<KEY_CONFIG>(scanner) ==
9186 scanner != endRange;
9189 if (ImpUtil::extractValue<KEY_CONFIG>(scanner) ==
9205template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9208HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::hasher()
const
9210 return d_parameters.originalHasher();
9213template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9215float HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::loadFactor()
const
9217 return static_cast<float>(
static_cast<double>(this->
size())
9218 /
static_cast<double>(this->numBuckets()));
9221template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9224HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::maxLoadFactor()
const
9226 return d_maxLoadFactor;
9229template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9231typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
9232HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::maxNumBuckets()
const
9239 typedef typename AllocatorTraits::
9240 template rebind_traits<bslalg::HashTableBucket>
9241 BucketAllocatorTraits;
9242 typedef typename BucketAllocatorTraits::allocator_type BucketAllocator;
9244 return BucketAllocatorTraits::max_size(BucketAllocator(this->allocator()));
9247template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9249typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
9250HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::maxSize()
const
9252 return AllocatorTraits::max_size(this->allocator()) /
sizeof(NodeType);
9255template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9257typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
9258HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::numBuckets()
const
9263template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9265typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
9266HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::rehashThreshold()
const
9271template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9273typename HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::SizeType
9274HashTable<KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR>::size()
const
9285template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9310template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9319template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9328template <
class FUNCTOR>
9336template <
class FUNCTOR>
9356template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9357struct UsesBslmaAllocator<
bslstl::HashTable<KEY_CONFIG,
9364template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9365struct UsesBslmaAllocator<
bslstl::HashTable_ImplParameters<KEY_CONFIG,
9376template <
class KEY_CONFIG,
class HASHER,
class COMPARATOR,
class ALLOCATOR>
9377struct IsBitwiseMoveable<
bslstl::HashTable<KEY_CONFIG,
9382 && bslmf::IsBitwiseMoveable<COMPARATOR>::value
9383 && bslmf::IsBitwiseMoveable<ALLOCATOR>::value>
9390# error Not valid except when included from bslstl_hashtable.h
Definition bslma_bslallocator.h:580
Definition bslalg_bidirectionallink.h:346
BidirectionalLink * nextLink() const
Return the address of the next node linked from this node.
Definition bslalg_bidirectionallink.h:421
BidirectionalLink * previousLink() const
Return the address of the preceding node linked from this node.
Definition bslalg_bidirectionallink.h:427
Definition bslalg_bidirectionalnode.h:357
Definition bslalg_functoradapter.h:228
HashTable_HashWrapper< CallableVariable< HASHER >::type > Type
This typedef is an alias for the functor.
Definition bslalg_functoradapter.h:234
Definition bslalg_hashtableanchor.h:541
BidirectionalLink * listRootAddress() const
Return the value listRootAddress attribute of this object.
Definition bslalg_hashtableanchor.h:708
void setBucketArrayAddressAndSize(HashTableBucket *bucketArrayAddress, std::size_t bucketArraySize)
Definition bslalg_hashtableanchor.h:679
std::size_t bucketArraySize() const
Return the value of the bucketArraySize attribute of this object.
Definition bslalg_hashtableanchor.h:714
void swap(HashTableAnchor &other)
Definition bslalg_hashtableanchor.h:701
void setListRootAddress(BidirectionalLink *value)
Definition bslalg_hashtableanchor.h:691
HashTableBucket * bucketArrayAddress() const
Definition bslalg_hashtableanchor.h:720
Definition bslma_allocator.h:457
Definition bslma_destructorguard.h:132
Definition bslmf_movableref.h:751
~HashTable_ArrayProctor()
Definition bslstl_hashtable.h:3417
void release()
Definition bslstl_hashtable.h:3436
Definition bslstl_hashtable.h:1749
void swap(HashTable_ComparatorWrapper &other)
Exchange the value of this object with the specified other object.
Definition bslstl_hashtable.h:3299
const FUNCTOR & functor() const
Definition bslstl_hashtable.h:3291
HashTable_ComparatorWrapper()
Definition bslstl_hashtable.h:3267
bool operator()(ARG1_TYPE &arg1, ARG2_TYPE &arg2) const
Definition bslstl_hashtable.h:3284
Definition bslstl_hashtable.h:1624
const FUNCTOR & functor() const
Definition bslstl_hashtable.h:3191
HashTable_HashWrapper()
Definition bslstl_hashtable.h:3168
std::size_t operator()(ARG_TYPE &arg) const
Definition bslstl_hashtable.h:3184
void swap(HashTable_HashWrapper &other)
Exchange the value of this object with the specified other object.
Definition bslstl_hashtable.h:3198
std::size_t hashCodeForKey(DEDUCED_KEY &key) const
Definition bslstl_hashtable.h:3632
HashTable< KEY_CONFIG, HASHER, COMPARATOR, ALLOCATOR > HashTableType
Definition bslstl_hashtable.h:3059
NodeFactory & nodeFactory()
Definition bslstl_hashtable.h:3575
void quickSwapRetainAllocators(HashTable_ImplParameters *other)
Definition bslstl_hashtable.h:3599
const BaseComparator & comparator() const
Definition bslstl_hashtable.h:3620
BidirectionalNodePool< typename HashTableType::ValueType, NodeAllocator > NodeFactory
Definition bslstl_hashtable.h:3066
const BaseHasher & hasher() const
Definition bslstl_hashtable.h:3643
void quickSwapExchangeAllocators(HashTable_ImplParameters *other)
Definition bslstl_hashtable.h:3583
ReboundTraits::allocator_type NodeAllocator
Definition bslstl_hashtable.h:3062
HashTableType::AllocatorTraits::template rebind_traits< NodeType > ReboundTraits
Definition bslstl_hashtable.h:3061
const HASHER & originalHasher() const
Definition bslstl_hashtable.h:3677
const COMPARATOR & originalComparator() const
Definition bslstl_hashtable.h:3667
~HashTable_NodeProctor()
Definition bslstl_hashtable.h:3383
void release()
Definition bslstl_hashtable.h:3393
Definition bslstl_hashtable.h:1914
bslalg::BidirectionalLink * insertOrAssign(bool *isInsertedFlag, bslalg::BidirectionalLink *hint, BSLS_COMPILERFEATURES_FORWARD_REF(KEY_ARG) key, BDE_OTHER_TYPE &&obj)
Definition bslstl_hashtable.h:4497
bslalg::BidirectionalNode< ValueType > NodeType
Definition bslstl_hashtable.h:1922
HashTable & operator=(const HashTable &rhs)
Definition bslstl_hashtable.h:4172
KEY_CONFIG::KeyType KeyType
Definition bslstl_hashtable.h:1920
void rehashForNumBuckets(SizeType newNumBuckets)
Definition bslstl_hashtable.h:4545
ALLOCATOR AllocatorType
Definition bslstl_hashtable.h:1918
void setMaxLoadFactor(float newMaxLoadFactor)
Definition bslstl_hashtable.h:4632
void swap(HashTable &other)
Definition bslstl_hashtable.h:4655
ALLOCATOR allocator() const
Definition bslstl_hashtable.h:4812
SizeType countElementsInBucket(SizeType index) const
Definition bslstl_hashtable.h:4861
bslalg::BidirectionalLink * tryEmplace(bool *isInsertedFlag, bslalg::BidirectionalLink *hint, const KeyType &key, ARGS &&... args)
Definition bslstl_hashtable.h:4677
SizeType rehashThreshold() const
Definition bslstl_hashtable.h:5140
bslalg::BidirectionalLink * emplaceIfMissing(bool *isInsertedFlag, Args &&... arguments)
::bsl::allocator_traits< AllocatorType > AllocatorTraits
Definition bslstl_hashtable.h:1919
bool hasSameValue(const HashTable &other) const
Definition bslstl_hashtable.h:4933
const COMPARATOR & comparator() const
Definition bslstl_hashtable.h:4853
float maxLoadFactor() const
Definition bslstl_hashtable.h:5098
bslalg::BidirectionalLink * emplace(Args &&... arguments)
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASHER, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, void >::type findRange(bslalg::BidirectionalLink **first, bslalg::BidirectionalLink **last, const LOOKUP_KEY &key) const
Definition bslstl_hashtable.h:2688
bslalg::BidirectionalLink * insert(BSLS_COMPILERFEATURES_FORWARD_REF(SOURCE_TYPE) value)
Definition bslstl_hashtable.h:4475
const HASHER & hasher() const
Definition bslstl_hashtable.h:5082
bslalg::BidirectionalLink * findEndOfRange(bslalg::BidirectionalLink *first) const
Definition bslstl_hashtable.h:4892
bslalg::BidirectionalLink * emplaceWithHint(bslalg::BidirectionalLink *hint, Args &&... arguments)
AllocatorTraits::size_type SizeType
Definition bslstl_hashtable.h:1923
void reserveForNumElements(SizeType numElements)
Definition bslstl_hashtable.h:4606
SizeType maxSize() const
Definition bslstl_hashtable.h:5124
bslalg::BidirectionalLink * remove(bslalg::BidirectionalLink *node)
Definition bslstl_hashtable.h:4567
SizeType numBuckets() const
Return the number of buckets contained in this hash table.
Definition bslstl_hashtable.h:5132
SizeType maxNumBuckets() const
Definition bslstl_hashtable.h:5106
bsl::remove_const< KeyType >::type NonConstKeyType
Definition bslstl_hashtable.h:1924
HashTable(const ALLOCATOR &basicAllocator=ALLOCATOR())
Definition bslstl_hashtable.h:3690
bslalg::BidirectionalLink * insertIfMissing(const KeyType &key)
Definition bslstl_hashtable.h:4373
~HashTable()
Destroy this object.
Definition bslstl_hashtable.h:3839
SizeType bucketIndexForKey(const KeyType &key) const
Definition bslstl_hashtable.h:4831
bslalg::BidirectionalLink * elementListRoot() const
Definition bslstl_hashtable.h:4872
SizeType size() const
Return the number of elements in this hash table.
Definition bslstl_hashtable.h:5148
KEY_CONFIG::ValueType ValueType
Definition bslstl_hashtable.h:1921
float loadFactor() const
Definition bslstl_hashtable.h:5089
const bslalg::HashTableBucket & bucketAtIndex(SizeType index) const
Definition bslstl_hashtable.h:4820
void removeAll()
Definition bslstl_hashtable.h:4588
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#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
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
BSLS_KEYWORD_CONSTEXPR CONTAINER::value_type * data(CONTAINER &container)
Definition bslstl_iterator.h:1231
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bslstl_algorithm.h:82
void swap(BidirectionalNodePool< VALUE, ALLOCATOR > &a, BidirectionalNodePool< VALUE, ALLOCATOR > &b)
bool operator==(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
bool operator!=(const BidirectionalIterator< T1, ITER_IMP, TAG_TYPE > &lhs, const BidirectionalIterator< T2, ITER_IMP, TAG_TYPE > &rhs)
void swap(TYPE &a, TYPE &b)
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:129
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR_TYPE >::type size_type
Definition bslma_allocatortraits.h:1165
static void construct(ALLOCATOR_TYPE &basicAllocator, ELEMENT_TYPE *elementAddr, Args &&... arguments)
Definition bslma_allocatortraits.h:1472
Definition bslmf_conditional.h:120
Definition bslmf_enableif.h:525
Definition bslmf_integralconstant.h:244
Definition bslmf_isconvertible.h:867
Definition bslmf_isfunction.h:232
Definition bslmf_ispointer.h:138
t_TYPE type
This typedef is an alias to the (template parameter) t_TYPE.
Definition bslmf_removeconst.h:161
Definition bslalg_hashtablebucket.h:297
Definition bslalg_hashtableimputil.h:613
static void insertAtFrontOfBucket(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static void remove(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static void insertAtBackOfBucket(HashTableAnchor *anchor, BidirectionalLink *link, std::size_t hashCode)
static std::size_t computeBucketIndex(std::size_t hashCode, std::size_t numBuckets)
Definition bslalg_hashtableimputil.h:845
static void deallocateObject(const t_ALLOCATOR &allocator, t_POINTER p, std::size_t n=1)
Definition bslma_allocatorutil.h:926
Definition bslmf_movableref.h:791
bsl::conditional< bsl::is_function< CALLABLE >::value, typenamebsl::add_lvalue_reference< CALLABLE >::type, CALLABLE >::type type
Definition bslstl_hashtable.h:1604
static bslma::Allocator * incidentalAllocator()
static bslalg::HashTableBucket * defaultBucketAddress()
static size_t nextPrime(size_t n)
static size_t growBucketsForLoadFactor(size_t *capacity, size_t minElements, size_t requestedBuckets, double maxLoadFactor)
static void destroyBucketArray(bslalg::HashTableBucket *data, std::size_t bucketArraySize, const ALLOCATOR &allocator)
Definition bslstl_hashtable.h:3471
static void initAnchor(bslalg::HashTableAnchor *anchor, std::size_t bucketArraySize, const ALLOCATOR &allocator)
Definition bslstl_hashtable.h:3497
static void assertNotNullPointer(TYPE &)
Definition bslstl_hashtable.h:3447
Definition bsls_objectbuffer.h:276
TYPE * address()
Definition bsls_objectbuffer.h:334
TYPE & object()
Definition bsls_objectbuffer.h:351