BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bslstl_unorderedmap_cpp03.h
Go to the documentation of this file.
1/// @file bslstl_unorderedmap_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_unorderedmap_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLSTL_UNORDEREDMAP_CPP03
12#define INCLUDED_BSLSTL_UNORDEREDMAP_CPP03
13
14/// @defgroup bslstl_unorderedmap_cpp03 bslstl_unorderedmap_cpp03
15/// @brief Provide C++03 implementation for bslstl_unorderedmap.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_unorderedmap_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_unorderedmap_cpp03-purpose"> Purpose</a>
25/// * <a href="#bslstl_unorderedmap_cpp03-classes"> Classes </a>
26/// * <a href="#bslstl_unorderedmap_cpp03-description"> Description </a>
27///
28/// # Purpose {#bslstl_unorderedmap_cpp03-purpose}
29/// Provide C++03 implementation for bslstl_unorderedmap.h
30///
31/// # Classes {#bslstl_unorderedmap_cpp03-classes}
32/// See bslstl_unorderedmap.h for list of classes
33///
34/// @see bslstl_unorderedmap
35///
36/// # Description {#bslstl_unorderedmap_cpp03-description}
37/// This component is the C++03 translation of a C++11 component,
38/// generated by the 'sim_cpp11_features.pl' program. If the original header
39/// contains any specially delimited regions of C++11 code, then this generated
40/// file contains the C++03 equivalent, i.e., with variadic templates expanded
41/// and rvalue-references replaced by 'bslmf::MovableRef' objects. The header
42/// code in this file is designed to be '#include'd into the original header
43/// when compiling with a C++03 compiler. If there are no specially delimited
44/// regions of C++11 code, then this header contains no code and is not
45/// '#include'd in the original header.
46///
47/// Generated on Thu Mar 19 20:53:55 2026
48/// Command line: sim_cpp11_features.pl bslstl_unorderedmap.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bslstl
57 * @{
58 */
59/** @addtogroup bslstl_unorderedmap_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLSTL_UNORDEREDMAP_H
64
65namespace bsl {
66
67 // ===================
68 // class unordered_map
69 // ===================
70
71/// This class template implements a value-semantic container type holding
72/// an unordered set of `KEY-VALUE` pairs having unique keys that provide a
73/// mapping from keys (of template parameter type `KEY`) to their associated
74/// mapped values (of template parameter type `VALUE`).
75///
76/// This class:
77/// * supports a complete set of *value-semantic* operations
78/// * is *exception-neutral* (agnostic except for the `at` method)
79/// * is *alias-safe*
80/// * is `const` *thread-safe*
81/// For terminology see @ref bsldoc_glossary .
82///
83/// See @ref bslstl_unorderedmap_cpp03
84template <class KEY,
85 class VALUE,
86 class HASH = bsl::hash<KEY>,
87 class EQUAL = bsl::equal_to<KEY>,
89class unordered_map {
90
91 private:
92 // PRIVATE TYPES
93
94 /// This `typedef` is an alias for the allocator traits type associated
95 /// with this container.
96 typedef bsl::allocator_traits<ALLOCATOR> AllocatorTraits;
97
98 /// This `typedef` is an alias for the type of key-value pair objects
99 /// maintained by this unordered map.
100 typedef bsl::pair<const KEY, VALUE> ValueType;
101
102 /// This `typedef` is an alias for the policy used internally by this
103 /// unordered map to extract the `KEY` value from the key-value pair
104 /// objects maintained by this unordered map.
105 typedef BloombergLP::bslstl::UnorderedMapKeyConfiguration<const KEY,
106 ValueType>
107 ListConfiguration;
108
109 /// This typedef is an alias for the template instantiation of the
110 /// underlying `bslstl::HashTable` used to implement this container.
111 typedef BloombergLP::bslstl::HashTable<ListConfiguration,
112 HASH,
113 EQUAL,
114 ALLOCATOR> HashTable;
115
116 /// This typedef is an alias for the type of links maintained by the
117 /// linked list of elements held by the underlying `bslstl::HashTable`.
118 typedef BloombergLP::bslalg::BidirectionalLink HashTableLink;
119
120 /// This typedef is an alias for the type of nodes that hold the values
121 /// in this unordered map.
122 typedef typename HashTable::NodeType HashTableNode;
123
124 /// This typedef is a convenient alias for the utility associated with
125 /// movable references.
126 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
127
128 // FRIENDS
129 template <class KEY2,
130 class VALUE2,
131 class HASH2,
132 class EQUAL2,
133 class ALLOCATOR2>
134 friend bool operator==(
135 const unordered_map<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2>&,
136 const unordered_map<KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2>&);
137
138 // PRIVATE MANIPULATORS
139
140 /// Insert the values between the specified `first` and `last` into an
141 /// initially empty set.
142 template <class INPUT_ITERATOR, class SENTINEL>
143 void constructFromRange(INPUT_ITERATOR first, SENTINEL last);
144
145#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
146 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
147
148 /// Insert the values between the specified `first` and `last` into an
149 /// initially empty set. The specified `numElements` is used to improve performance.
150 ///
151 /// \pre The behavior is undefined if the iterators support
152 /// the calculation of distance and `numElements` is not the distance
153 /// from `first` to `last`.
154 template <class INPUT_ITERATOR, class SENTINEL>
155 void constructFromRange(INPUT_ITERATOR first,
156 SENTINEL last,
157 size_t numElements);
158#endif
159
160 /// Insert the values between the specified `first` and `last` into this
161 /// set.
162 template <class INPUT_ITERATOR, class SENTINEL>
163 void insertFromRange(INPUT_ITERATOR first, SENTINEL last);
164
165#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
166 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
167
168 /// Insert the values between the specified `first` and `last` into this
169 /// set. The specified `numElements` is used to improve performance.
170 ///
171 /// \pre The behavior is undefined if the iterators support the calculation of
172 /// distance and `numElements` is not the distance from `first` to `last`.
173 template <class INPUT_ITERATOR, class SENTINEL>
174 void insertFromRange(INPUT_ITERATOR first,
175 SENTINEL last,
176 size_t numElements);
177#endif
178
179 public:
180 // TRAITS
181
182 // PUBLIC TYPES
183 typedef KEY key_type;
184 typedef VALUE mapped_type;
186 typedef HASH hasher;
187 typedef EQUAL key_equal;
188 typedef ALLOCATOR allocator_type;
189
190 typedef value_type& reference;
191 typedef const value_type& const_reference;
192
193 typedef typename AllocatorTraits::size_type size_type;
195 typedef typename AllocatorTraits::pointer pointer;
197
198 typedef BloombergLP::bslstl::HashTableIterator<
200 typedef BloombergLP::bslstl::HashTableIterator<
202 typedef BloombergLP::bslstl::HashTableBucketIterator<
204 typedef BloombergLP::bslstl::HashTableBucketIterator<
206
207 private:
208 // DATA
209 HashTable d_impl; // underlying hash table used by this unordered map
210
211 public:
212 // CREATORS
213
214 /// Create an empty unordered map having a @ref max_load_factor of 1.0.
215 /// Optionally specify an `initialNumBuckets` indicating the minimum
216 /// initial size of the array of buckets of this unordered map. If
217 /// `initialNumBuckets` is not supplied, one empty bucket shall be used
218 /// and no memory allocated. Optionally specify a `hashFunction` used
219 /// to generate the hash values associated with the `KEY-VALUE` pairs
220 /// contained in this unordered map. If `hashFunction` is not supplied,
221 /// a default-constructed object of the (template parameter) type `HASH`
222 /// is used. Optionally specify a key-equality functor `keyEqual` used
223 /// to determine whether two keys are equivalent. If `keyEqual` is not
224 /// supplied, a default-constructed object of the (template parameter)
225 /// type `EQUAL` is used. Optionally specify the `basicAllocator` used
226 /// to supply memory. If `basicAllocator` is not supplied, a
227 /// default-constructed object of the (template parameter) type
228 /// `ALLOCATOR` is used. If the `ALLOCATOR` type is `bsl::allocator`
229 /// (the default), then `basicAllocator` shall be convertible to
230 /// `bslma::Allocator *`. If the `ALLOCATOR` type is `bsl::allocator`
231 /// and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory.
232 ///
233 /// \note Note that more than
234 /// `initialNumBuckets` buckets may be created in order to preserve the
235 /// bucket allocation strategy of the hash-table (but never fewer).
236 explicit
237 unordered_map(size_type initialNumBuckets,
238 const HASH& hashFunction = HASH(),
239 const EQUAL& keyEqual = EQUAL(),
240 const ALLOCATOR& basicAllocator = ALLOCATOR());
241 unordered_map(size_type initialNumBuckets,
242 const HASH& hashFunction,
243 const ALLOCATOR& basicAllocator);
244 unordered_map(size_type initialNumBuckets,
245 const ALLOCATOR& basicAllocator);
246 explicit
247 unordered_map(const ALLOCATOR& basicAllocator);
249
250 /// Create an empty unordered map, having a @ref max_load_factor of 1.0,
251 /// and then create a `value_type` object for each iterator in the range
252 /// starting at the specified `first` iterator and ending immediately
253 /// before the specified `last` iterator, by converting from the object
254 /// referred to by each iterator. Insert into this unordered map each
255 /// such object, ignoring those having a key that appears earlier in the
256 /// sequence. Optionally specify a minimum `initialNumBuckets`
257 /// indicating the minimum initial size of the array of buckets of this
258 /// unordered map. If `initialNumBuckets` is 0 or not supplied, and
259 /// `first` and `last` denote an empty range, a single empty bucket
260 /// shall be supplied. The actual number of buckets the unordered_map
261 /// is created with shall always be enough to accommodate the number of
262 /// elements of the range without exceeding the @ref max_load_factor .
263 /// Optionally specify a `hashFunction` used to generate hash values
264 /// associated with the `KEY-VALUE` pairs contained in this unordered
265 /// map. If `hashFunction` is not supplied, a default-constructed
266 /// object of the (template parameter) type `HASH` is used. Optionally
267 /// specify a key-equality functor `keyEqual` used to verify that two
268 /// keys are equivalent. If `keyEqual` is not supplied, a
269 /// default-constructed object of the (template parameter) type `EQUAL`
270 /// is used. Optionally specify a `basicAllocator` used to supply
271 /// memory. If `basicAllocator` is not supplied, a default-constructed
272 /// object of the (template parameter) type `ALLOCATOR` is used. If
273 /// `ALLOCATOR` type is `bsl::allocator` (the default), then
274 /// `basicAllocator` shall be convertible to `bslma::Allocator *`. If
275 /// the `ALLOCATOR` type is `bsl::allocator` and `basicAllocator` is not
276 /// supplied, the currently installed default allocator is used to
277 /// supply memory. The (template parameter) type `INPUT_ITERATOR` shall
278 /// meet the requirements of an input iterator defined in the C++11
279 /// standard [24.2.3] providing access to values of a type convertible to `value_type`.
280 ///
281 /// \pre The behavior is undefined unless `first` and
282 /// `last` refer to a sequence of valid values where `first` is at a position at or before `last`.
283 ///
284 /// \note Note that more than
285 /// `initialNumBuckets` buckets may be created in order to preserve the
286 /// bucket allocation strategy of the hash-table (but never fewer).
287 template <class INPUT_ITERATOR>
288 unordered_map(INPUT_ITERATOR first,
289 INPUT_ITERATOR last,
290 size_type initialNumBuckets = 0,
291 const HASH& hashFunction = HASH(),
292 const EQUAL& keyEqual = EQUAL(),
293 const ALLOCATOR& basicAllocator = ALLOCATOR());
294 template <class INPUT_ITERATOR>
295 unordered_map(INPUT_ITERATOR first,
296 INPUT_ITERATOR last,
297 size_type initialNumBuckets,
298 const HASH& hashFunction,
299 const ALLOCATOR& basicAllocator);
300 template <class INPUT_ITERATOR>
301 unordered_map(INPUT_ITERATOR first,
302 INPUT_ITERATOR last,
303 size_type initialNumBuckets,
304 const ALLOCATOR& basicAllocator);
305 template <class INPUT_ITERATOR>
306 unordered_map(INPUT_ITERATOR first,
307 INPUT_ITERATOR last,
308 const ALLOCATOR& basicAllocator);
309
310#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
311# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
312 template <
313 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
314 class = bsl::enable_if_t<
315 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
316 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
317 >
318# endif
320 std::initializer_list<value_type> values,
321 size_type initialNumBuckets = 0,
322 const HASH& hashFunction = HASH(),
323 const EQUAL& keyEqual = EQUAL(),
324 const ALLOCATOR& basicAllocator = ALLOCATOR());
325# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
326 template <
327 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
328 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
329 >
330# endif
331 unordered_map(std::initializer_list<value_type> values,
332 size_type initialNumBuckets,
333 const HASH& hashFunction,
334 const ALLOCATOR& basicAllocator);
335# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
336 template <
337 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
338 >
339# endif
340 unordered_map(std::initializer_list<value_type> values,
341 size_type initialNumBuckets,
342 const ALLOCATOR& basicAllocator);
343# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
344 /// Create an empty unordered map, having a @ref max_load_factor of 1.0,
345 /// and then create a `value_type` object for each in the range
346 /// specified by `values` argument, ignoring elements having a key that
347 /// appears earlier in the sequence. Optionally specify a minimum
348 /// `initialNumBuckets` indicating the minimum initial size of the array
349 /// of buckets of this unordered map. If `initialNumBuckets` is not
350 /// supplied and `values` is an empty list, a single empty bucket shall
351 /// be created. The actual number of buckets the unordered_map is
352 /// created with shall always be enough to accommodate the number of
353 /// elements in `values` without exceeding the @ref max_load_factor .
354 /// Optionally specify a `hashFunction` used to generate hash values
355 /// associated with the `KEY-VALUE` pairs contained in this unordered
356 /// map. If `hashFunction` is not supplied, a default-constructed
357 /// object of the (template parameter) type `HASH` is used. Optionally
358 /// specify a key-equality functor `keyEqual` used to verify that two
359 /// keys are equivalent. If `keyEqual` is not supplied, a
360 /// default-constructed object of the (template parameter) type `EQUAL`
361 /// is used. Optionally specify a `basicAllocator` used to supply
362 /// memory. If `basicAllocator` is not supplied, a default-constructed
363 /// object of the (template parameter) type `ALLOCATOR` is used. If the
364 /// `ALLOCATOR` type is `bsl::allocator` (the default), then
365 /// `basicAllocator` shall be convertible to `bslma::Allocator *`. If
366 /// the `ALLOCATOR` type is `bsl::allocator` and `basicAllocator` is not
367 /// supplied, the currently installed default allocator is used to supply memory.
368 ///
369 /// \note Note that more than `initialNumBuckets` buckets may
370 /// be created in order to preserve the bucket allocation strategy of
371 /// the hash-table (but never fewer).
372 template <
373 class = bsl::enable_if_t< bsl::IsStdAllocator_v<ALLOCATOR>>
374 >
375# endif
376 unordered_map(std::initializer_list<value_type> values,
377 const ALLOCATOR& basicAllocator);
378#endif
379
380 /// Create an unordered set, and insert each `value_type` object in the
381 /// specified `range`, ignoring those keys having a key equivalent to
382 /// that which appears earlier in the `range`. Optionally specify an
383 /// `initialNumBuckets` indicating the initial size of the array of
384 /// buckets of this container. If `initialNumBuckets` is not supplied,
385 /// an implementation-defined value is used. Optionally specify a
386 /// `hashFunction` used to generate the hash values for each key value
387 /// contained in this set. If `hashFunction` is not supplied, a
388 /// default-constructed object of the (template parameter) type `HASH`
389 /// is used. Optionally specify a key-equality functor `keyEqual` used
390 /// to determine whether two keys have the same value. If `keyEqual` is
391 /// not supplied, a default-constructed object of the (template
392 /// parameter) type `EQUAL` is used. Optionally specify a
393 /// `basicAllocator` used to supply memory. If `basicAllocator` is not
394 /// supplied, a default-constructed object of the (template parameter)
395 /// type `ALLOCATOR` is used. If the type `ALLOCATOR` is
396 /// `bsl::allocator` (the default), then `basicAllocator`, if supplied,
397 /// shall be convertible to `bslma::Allocator *`. If the type
398 /// `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not
399 /// supplied, the currently installed default allocator is used. This
400 /// operation has `O[N]` complexity, where `N` is the number of elements in `range`.
401 ///
402 /// \note Note that `RANGE` must meet the requirements of an
403 /// input range and the values from `range` must have a type matching or
404 /// convertible to `value_type`.
405 template <class RANGE>
408 bsl::from_range_t ,
409 BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range,
410 size_type initialNumBuckets = 0,
411 const HASH& hashFunction = HASH(),
412 const EQUAL& keyEqual = EQUAL(),
413 const ALLOCATOR& basicAllocator = ALLOCATOR())
414 : d_impl(hashFunction,
415 keyEqual,
416 initialNumBuckets,
417 1.0f,
418 basicAllocator)
419 {
420 // Defined inline to avoid `clang` and Windows errors.
421#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
422 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
423 if constexpr (ranges::sized_range<RANGE>) {
424 constructFromRange(bsl::ranges::begin(range),
425 bsl::ranges::end (range),
426 bsl::ranges::size (range));
427 } else // ...
428#endif
429 {
430 constructFromRange(bsl::ranges::begin(range),
431 bsl::ranges::end (range));
432 }
433 }
434
435 template <class RANGE>
439 size_type initialNumBuckets,
440 const HASH& hashFunction,
441 const ALLOCATOR& basicAllocator)
442 : d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
443 {
444 // Defined inline to avoid `clang` error.
445
447 range,
448 initialNumBuckets,
449 hashFunction,
450 EQUAL(),
451 basicAllocator);
452 this->swap(other);
453 }
454
455 template <class RANGE>
459 size_type initialNumBuckets,
460 const ALLOCATOR& basicAllocator)
461 : d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
462 {
463 // Defined inline to avoid `clang` error.
464
466 range,
467 initialNumBuckets,
468 HASH(),
469 EQUAL(),
470 basicAllocator);
471 this->swap(other);
472 }
473
474 template <class RANGE>
478 const ALLOCATOR& basicAllocator)
479 : d_impl(HASH(), EQUAL(), 0, 1.0f, basicAllocator)
480 {
481 // Defined inline to avoid `clang` error.
482
484 range,
485 0,
486 HASH(),
487 EQUAL(),
488 basicAllocator);
489 this->swap(other);
490 }
491
492 /// Create an unordered map having the same value, hasher, key-equality
493 /// comparator, and @ref max_load_factor as the specified `original`. Use
494 /// the allocator returned by 'bsl::allocator_traits<ALLOCATOR>::
495 /// select_on_container_copy_construction(original.get_allocator())' to
496 /// supply memory. If the `ALLOCATOR` type is `bsl::allocator` (the
497 /// default), the currently installed default allocator is used to
498 /// supply memory.
499 unordered_map(const unordered_map& original);
500
501 /// Create an unordered map having the same value, hasher, key-equality
502 /// comparator, and @ref max_load_factor as the specified `original`, and
503 /// using the specified `basicAllocator` to supply memory. If the
504 /// `ALLOCATOR` type is `bsl::allocator` (the default), then
505 /// `basicAllocator` shall be convertible to `bslma::Allocator *`.
507 const unordered_map& original,
508 const typename type_identity<ALLOCATOR>::type& basicAllocator);
509
510 /// Create an unordered map having the same value as the specified
511 /// `original` object by moving (in constant time) the contents of
512 /// `original` to the new unordered map. Use a copy of
513 /// `original.hash_function()` to generate hash values for the keys
514 /// contained in this unordered map. Use a copy of `original.key_eq()`
515 /// to verify that two keys are equivalent. The allocator associated
516 /// with `original` is propagated for use in the newly-created unordered
517 /// map. `original` is left in a valid but unspecified state.
519 BloombergLP::bslmf::MovableRef<unordered_map> original); // IMPLICIT
520
521 /// Create an unordered map having the same value, hasher, key-equality
522 /// comparator, and @ref max_load_factor as the specified `original`. Use
523 /// the specified `basicAllocator` to supply memory. This method
524 /// requires that the (template parameter) type `value_type` be
525 /// `move-insertable` into this `unordered_map` (see {Requirements on `value_type`}).
526 ///
527 /// \note Note that a `bslma::Allocator *` can be supplied
528 /// for `basicAllocator` if the (template parameter) `ALLOCATOR` type is
529 /// `bsl::allocator` (the default).
531 BloombergLP::bslmf::MovableRef<unordered_map> original,
532 const typename type_identity<ALLOCATOR>::type& basicAllocator);
533
534 /// Destroy this object and each of its elements.
536
537 // MANIPULATORS
538
539 /// Assign to this object the value, hasher, key-equality functor, and
540 /// @ref max_load_factor of the specified `rhs` object, propagate to this
541 /// object the allocator of `rhs` if the `ALLOCATOR` type has trait
542 /// @ref propagate_on_container_copy_assignment , and return a reference providing modifiable access to this object.
543 ///
544 /// \note Note that this method
545 /// requires that the (template parameter) types `KEY` and `VALUE` both
546 /// be `copy-constructible` (see {Requirements on `value_type`}).
548
549 /// Assign to this object the value, hash function, and key-equality
550 /// comparator of the specified `rhs` object, propagate to this object
551 /// the allocator of `rhs` if the `ALLOCATOR` type has trait
552 /// @ref propagate_on_container_move_assignment , and return a reference
553 /// providing modifiable access to this object. The contents of `rhs`
554 /// are moved (in constant time) to this unordered map if
555 /// `get_allocator() == rhs.get_allocator()` (after accounting for the
556 /// aforementioned trait); otherwise, all elements in this container are
557 /// either destroyed or move-assigned to, and each additional element in
558 /// `rhs` is move-inserted into this unordered_map. `rhs` is left in a
559 /// valid but unspecified state, and if an exception is thrown, `*this`
560 /// is left in a valid but unspecified state. This method requires that
561 /// the type `value_type` be `move-constructible` (see {Requirements on
562 /// `value_type`}).
564 operator=(BloombergLP::bslmf::MovableRef<unordered_map> rhs)
566 AllocatorTraits::is_always_equal::value &&
567 std::is_nothrow_move_assignable<HASH>::value &&
568 std::is_nothrow_move_assignable<EQUAL>::value);
569
570#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
571 /// Assign to this unordered map the value of the of the specified
572 /// initializer list `rhs`, and return a reference providing modifiable
573 /// access to this object. This method requires that the (template
574 /// parameter) type `value_type` be `copy-insertable` into this list.
575 unordered_map& operator=(std::initializer_list<value_type> rhs);
576#endif
577
578 /// Return a reference providing modifiable access to the mapped-value
579 /// associated with the specified `key` in this unordered map; if this
580 /// unordered map does not already contain a `value_type` object with
581 /// `key`, first insert a new `value_type` object having `key` and a default-constructed `VALUE` object.
582 ///
583 /// \note Note that this method requires
584 /// that the (template parameter) type `KEY` is `copy-constructible` and
585 /// the (template parameter) `VALUE` is "default-constructible" (see
586 /// {Requirements on `value_type`}).
588
589 /// Return a reference providing modifiable access to the mapped-value
590 /// associated with the specified `key` in this unordered map; if this
591 /// unordered map does not already contain a `value_type` object with
592 /// `key`, first insert a new `value_type` object having `key` and a default-constructed `VALUE` object.
593 ///
594 /// \note Note that this method requires
595 /// that the (template parameter) `VALUE` is "default-constructible" (see {Requirements on `value_type`}).
596 ///
597 /// \note Note that `key` may be
598 /// modified; it is guaranteed to be left in a valid state.
600 BloombergLP::bslmf::MovableRef<key_type> key);
601
602// {{{ BEGIN GENERATED CODE
603// The generated code below is a workaround for the absence of perfect
604// forwarding in some compilers.
605 template <class LOOKUP_KEY>
606 typename bsl::enable_if<
607 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
608 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
611 {
612 return try_emplace(
613 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)).first->second;
614 }
615// }}} END GENERATED CODE
616
617 /// Return a reference providing modifiable access to the mapped-value
618 /// associated with the specified `key`, if such an entry exists; otherwise throw `std::out_of_range` exception.
619 ///
620 /// \note Note that this
621 /// method is not exception-neutral.
622 typename add_lvalue_reference<VALUE>::type at(const key_type& key);
623
624 /// Return a reference providing modifiable access to the
625 /// mapped-value associated with a key that is equivalent to the
626 /// specified `key`, if such an entry exists; otherwise, throw a `std::out_of_range` exception.
627 ///
628 /// \note Note that this method may also throw
629 /// a different kind of exception if the (user-supplied) comparator
630 /// throws.
631 ///
632 /// Note: implemented inline due to Sun CC compilation error
633 template <class LOOKUP_KEY>
634 typename bsl::enable_if<
635 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
636 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
638 at(const LOOKUP_KEY& key) {
639 HashTableLink *node = d_impl.find(key);
640
641 if (!node) {
642 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
643 "unordered_map<...>::at(LOOKUP_KEY): invalid key value");
644 }
645 return static_cast<HashTableNode *>(node)->value().second;
646 }
647
648 /// Return an iterator providing modifiable access to the first
649 /// `value_type` object in the sequence of `value_type` objects
650 /// maintained by this unordered map, or the `end` iterator if this
651 /// unordered map is empty.
653
654 /// Return an iterator providing modifiable access to the past-the-end
655 /// position in the sequence of `value_type` objects maintained by this
656 /// unordered map.
658
659 /// Return a local iterator providing modifiable access to the first
660 /// `value_type` object in the sequence of `value_type` objects of the
661 /// bucket having the specified `index` in the array of buckets
662 /// maintained by this unordered map, or the `end(index)` iterator if the bucket is empty.
663 ///
664 /// \pre The behavior is undefined unless 'index <
665 /// bucket_count()'.
667
668 /// Return a local iterator providing modifiable access to the
669 /// past-the-end position in the sequence of `value_type` objects of the
670 /// bucket having the specified `index` in the array of buckets maintained by this unordered map.
671 ///
672 /// \pre The behavior is undefined unless
673 /// `index < bucket_count()`.
675
676 /// Remove all entries from this unordered map.
677 /// \note Note that this
678 /// unordered map will be empty after calling this method, but allocated
679 /// memory may be retained for future use.
681
682#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
683// {{{ BEGIN GENERATED CODE
684// Command line: sim_cpp11_features.pl bslstl_unorderedmap.h
685#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
686#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT 10
687#endif
688#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B
689#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
690#endif
691#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 0
692 pair<iterator, bool> emplace(
693 );
694#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 0
695
696#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 1
697 template <class Args_01>
698 pair<iterator, bool> emplace(
699 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
700#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 1
701
702#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 2
703 template <class Args_01,
704 class Args_02>
705 pair<iterator, bool> emplace(
706 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
707 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
708#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 2
709
710#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 3
711 template <class Args_01,
712 class Args_02,
713 class Args_03>
714 pair<iterator, bool> emplace(
715 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
716 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
717 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
718#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 3
719
720#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 4
721 template <class Args_01,
722 class Args_02,
723 class Args_03,
724 class Args_04>
725 pair<iterator, bool> emplace(
726 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
727 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
728 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
729 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
730#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 4
731
732#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 5
733 template <class Args_01,
734 class Args_02,
735 class Args_03,
736 class Args_04,
737 class Args_05>
738 pair<iterator, bool> emplace(
739 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
740 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
741 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
742 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
743 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
744#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 5
745
746#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 6
747 template <class Args_01,
748 class Args_02,
749 class Args_03,
750 class Args_04,
751 class Args_05,
752 class Args_06>
753 pair<iterator, bool> emplace(
754 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
755 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
756 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
757 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
758 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
759 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
760#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 6
761
762#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 7
763 template <class Args_01,
764 class Args_02,
765 class Args_03,
766 class Args_04,
767 class Args_05,
768 class Args_06,
769 class Args_07>
770 pair<iterator, bool> emplace(
771 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
772 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
773 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
774 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
775 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
776 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
777 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
778#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 7
779
780#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 8
781 template <class Args_01,
782 class Args_02,
783 class Args_03,
784 class Args_04,
785 class Args_05,
786 class Args_06,
787 class Args_07,
788 class Args_08>
789 pair<iterator, bool> emplace(
790 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
791 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
792 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
793 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
794 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
795 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
796 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
797 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
798#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 8
799
800#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 9
801 template <class Args_01,
802 class Args_02,
803 class Args_03,
804 class Args_04,
805 class Args_05,
806 class Args_06,
807 class Args_07,
808 class Args_08,
809 class Args_09>
810 pair<iterator, bool> emplace(
811 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
812 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
813 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
814 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
815 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
816 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
817 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
818 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
819 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
820#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 9
821
822#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 10
823 template <class Args_01,
824 class Args_02,
825 class Args_03,
826 class Args_04,
827 class Args_05,
828 class Args_06,
829 class Args_07,
830 class Args_08,
831 class Args_09,
832 class Args_10>
833 pair<iterator, bool> emplace(
834 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
835 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
836 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
837 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
838 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
839 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
840 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
841 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
842 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
843 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
844#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 10
845
846
847#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 0
849#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 0
850
851#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 1
852 template <class Args_01>
854 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
855#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 1
856
857#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 2
858 template <class Args_01,
859 class Args_02>
861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
862 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
863#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 2
864
865#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 3
866 template <class Args_01,
867 class Args_02,
868 class Args_03>
870 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
871 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
872 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
873#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 3
874
875#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 4
876 template <class Args_01,
877 class Args_02,
878 class Args_03,
879 class Args_04>
881 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
882 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
883 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
884 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
885#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 4
886
887#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 5
888 template <class Args_01,
889 class Args_02,
890 class Args_03,
891 class Args_04,
892 class Args_05>
894 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
895 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
896 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
897 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
898 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
899#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 5
900
901#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 6
902 template <class Args_01,
903 class Args_02,
904 class Args_03,
905 class Args_04,
906 class Args_05,
907 class Args_06>
909 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
910 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
911 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
912 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
913 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
914 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
915#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 6
916
917#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 7
918 template <class Args_01,
919 class Args_02,
920 class Args_03,
921 class Args_04,
922 class Args_05,
923 class Args_06,
924 class Args_07>
926 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
927 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
928 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
929 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
930 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
931 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
932 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
933#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 7
934
935#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 8
936 template <class Args_01,
937 class Args_02,
938 class Args_03,
939 class Args_04,
940 class Args_05,
941 class Args_06,
942 class Args_07,
943 class Args_08>
945 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
946 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
947 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
948 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
949 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
950 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
951 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
952 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
953#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 8
954
955#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 9
956 template <class Args_01,
957 class Args_02,
958 class Args_03,
959 class Args_04,
960 class Args_05,
961 class Args_06,
962 class Args_07,
963 class Args_08,
964 class Args_09>
966 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
967 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
968 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
969 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
970 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
971 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
972 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
973 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
974 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
975#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 9
976
977#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 10
978 template <class Args_01,
979 class Args_02,
980 class Args_03,
981 class Args_04,
982 class Args_05,
983 class Args_06,
984 class Args_07,
985 class Args_08,
986 class Args_09,
987 class Args_10>
989 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
990 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
991 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
992 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
993 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
994 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
995 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
996 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
997 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
998 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
999#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_B >= 10
1000
1001#else
1002// The generated code below is a workaround for the absence of perfect
1003// forwarding in some compilers.
1004 template <class... Args>
1005 pair<iterator, bool> emplace(
1006 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
1007
1008 template <class... Args>
1010 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
1011// }}} END GENERATED CODE
1012#endif
1013
1014 /// Insert into this map the value of each `value_type` object in the
1015 /// specified `range` if a key equivalent to the object is not already
1016 /// contained in this set. The (template parameter) type `RANGE` must
1017 /// meet the requirements the C++20 standard [ranges] providing access
1018 /// to values of a type convertible to `value_type`, and `value_type`
1019 /// must be `emplace-constructible` from `*i` into this set, where `i`
1020 /// is a dereferenceable iterator obtained from `range` (see {Requirements on `KEY`}).
1021 ///
1022 /// \pre The behavior is undefined if `range`
1023 /// overlaps this map.
1024 template <class RANGE>
1027 {
1028 // Defined inline to avoid `clang` and Windows errors.
1029#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
1030 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
1031 if constexpr (ranges::sized_range<RANGE>) {
1032 insertFromRange(bsl::ranges::begin(range),
1033 bsl::ranges::end (range),
1034 bsl::ranges::size (range));
1035 } else // ...
1036#endif
1037 {
1038 insertFromRange(bsl::ranges::begin(range),
1039 bsl::ranges::end (range));
1040 }
1041 }
1042
1043 /// Remove from this unordered map the `value_type` object at the
1044 /// specified `position`, and return an iterator referring to the
1045 /// element immediately following the removed element, or to the
1046 /// past-the-end position if the removed element was the last element in
1047 /// the sequence of elements maintained by this unordered map. This
1048 /// method invalidates only iterators and references to the removed
1049 /// element and previously saved values of the `end()` iterator, and
1050 /// preserves the relative order of the elements not removed.
1051 ///
1052 /// \pre The behavior is undefined unless `position` refers to a `value_type`
1053 /// object in this unordered map.
1054 iterator erase(const_iterator position);
1055 iterator erase(iterator position);
1056
1057 /// Remove from this unordered map the `value_type` object having the
1058 /// specified `key`, if it exists, and return 1; otherwise (there is no
1059 /// object with a key equivalent to `key` in this unordered map) return
1060 /// 0 with no other effect. This method invalidates only iterators and
1061 /// references to the removed element and previously saved values of the
1062 /// `end()` iterator, and preserves the relative order of the elements
1063 /// not removed.
1064 size_type erase(const key_type& key);
1065 template <class t_KEY>
1066 typename enable_if<
1067 BloombergLP::bslmf::IsTransparentPredicate<HASH, t_KEY>::value &&
1068 BloombergLP::bslmf::IsTransparentPredicate<EQUAL,t_KEY>::value &&
1069 !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY),
1070 iterator>::value &&
1071 !is_convertible<BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY),
1072 const_iterator>::value,
1074 {
1075 // Implemented inline due to Sun CC compilation error.
1076 iterator it = this->find(key);
1077 if (it == end()) {
1078 return 0; // RETURN
1079 }
1080 erase(it);
1081 return 1;
1082 }
1083
1084 /// Remove from this unordered map the `value_type` objects starting at
1085 /// the specified `first` position up to, but not including, the
1086 /// specified `last` position, and return `last`. This method
1087 /// invalidates only iterators and references to the removed element and
1088 /// previously saved values of the `end()` iterator, and preserves the
1089 /// relative order of the elements not removed.
1090 ///
1091 /// \pre The behavior is undefined unless `first` and `last` either refer to elements in this
1092 /// unordered map or are the `end` iterator, and the `first` position is
1093 /// at or before the `last` position in the iteration sequence provided
1094 /// by this container.
1096
1097 /// Return an iterator providing modifiable access to the `value_type`
1098 /// object in this unordered map with a key equivalent to the specified
1099 /// `key`, if such an entry exists, and the past-the-end iterator (`end`) otherwise.
1100 ///
1101 /// \pre The behavior is undefined unless `key` is
1102 /// equivalent to the key of at most one element in this unordered map.
1103 template <class LOOKUP_KEY>
1104 typename enable_if<
1105 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1106 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1107 iterator>::type
1108 find(const LOOKUP_KEY& key)
1109 {
1110 // Note: implemented inline due to Sun CC compilation error.
1111 return iterator(d_impl.find(key));
1112 }
1113
1114 /// Return an iterator providing modifiable access to the `value_type`
1115 /// object in this unordered map with a key equivalent to the specified
1116 /// `key`, if such an entry exists, and the past-the-end iterator
1117 /// (`end`) otherwise.
1118 iterator find(const key_type& key);
1119
1120 /// Insert the specified `value` into this unordered map if the key (the
1121 /// `first` element) of the object referred to by `value` does not
1122 /// already exist in this unordered map; otherwise, this method has no
1123 /// effect (a `value_type` object having the key equivalent to the key
1124 /// of `value` already exists in this unordered map). Return a `pair`
1125 /// whose `first` member is an iterator referring to the (possibly newly
1126 /// inserted) `value_type` object in this unordered map whose key is
1127 /// equivalent to that of the object to be inserted, and whose `second`
1128 /// member is `true` if a new value was inserted, and `false` if a value having an equivalent key was already present.
1129 ///
1130 /// \note Note that this method
1131 /// requires that the (template parameter) types `KEY` and `VALUE` both
1132 /// be `copy-insertable` into this unordered map (see {Requirements on
1133 /// `value_type`}).
1134 pair<iterator, bool> insert(const value_type& value);
1135
1136#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1137 template <class ALT_VALUE_TYPE>
1138 pair<iterator, bool>
1139#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1140 template <class ALT_VALUE_TYPE>
1141 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
1142 pair<iterator, bool> >::type
1143#else
1144 /// Insert the specified `value` into this unordered map if the key (the
1145 /// `first` element) of the object referred to by `value` does not
1146 /// already exist in this unordered map; otherwise, this method has no
1147 /// effect (a `value_type` object having the same key as the converted
1148 /// `value` already exists in this unordered map) . Return a `pair`
1149 /// whose `first` member is an iterator referring to the (possibly newly
1150 /// inserted) `value_type` object in this unordered map whose key is the
1151 /// equivalent to that of the object to be inserted, and whose `second`
1152 /// member is `true` if a new value was inserted, and `false` if a value having an equivalent key was already present.
1153 ///
1154 /// \note Note that this method
1155 /// requires that the (template parameter) types `KEY` and `VALUE` both
1156 /// be `move-constructible` (see {Requirements on `value_type`}), and
1157 /// that the `value_type` be constructible from the (template parameter)
1158 /// `ALT_VALUE_TYPE`. Also note that this one template stands in for
1159 /// three `insert` functions in the C++11 standard.
1160 template <class ALT_VALUE_TYPE>
1161 typename enable_if<std::is_constructible<value_type,
1162 ALT_VALUE_TYPE&&>::value,
1163 pair<iterator, bool> >::type
1164#endif
1165 insert(BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
1166 {
1167 // Note that some compilers require functions declared with `enable_if`
1168 // to be defined inline.
1169
1170 typedef bsl::pair<iterator, bool> ResultType;
1171
1172 bool isInsertedFlag = false;
1173
1174 HashTableLink *result = d_impl.insertIfMissing(
1175 &isInsertedFlag,
1176 BSLS_COMPILERFEATURES_FORWARD(ALT_VALUE_TYPE, value));
1177
1178 return ResultType(iterator(result), isInsertedFlag);
1179 }
1180
1181 /// Insert the specified `value` into this unordered map if the key (the
1182 /// `first` element) of the object referred to by `value` does not
1183 /// already exist in this unordered map; otherwise, this method has no
1184 /// effect (a `value_type` object having the key equivalent to the key
1185 /// of `value` already exists in this unordered map). Return an
1186 /// iterator referring to ether the newly inserted `value_type` object
1187 /// or to the existing object whose key is equivalent to the key of
1188 /// `value`. The average and worst case complexity of this operation is
1189 /// not affected by the specified `hint`. This method requires that the
1190 /// (template parameter) types `KEY` and `VALUE` both be
1191 /// `copy-insertable` into this unordered map (see {Requirements on `value_type`}).
1192 ///
1193 /// \pre The behavior is undefined unless `hint` is an
1194 /// iterator in the range `[begin() .. end()]` (both endpoints included).
1195 ///
1196 /// \note Note that `hint` is ignored (other than possibly
1197 /// asserting its validity in some build modes).
1198 iterator insert(const_iterator hint, const value_type& value);
1199
1200#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1201 template <class ALT_VALUE_TYPE>
1202 iterator
1203#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1204 template <class ALT_VALUE_TYPE>
1205 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
1206 iterator>::type
1207#else
1208 /// Insert the specified `value` into this unordered map if the key (the
1209 /// `first` element) of the object referred to by `value` does not
1210 /// already exist in this unordered map; otherwise, this method has no
1211 /// effect (a `value_type` object having the same key as the converted
1212 /// `value` already exists in this unordered map) . Return an iterator
1213 /// referring to ether the newly inserted) `value_type` object or to the
1214 /// existing object whose key is equivalent to the key of `value`. The
1215 /// average and worst case complexity of this operation is not affected
1216 /// by the specified `hint`. This method requires that the (template
1217 /// parameter) types `KEY` and `VALUE` both be `move-constructible` (see
1218 /// {Requirements on `value_type`}) and that the `value_type` be
1219 /// constructible from the (template parameter) `ALT_VALUE_TYPE`.
1220 ///
1221 /// \pre The behavior is undefined unless `hint` is an iterator in the range `[begin() .. end()]` (both endpoints included).
1222 ///
1223 /// \note Note that `hint` is
1224 /// ignored (other than possibly asserting its validity in some build
1225 /// modes). Also note that this one template stands in for three
1226 /// `insert` functions in the C++11 standard.
1227 template <class ALT_VALUE_TYPE>
1228 typename enable_if<std::is_constructible<value_type,
1229 ALT_VALUE_TYPE&&>::value,
1230 iterator>::type
1231#endif
1233 BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
1234 {
1235 // Note that some compilers require functions declared with 'enable_if'
1236 // to be defined inline.
1237
1238 // There is no realistic use-case for the 'hint' in an 'unordered_map'
1239 // of unique values. We could quickly test for a duplicate key, and
1240 // have a fast return path for when the method fails, but in the
1241 // typical use case where a new element is inserted, we are adding an
1242 // extra key check for no benefit. In order to insert an element into
1243 // a bucket, we need to walk the whole bucket looking for duplicates,
1244 // and the hint is no help in finding the start of a bucket.
1245
1246 (void)hint; // suppress 'unused' warnings
1247
1248 bool isInsertedFlag; // not used
1249
1250 HashTableLink *result = d_impl.insertIfMissing(
1251 &isInsertedFlag,
1252 BSLS_COMPILERFEATURES_FORWARD(ALT_VALUE_TYPE, value));
1253
1254 return iterator(result);
1255 }
1256
1257 /// Create a `value_type` object for each iterator in the range starting
1258 /// at the specified `first` iterator and ending immediately before the
1259 /// specified `last` iterator, by converting from the object referred to
1260 /// by each iterator. Insert into this unordered map each such object
1261 /// whose key is not already contained. The (template parameter) type
1262 /// `INPUT_ITERATOR` shall meet the requirements of an input iterator
1263 /// defined in the C++11 standard [24.2.3] providing access to values of
1264 /// a type convertible to `value_type`.
1265 ///
1266 /// \pre The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`.
1267 ///
1268 /// \note Note that this method
1269 /// requires that the (template parameter) types `KEY` and `VALUE` both
1270 /// be `copy-constructible` (see {Requirements on `value_type`}).
1271 template <class INPUT_ITERATOR>
1272 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
1273
1274#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1275 /// Create a `value_type` object for each element in the specified
1276 /// `values`. Insert into this unordered map each such object whose key is not already contained.
1277 ///
1278 /// \note Note that this method requires that the
1279 /// (template parameter) types `KEY` and `VALUE` both be
1280 /// `copy-constructible` (see {Requirements on `value_type`}).
1281 void insert(std::initializer_list<value_type> values);
1282#endif
1283
1284// {{{ BEGIN GENERATED CODE
1285// The generated code below is a workaround for the absence of perfect
1286// forwarding in some compilers.
1287 template <class BDE_OTHER_TYPE>
1288 pair<iterator, bool> insert_or_assign(const KEY& key,
1289 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
1290
1291 template <class BDE_OTHER_TYPE>
1292 pair<iterator, bool> insert_or_assign(
1293 BloombergLP::bslmf::MovableRef<KEY> key,
1294 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
1295
1296 template<class LOOKUP_KEY, class BDE_OTHER_TYPE>
1297 typename bsl::enable_if<
1298 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1299 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1300 , pair<iterator, bool> >::type
1302 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
1303 {
1304 typedef bsl::pair<iterator, bool> ResultType;
1305 bool isInsertedFlag = false;
1306 HashTableLink *result = d_impl.insertOrAssignTransparent(
1307 &isInsertedFlag,
1308 NULL,
1309 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1310 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
1311 return ResultType(iterator(result), isInsertedFlag);
1312 }
1313
1314 template <class BDE_OTHER_TYPE>
1316 const KEY& key,
1317 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
1318
1319 template <class BDE_OTHER_TYPE>
1321 BloombergLP::bslmf::MovableRef<KEY> key,
1322 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
1323
1324 template<class LOOKUP_KEY, class BDE_OTHER_TYPE>
1325 typename bsl::enable_if<
1326 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1327 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1328 , iterator>::type
1330 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1331 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
1332 {
1333 bool isInsertedFlag = false;
1334 HashTableLink *result = d_impl.insertOrAssignTransparent(
1335 &isInsertedFlag,
1336 hint.node(),
1337 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1338 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
1339 return iterator(result);
1340 }
1341// }}} END GENERATED CODE
1342
1343 /// Return a pair of iterators providing modifiable access to the
1344 /// sequence of `value_type` objects in this unordered map having the
1345 /// specified `key`, where the first iterator is positioned at the start
1346 /// of the sequence, and the second is positioned one past the end of
1347 /// the sequence. If this unordered map contains no `value_type` object
1348 /// having `key`, then the two returned iterators will have the same value, `end()`.
1349 ///
1350 /// \pre The behavior is undefined unless `key` is
1351 /// equivalent to at most one key in this unordered map.
1352 ///
1353 /// \note Note that since an unordered map maintains unique keys, the range will contain
1354 /// at most one element.
1355 ///
1356 /// Note: implemented inline due to Sun CC compilation error.
1357 template <class LOOKUP_KEY>
1358 typename enable_if<
1359 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1360 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
1361 pair<iterator, iterator> >::type
1362 equal_range(const LOOKUP_KEY& key)
1363 {
1364 typedef bsl::pair<iterator, iterator> ResultType;
1365
1366 HashTableLink *first = d_impl.find(key);
1367 return first
1368 ? ResultType(iterator(first), iterator(first->nextLink()))
1369 : ResultType(iterator(0), iterator(0));
1370 }
1371
1372 /// Return a pair of iterators providing modifiable access to the
1373 /// sequence of `value_type` objects in this unordered map having the
1374 /// specified `key`, where the first iterator is positioned at the start
1375 /// of the sequence, and the second is positioned one past the end of
1376 /// the sequence. If this unordered map contains no `value_type` object
1377 /// having `key`, then the two returned iterators will have the same value, `end()`.
1378 ///
1379 /// \note Note that since an unordered map maintains unique
1380 /// keys, the range will contain at most one element.
1381 pair<iterator, iterator> equal_range(const key_type& key);
1382
1383 /// Set the maximum load factor of this unordered map to the specified
1384 /// `newMaxLoadFactor`. If `newMaxLoadFactor < loadFactor()`, this
1385 /// operator will cause an immediate rehash (in violation of the C++11
1386 /// standard); otherwise, it has a constant-time cost.
1387 ///
1388 /// \pre The behavior is undefined unless `0 < newMaxLoadFactor`.
1389 void max_load_factor(float newMaxLoadFactor);
1390
1391 /// Change the size of the array of buckets maintained by this unordered
1392 /// map to at least the specified `numBuckets`, and redistribute all the
1393 /// contained elements into the new sequence of buckets, according to
1394 /// their hash values. After this call, @ref load_factor will be less than
1395 /// or equal to @ref max_load_factor . This operation has no effect if
1396 /// rehashing the elements into `numBuckets` would cause this map to
1397 /// exceed its @ref max_load_factor .
1398 void rehash(size_type numBuckets);
1399
1400 /// Increase the number of buckets of this set to a quantity such that
1401 /// the ratio between the specified `numElements` and this quantity does not exceed `max_load_factor`.
1402 ///
1403 /// \note Note that this guarantees that, after
1404 /// the reserve, elements can be inserted to grow the container to
1405 /// `size() == numElements` without rehashing. Also note that memory
1406 /// allocations may still occur when growing the container to `size() ==
1407 /// numElements`. Also note that this operation has no effect if
1408 /// `numElements <= size()`.
1409 void reserve(size_type numElements);
1410
1411 /// Exchange the value, hasher, key-equality functor, and
1412 /// @ref max_load_factor of this object with those of the specified `other`
1413 /// object; also exchange the allocator of this object with that of
1414 /// `other` if the (template parameter) type `ALLOCATOR` has the
1415 /// @ref propagate_on_container_swap trait, and do not modify either
1416 /// allocator otherwise. This method provides the no-throw
1417 /// exception-safety guarantee if and only if both the (template
1418 /// parameter) types `HASH` and `EQUAL` provide no-throw swap
1419 /// operations; if an exception is thrown, both objects are left in
1420 /// valid but unspecified states. This operation guarantees `O[1]` complexity.
1421 ///
1422 /// \pre The behavior is undefined unless either this object was
1423 /// created with the same allocator as `other` or `ALLOCATOR` has the
1424 /// @ref propagate_on_container_swap trait.
1426 AllocatorTraits::is_always_equal::value &&
1427 bsl::is_nothrow_swappable<HASH>::value &&
1428 bsl::is_nothrow_swappable<EQUAL>::value);
1429
1430#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1431// {{{ BEGIN GENERATED CODE
1432// Command line: sim_cpp11_features.pl bslstl_unorderedmap.h
1433#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
1434#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT 10
1435#endif
1436#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D
1437#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
1438#endif
1439#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1440 pair<iterator, bool> try_emplace(const KEY& key);
1441#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1442
1443#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1444 template <class Args_01>
1445 pair<iterator, bool> try_emplace(const KEY& key,
1446 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
1447#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1448
1449#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1450 template <class Args_01,
1451 class Args_02>
1452 pair<iterator, bool> try_emplace(const KEY& key,
1453 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1454 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
1455#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1456
1457#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1458 template <class Args_01,
1459 class Args_02,
1460 class Args_03>
1461 pair<iterator, bool> try_emplace(const KEY& key,
1462 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1463 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
1465#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1466
1467#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1468 template <class Args_01,
1469 class Args_02,
1470 class Args_03,
1471 class Args_04>
1472 pair<iterator, bool> try_emplace(const KEY& key,
1473 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1474 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1475 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1476 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
1477#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1478
1479#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1480 template <class Args_01,
1481 class Args_02,
1482 class Args_03,
1483 class Args_04,
1484 class Args_05>
1485 pair<iterator, bool> try_emplace(const KEY& key,
1486 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1487 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1488 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1489 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1490 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
1491#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1492
1493#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1494 template <class Args_01,
1495 class Args_02,
1496 class Args_03,
1497 class Args_04,
1498 class Args_05,
1499 class Args_06>
1500 pair<iterator, bool> try_emplace(const KEY& key,
1501 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1502 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1503 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1504 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1505 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1506 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
1507#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1508
1509#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
1510 template <class Args_01,
1511 class Args_02,
1512 class Args_03,
1513 class Args_04,
1514 class Args_05,
1515 class Args_06,
1516 class Args_07>
1517 pair<iterator, bool> try_emplace(const KEY& key,
1518 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1519 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1520 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1521 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1522 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1523 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1524 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
1525#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
1526
1527#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
1528 template <class Args_01,
1529 class Args_02,
1530 class Args_03,
1531 class Args_04,
1532 class Args_05,
1533 class Args_06,
1534 class Args_07,
1535 class Args_08>
1536 pair<iterator, bool> try_emplace(const KEY& key,
1537 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1538 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1539 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1540 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1541 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1542 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1543 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1544 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
1545#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
1546
1547#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
1548 template <class Args_01,
1549 class Args_02,
1550 class Args_03,
1551 class Args_04,
1552 class Args_05,
1553 class Args_06,
1554 class Args_07,
1555 class Args_08,
1556 class Args_09>
1557 pair<iterator, bool> try_emplace(const KEY& key,
1558 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1559 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1560 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1561 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1562 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1563 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1564 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1565 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1566 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
1567#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
1568
1569#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
1570 template <class Args_01,
1571 class Args_02,
1572 class Args_03,
1573 class Args_04,
1574 class Args_05,
1575 class Args_06,
1576 class Args_07,
1577 class Args_08,
1578 class Args_09,
1579 class Args_10>
1580 pair<iterator, bool> try_emplace(const KEY& key,
1581 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1582 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1583 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1584 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1585 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1586 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1587 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1588 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1589 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1590 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
1591#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
1592
1593
1594#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1595 pair<iterator, bool> try_emplace(
1596 BloombergLP::bslmf::MovableRef<KEY> key);
1597#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1598
1599#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1600 template <class Args_01>
1601 pair<iterator, bool> try_emplace(
1602 BloombergLP::bslmf::MovableRef<KEY> key,
1603 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
1604#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1605
1606#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1607 template <class Args_01,
1608 class Args_02>
1609 pair<iterator, bool> try_emplace(
1610 BloombergLP::bslmf::MovableRef<KEY> key,
1611 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1612 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
1613#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1614
1615#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1616 template <class Args_01,
1617 class Args_02,
1618 class Args_03>
1619 pair<iterator, bool> try_emplace(
1620 BloombergLP::bslmf::MovableRef<KEY> key,
1621 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1622 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1623 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
1624#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1625
1626#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1627 template <class Args_01,
1628 class Args_02,
1629 class Args_03,
1630 class Args_04>
1631 pair<iterator, bool> try_emplace(
1632 BloombergLP::bslmf::MovableRef<KEY> key,
1633 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1634 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1635 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1636 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
1637#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1638
1639#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1640 template <class Args_01,
1641 class Args_02,
1642 class Args_03,
1643 class Args_04,
1644 class Args_05>
1645 pair<iterator, bool> try_emplace(
1646 BloombergLP::bslmf::MovableRef<KEY> key,
1647 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1648 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1649 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1650 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1651 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
1652#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1653
1654#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1655 template <class Args_01,
1656 class Args_02,
1657 class Args_03,
1658 class Args_04,
1659 class Args_05,
1660 class Args_06>
1661 pair<iterator, bool> try_emplace(
1662 BloombergLP::bslmf::MovableRef<KEY> key,
1663 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1664 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1665 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1666 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1667 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1668 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
1669#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1670
1671#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
1672 template <class Args_01,
1673 class Args_02,
1674 class Args_03,
1675 class Args_04,
1676 class Args_05,
1677 class Args_06,
1678 class Args_07>
1679 pair<iterator, bool> try_emplace(
1680 BloombergLP::bslmf::MovableRef<KEY> key,
1681 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1682 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1683 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1684 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1685 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1686 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1687 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
1688#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
1689
1690#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
1691 template <class Args_01,
1692 class Args_02,
1693 class Args_03,
1694 class Args_04,
1695 class Args_05,
1696 class Args_06,
1697 class Args_07,
1698 class Args_08>
1699 pair<iterator, bool> try_emplace(
1700 BloombergLP::bslmf::MovableRef<KEY> key,
1701 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1702 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1703 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1704 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1705 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1706 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1707 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1708 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
1709#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
1710
1711#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
1712 template <class Args_01,
1713 class Args_02,
1714 class Args_03,
1715 class Args_04,
1716 class Args_05,
1717 class Args_06,
1718 class Args_07,
1719 class Args_08,
1720 class Args_09>
1721 pair<iterator, bool> try_emplace(
1722 BloombergLP::bslmf::MovableRef<KEY> key,
1723 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1724 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1725 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1726 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1727 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1728 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1729 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1730 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1731 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
1732#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
1733
1734#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
1735 template <class Args_01,
1736 class Args_02,
1737 class Args_03,
1738 class Args_04,
1739 class Args_05,
1740 class Args_06,
1741 class Args_07,
1742 class Args_08,
1743 class Args_09,
1744 class Args_10>
1745 pair<iterator, bool> try_emplace(
1746 BloombergLP::bslmf::MovableRef<KEY> key,
1747 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1748 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1749 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1750 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1751 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1752 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1753 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1754 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1755 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1756 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
1757#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
1758
1759
1760#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1761 template<class LOOKUP_KEY>
1762 typename bsl::enable_if<
1763 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1764 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1766 const_iterator>::value
1768 iterator>::value,
1769 pair<iterator, bool> >::type
1771 {
1772 typedef bsl::pair<iterator, bool> ResultType;
1773 bool isInsertedFlag = false;
1774 HashTableLink *result = d_impl.tryEmplace(
1775 &isInsertedFlag,
1776 NULL,
1777 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key));
1778
1779 return ResultType(iterator(result), isInsertedFlag);
1780 }
1781#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
1782
1783#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1784 template<class LOOKUP_KEY, class Args_01>
1785 typename bsl::enable_if<
1786 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1787 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1789 const_iterator>::value
1791 iterator>::value,
1792 pair<iterator, bool> >::type
1794 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
1795 {
1796 typedef bsl::pair<iterator, bool> ResultType;
1797 bool isInsertedFlag = false;
1798 HashTableLink *result = d_impl.tryEmplace(
1799 &isInsertedFlag,
1800 NULL,
1801 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1802 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
1803
1804 return ResultType(iterator(result), isInsertedFlag);
1805 }
1806#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
1807
1808#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1809 template<class LOOKUP_KEY, class Args_01,
1810 class Args_02>
1811 typename bsl::enable_if<
1812 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1813 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1815 const_iterator>::value
1817 iterator>::value,
1818 pair<iterator, bool> >::type
1820 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1821 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
1822 {
1823 typedef bsl::pair<iterator, bool> ResultType;
1824 bool isInsertedFlag = false;
1825 HashTableLink *result = d_impl.tryEmplace(
1826 &isInsertedFlag,
1827 NULL,
1828 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1829 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1830 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
1831
1832 return ResultType(iterator(result), isInsertedFlag);
1833 }
1834#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
1835
1836#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1837 template<class LOOKUP_KEY, class Args_01,
1838 class Args_02,
1839 class Args_03>
1840 typename bsl::enable_if<
1841 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1842 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1844 const_iterator>::value
1846 iterator>::value,
1847 pair<iterator, bool> >::type
1849 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1850 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1851 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
1852 {
1853 typedef bsl::pair<iterator, bool> ResultType;
1854 bool isInsertedFlag = false;
1855 HashTableLink *result = d_impl.tryEmplace(
1856 &isInsertedFlag,
1857 NULL,
1858 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1859 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1860 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1861 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
1862
1863 return ResultType(iterator(result), isInsertedFlag);
1864 }
1865#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
1866
1867#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1868 template<class LOOKUP_KEY, class Args_01,
1869 class Args_02,
1870 class Args_03,
1871 class Args_04>
1872 typename bsl::enable_if<
1873 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1874 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1876 const_iterator>::value
1878 iterator>::value,
1879 pair<iterator, bool> >::type
1881 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1882 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1883 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1884 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
1885 {
1886 typedef bsl::pair<iterator, bool> ResultType;
1887 bool isInsertedFlag = false;
1888 HashTableLink *result = d_impl.tryEmplace(
1889 &isInsertedFlag,
1890 NULL,
1891 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1892 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1893 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1894 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1895 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
1896
1897 return ResultType(iterator(result), isInsertedFlag);
1898 }
1899#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
1900
1901#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1902 template<class LOOKUP_KEY, class Args_01,
1903 class Args_02,
1904 class Args_03,
1905 class Args_04,
1906 class Args_05>
1907 typename bsl::enable_if<
1908 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1909 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1911 const_iterator>::value
1913 iterator>::value,
1914 pair<iterator, bool> >::type
1916 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1917 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1918 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1919 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1920 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
1921 {
1922 typedef bsl::pair<iterator, bool> ResultType;
1923 bool isInsertedFlag = false;
1924 HashTableLink *result = d_impl.tryEmplace(
1925 &isInsertedFlag,
1926 NULL,
1927 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1928 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1929 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1930 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1931 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
1932 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
1933
1934 return ResultType(iterator(result), isInsertedFlag);
1935 }
1936#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
1937
1938#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1939 template<class LOOKUP_KEY, class Args_01,
1940 class Args_02,
1941 class Args_03,
1942 class Args_04,
1943 class Args_05,
1944 class Args_06>
1945 typename bsl::enable_if<
1946 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1947 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1949 const_iterator>::value
1951 iterator>::value,
1952 pair<iterator, bool> >::type
1954 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1955 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1956 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1957 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1958 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1959 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
1960 {
1961 typedef bsl::pair<iterator, bool> ResultType;
1962 bool isInsertedFlag = false;
1963 HashTableLink *result = d_impl.tryEmplace(
1964 &isInsertedFlag,
1965 NULL,
1966 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1967 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1968 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1969 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1970 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
1971 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
1972 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
1973
1974 return ResultType(iterator(result), isInsertedFlag);
1975 }
1976#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
1977
1978#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
1979 template<class LOOKUP_KEY, class Args_01,
1980 class Args_02,
1981 class Args_03,
1982 class Args_04,
1983 class Args_05,
1984 class Args_06,
1985 class Args_07>
1986 typename bsl::enable_if<
1987 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1988 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1990 const_iterator>::value
1992 iterator>::value,
1993 pair<iterator, bool> >::type
1995 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1996 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1997 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1998 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1999 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2000 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2001 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
2002 {
2003 typedef bsl::pair<iterator, bool> ResultType;
2004 bool isInsertedFlag = false;
2005 HashTableLink *result = d_impl.tryEmplace(
2006 &isInsertedFlag,
2007 NULL,
2008 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2009 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2010 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2011 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2012 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2013 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2014 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2015 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
2016
2017 return ResultType(iterator(result), isInsertedFlag);
2018 }
2019#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2020
2021#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2022 template<class LOOKUP_KEY, class Args_01,
2023 class Args_02,
2024 class Args_03,
2025 class Args_04,
2026 class Args_05,
2027 class Args_06,
2028 class Args_07,
2029 class Args_08>
2030 typename bsl::enable_if<
2031 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2032 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2034 const_iterator>::value
2036 iterator>::value,
2037 pair<iterator, bool> >::type
2039 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2040 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2041 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2042 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2043 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2044 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2045 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2046 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
2047 {
2048 typedef bsl::pair<iterator, bool> ResultType;
2049 bool isInsertedFlag = false;
2050 HashTableLink *result = d_impl.tryEmplace(
2051 &isInsertedFlag,
2052 NULL,
2053 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2054 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2055 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2056 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2057 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2058 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2059 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2060 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2061 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
2062
2063 return ResultType(iterator(result), isInsertedFlag);
2064 }
2065#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2066
2067#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2068 template<class LOOKUP_KEY, class Args_01,
2069 class Args_02,
2070 class Args_03,
2071 class Args_04,
2072 class Args_05,
2073 class Args_06,
2074 class Args_07,
2075 class Args_08,
2076 class Args_09>
2077 typename bsl::enable_if<
2078 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2079 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2081 const_iterator>::value
2083 iterator>::value,
2084 pair<iterator, bool> >::type
2086 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2087 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2088 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2089 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2090 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2091 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2092 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2093 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2094 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
2095 {
2096 typedef bsl::pair<iterator, bool> ResultType;
2097 bool isInsertedFlag = false;
2098 HashTableLink *result = d_impl.tryEmplace(
2099 &isInsertedFlag,
2100 NULL,
2101 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2102 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2103 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2104 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2105 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2106 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2107 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2108 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2109 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2110 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
2111
2112 return ResultType(iterator(result), isInsertedFlag);
2113 }
2114#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2115
2116#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2117 template<class LOOKUP_KEY, class Args_01,
2118 class Args_02,
2119 class Args_03,
2120 class Args_04,
2121 class Args_05,
2122 class Args_06,
2123 class Args_07,
2124 class Args_08,
2125 class Args_09,
2126 class Args_10>
2127 typename bsl::enable_if<
2128 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2129 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2131 const_iterator>::value
2133 iterator>::value,
2134 pair<iterator, bool> >::type
2136 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2137 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2138 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2139 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2140 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2141 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2142 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2144 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2145 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
2146 {
2147 typedef bsl::pair<iterator, bool> ResultType;
2148 bool isInsertedFlag = false;
2149 HashTableLink *result = d_impl.tryEmplace(
2150 &isInsertedFlag,
2151 NULL,
2152 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2153 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2154 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2155 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2156 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2157 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2158 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2159 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2160 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2161 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
2162 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
2163
2164 return ResultType(iterator(result), isInsertedFlag);
2165 }
2166#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2167
2168
2169#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2170 iterator
2171 try_emplace(const_iterator hint, const KEY& key);
2172#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2173
2174#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2175 template<class Args_01>
2176 iterator
2177 try_emplace(const_iterator hint, const KEY& key,
2178 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
2179#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2180
2181#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2182 template<class Args_01,
2183 class Args_02>
2184 iterator
2185 try_emplace(const_iterator hint, const KEY& key,
2186 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2187 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
2188#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2189
2190#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2191 template<class Args_01,
2192 class Args_02,
2193 class Args_03>
2194 iterator
2195 try_emplace(const_iterator hint, const KEY& key,
2196 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2197 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2198 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
2199#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2200
2201#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2202 template<class Args_01,
2203 class Args_02,
2204 class Args_03,
2205 class Args_04>
2206 iterator
2207 try_emplace(const_iterator hint, const KEY& key,
2208 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2209 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2210 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2211 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
2212#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2213
2214#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2215 template<class Args_01,
2216 class Args_02,
2217 class Args_03,
2218 class Args_04,
2219 class Args_05>
2220 iterator
2221 try_emplace(const_iterator hint, const KEY& key,
2222 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2223 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2224 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2225 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2226 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
2227#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2228
2229#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2230 template<class Args_01,
2231 class Args_02,
2232 class Args_03,
2233 class Args_04,
2234 class Args_05,
2235 class Args_06>
2236 iterator
2237 try_emplace(const_iterator hint, const KEY& key,
2238 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2239 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2240 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2241 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2242 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2243 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
2244#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2245
2246#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2247 template<class Args_01,
2248 class Args_02,
2249 class Args_03,
2250 class Args_04,
2251 class Args_05,
2252 class Args_06,
2253 class Args_07>
2254 iterator
2255 try_emplace(const_iterator hint, const KEY& key,
2256 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2257 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2258 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2259 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2260 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2261 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2262 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
2263#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2264
2265#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2266 template<class Args_01,
2267 class Args_02,
2268 class Args_03,
2269 class Args_04,
2270 class Args_05,
2271 class Args_06,
2272 class Args_07,
2273 class Args_08>
2274 iterator
2275 try_emplace(const_iterator hint, const KEY& key,
2276 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2277 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2278 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2279 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2280 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2281 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2282 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2283 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
2284#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2285
2286#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2287 template<class Args_01,
2288 class Args_02,
2289 class Args_03,
2290 class Args_04,
2291 class Args_05,
2292 class Args_06,
2293 class Args_07,
2294 class Args_08,
2295 class Args_09>
2296 iterator
2297 try_emplace(const_iterator hint, const KEY& key,
2298 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2299 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2300 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2301 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2302 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2303 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2304 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2305 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2306 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
2307#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2308
2309#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2310 template<class Args_01,
2311 class Args_02,
2312 class Args_03,
2313 class Args_04,
2314 class Args_05,
2315 class Args_06,
2316 class Args_07,
2317 class Args_08,
2318 class Args_09,
2319 class Args_10>
2320 iterator
2321 try_emplace(const_iterator hint, const KEY& key,
2322 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2323 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2324 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2325 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2326 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2327 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2328 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2329 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
2332#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2333
2334
2335#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2337 BloombergLP::bslmf::MovableRef<KEY> key);
2338#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2339
2340#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2341 template <class Args_01>
2343 BloombergLP::bslmf::MovableRef<KEY> key,
2344 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
2345#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2346
2347#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2348 template <class Args_01,
2349 class Args_02>
2351 BloombergLP::bslmf::MovableRef<KEY> key,
2352 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
2354#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2355
2356#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2357 template <class Args_01,
2358 class Args_02,
2359 class Args_03>
2361 BloombergLP::bslmf::MovableRef<KEY> key,
2362 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2363 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2364 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
2365#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2366
2367#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2368 template <class Args_01,
2369 class Args_02,
2370 class Args_03,
2371 class Args_04>
2373 BloombergLP::bslmf::MovableRef<KEY> key,
2374 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2375 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2376 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2377 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
2378#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2379
2380#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2381 template <class Args_01,
2382 class Args_02,
2383 class Args_03,
2384 class Args_04,
2385 class Args_05>
2387 BloombergLP::bslmf::MovableRef<KEY> key,
2388 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2389 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2390 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2391 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2392 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
2393#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2394
2395#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2396 template <class Args_01,
2397 class Args_02,
2398 class Args_03,
2399 class Args_04,
2400 class Args_05,
2401 class Args_06>
2403 BloombergLP::bslmf::MovableRef<KEY> key,
2404 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2405 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2406 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2407 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2408 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2409 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
2410#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2411
2412#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2413 template <class Args_01,
2414 class Args_02,
2415 class Args_03,
2416 class Args_04,
2417 class Args_05,
2418 class Args_06,
2419 class Args_07>
2421 BloombergLP::bslmf::MovableRef<KEY> key,
2422 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2423 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2424 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2425 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2426 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2427 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2428 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
2429#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2430
2431#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2432 template <class Args_01,
2433 class Args_02,
2434 class Args_03,
2435 class Args_04,
2436 class Args_05,
2437 class Args_06,
2438 class Args_07,
2439 class Args_08>
2441 BloombergLP::bslmf::MovableRef<KEY> key,
2442 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2443 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2444 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2445 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2446 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2447 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2448 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2449 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
2450#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2451
2452#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2453 template <class Args_01,
2454 class Args_02,
2455 class Args_03,
2456 class Args_04,
2457 class Args_05,
2458 class Args_06,
2459 class Args_07,
2460 class Args_08,
2461 class Args_09>
2463 BloombergLP::bslmf::MovableRef<KEY> key,
2464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2465 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2466 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2467 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2468 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2469 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2470 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2471 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2472 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
2473#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2474
2475#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2476 template <class Args_01,
2477 class Args_02,
2478 class Args_03,
2479 class Args_04,
2480 class Args_05,
2481 class Args_06,
2482 class Args_07,
2483 class Args_08,
2484 class Args_09,
2485 class Args_10>
2487 BloombergLP::bslmf::MovableRef<KEY> key,
2488 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2489 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2490 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2491 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2492 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2493 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2494 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2495 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2496 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2497 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
2498#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2499
2500
2501#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2502 template<class LOOKUP_KEY>
2503 typename bsl::enable_if<
2504 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2505 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2506 iterator>::type
2508 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key)
2509 {
2510 bool isInsertedFlag = false;
2511 HashTableLink *result = d_impl.tryEmplace(
2512 &isInsertedFlag,
2513 hint.node(),
2514 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key));
2515
2516 return iterator(result);
2517 }
2518#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 0
2519
2520#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2521 template<class LOOKUP_KEY, class Args_01>
2522 typename bsl::enable_if<
2523 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2524 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2525 iterator>::type
2527 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2528 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
2529 {
2530 bool isInsertedFlag = false;
2531 HashTableLink *result = d_impl.tryEmplace(
2532 &isInsertedFlag,
2533 hint.node(),
2534 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2535 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
2536
2537 return iterator(result);
2538 }
2539#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 1
2540
2541#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2542 template<class LOOKUP_KEY, class Args_01,
2543 class Args_02>
2544 typename bsl::enable_if<
2545 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2546 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2547 iterator>::type
2549 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2550 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2551 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
2552 {
2553 bool isInsertedFlag = false;
2554 HashTableLink *result = d_impl.tryEmplace(
2555 &isInsertedFlag,
2556 hint.node(),
2557 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2558 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2559 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
2560
2561 return iterator(result);
2562 }
2563#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 2
2564
2565#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2566 template<class LOOKUP_KEY, class Args_01,
2567 class Args_02,
2568 class Args_03>
2569 typename bsl::enable_if<
2570 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2571 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2572 iterator>::type
2574 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2575 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2576 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2577 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
2578 {
2579 bool isInsertedFlag = false;
2580 HashTableLink *result = d_impl.tryEmplace(
2581 &isInsertedFlag,
2582 hint.node(),
2583 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2584 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2585 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2586 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
2587
2588 return iterator(result);
2589 }
2590#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 3
2591
2592#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2593 template<class LOOKUP_KEY, class Args_01,
2594 class Args_02,
2595 class Args_03,
2596 class Args_04>
2597 typename bsl::enable_if<
2598 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2599 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2600 iterator>::type
2602 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2603 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2604 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2605 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2606 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
2607 {
2608 bool isInsertedFlag = false;
2609 HashTableLink *result = d_impl.tryEmplace(
2610 &isInsertedFlag,
2611 hint.node(),
2612 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2613 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2614 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2615 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2616 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
2617
2618 return iterator(result);
2619 }
2620#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 4
2621
2622#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2623 template<class LOOKUP_KEY, class Args_01,
2624 class Args_02,
2625 class Args_03,
2626 class Args_04,
2627 class Args_05>
2628 typename bsl::enable_if<
2629 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2630 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2631 iterator>::type
2633 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2634 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2635 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2636 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2637 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2638 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
2639 {
2640 bool isInsertedFlag = false;
2641 HashTableLink *result = d_impl.tryEmplace(
2642 &isInsertedFlag,
2643 hint.node(),
2644 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2645 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2646 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2647 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2648 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2649 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
2650
2651 return iterator(result);
2652 }
2653#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 5
2654
2655#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2656 template<class LOOKUP_KEY, class Args_01,
2657 class Args_02,
2658 class Args_03,
2659 class Args_04,
2660 class Args_05,
2661 class Args_06>
2662 typename bsl::enable_if<
2663 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2664 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2665 iterator>::type
2667 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2668 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2669 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2670 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2671 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2672 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2673 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
2674 {
2675 bool isInsertedFlag = false;
2676 HashTableLink *result = d_impl.tryEmplace(
2677 &isInsertedFlag,
2678 hint.node(),
2679 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2680 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2681 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2682 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2683 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2684 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2685 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
2686
2687 return iterator(result);
2688 }
2689#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 6
2690
2691#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2692 template<class LOOKUP_KEY, class Args_01,
2693 class Args_02,
2694 class Args_03,
2695 class Args_04,
2696 class Args_05,
2697 class Args_06,
2698 class Args_07>
2699 typename bsl::enable_if<
2700 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2701 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2702 iterator>::type
2704 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2705 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2706 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2707 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2708 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2709 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2710 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2711 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
2712 {
2713 bool isInsertedFlag = false;
2714 HashTableLink *result = d_impl.tryEmplace(
2715 &isInsertedFlag,
2716 hint.node(),
2717 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2718 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2719 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2720 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2721 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2722 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2723 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2724 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
2725
2726 return iterator(result);
2727 }
2728#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 7
2729
2730#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2731 template<class LOOKUP_KEY, class Args_01,
2732 class Args_02,
2733 class Args_03,
2734 class Args_04,
2735 class Args_05,
2736 class Args_06,
2737 class Args_07,
2738 class Args_08>
2739 typename bsl::enable_if<
2740 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2741 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2742 iterator>::type
2744 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2745 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2746 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2747 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2748 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2749 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2750 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2751 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2752 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
2753 {
2754 bool isInsertedFlag = false;
2755 HashTableLink *result = d_impl.tryEmplace(
2756 &isInsertedFlag,
2757 hint.node(),
2758 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2759 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2760 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2761 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2762 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2763 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2764 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2765 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2766 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
2767
2768 return iterator(result);
2769 }
2770#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 8
2771
2772#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2773 template<class LOOKUP_KEY, class Args_01,
2774 class Args_02,
2775 class Args_03,
2776 class Args_04,
2777 class Args_05,
2778 class Args_06,
2779 class Args_07,
2780 class Args_08,
2781 class Args_09>
2782 typename bsl::enable_if<
2783 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2784 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2785 iterator>::type
2787 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2788 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2789 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2790 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2791 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2792 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2793 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2794 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2795 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2796 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
2797 {
2798 bool isInsertedFlag = false;
2799 HashTableLink *result = d_impl.tryEmplace(
2800 &isInsertedFlag,
2801 hint.node(),
2802 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2803 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2804 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2805 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2806 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2807 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2808 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2809 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2810 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2811 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
2812
2813 return iterator(result);
2814 }
2815#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 9
2816
2817#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2818 template<class LOOKUP_KEY, class Args_01,
2819 class Args_02,
2820 class Args_03,
2821 class Args_04,
2822 class Args_05,
2823 class Args_06,
2824 class Args_07,
2825 class Args_08,
2826 class Args_09,
2827 class Args_10>
2828 typename bsl::enable_if<
2829 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2830 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2831 iterator>::type
2833 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2834 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2835 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2836 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2837 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2838 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2839 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2840 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2841 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2842 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2843 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
2844 {
2845 bool isInsertedFlag = false;
2846 HashTableLink *result = d_impl.tryEmplace(
2847 &isInsertedFlag,
2848 hint.node(),
2849 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2850 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2851 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2852 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2853 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2854 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2855 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2856 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2857 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2858 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
2859 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
2860
2861 return iterator(result);
2862 }
2863#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_D >= 10
2864
2865#else
2866// The generated code below is a workaround for the absence of perfect
2867// forwarding in some compilers.
2868 template <class... Args>
2869 pair<iterator, bool> try_emplace(const KEY& key,
2870 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
2871
2872 template <class... Args>
2873 pair<iterator, bool> try_emplace(
2874 BloombergLP::bslmf::MovableRef<KEY> key,
2875 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
2876
2877 template<class LOOKUP_KEY, class... Args>
2878 typename bsl::enable_if<
2879 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2880 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2882 const_iterator>::value
2884 iterator>::value,
2885 pair<iterator, bool> >::type
2888 {
2889 typedef bsl::pair<iterator, bool> ResultType;
2890 bool isInsertedFlag = false;
2891 HashTableLink *result = d_impl.tryEmplace(
2892 &isInsertedFlag,
2893 NULL,
2894 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2895 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
2896
2897 return ResultType(iterator(result), isInsertedFlag);
2898 }
2899
2900 template<class... Args>
2901 iterator
2902 try_emplace(const_iterator hint, const KEY& key,
2903 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
2904
2905 template <class... Args>
2907 BloombergLP::bslmf::MovableRef<KEY> key,
2908 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
2909
2910 template<class LOOKUP_KEY, class... Args>
2911 typename bsl::enable_if<
2912 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2913 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2914 iterator>::type
2916 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2918 {
2919 bool isInsertedFlag = false;
2920 HashTableLink *result = d_impl.tryEmplace(
2921 &isInsertedFlag,
2922 hint.node(),
2923 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2924 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
2925
2926 return iterator(result);
2927 }
2928// }}} END GENERATED CODE
2929#endif
2930
2931 public:
2932 // ACCESSORS
2933
2934 /// Return a reference providing non-modifiable access to the
2935 /// mapped-value associated with the specified `key`, if such an entry
2936 /// exists; otherwise throw a `std::out_of_range` exception.
2937 ///
2938 /// \note Note that this method is not exception-neutral.
2940 const;
2941
2942 /// Return a reference providing non-modifiable access to the
2943 /// mapped-value associated with a key that is equivalent to the
2944 /// specified `key`, if such an entry exists; otherwise, throw a `std::out_of_range` exception.
2945 ///
2946 /// \note Note that this method may also throw
2947 /// a different kind of exception if the (user-supplied) comparator
2948 /// throws.
2949 ///
2950 /// Note: implemented inline due to Sun CC compilation error
2951 template <class LOOKUP_KEY>
2952 typename bsl::enable_if<
2953 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2954 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
2956 at(const LOOKUP_KEY& key) const {
2957 HashTableLink *node = d_impl.find(key);
2958
2959 if (!node) {
2960 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
2961 "unordered_map<...>::at(LOOKUP_KEY) const: invalid key value");
2962 }
2963 return static_cast<HashTableNode *>(node)->value().second;
2964 }
2965
2967
2968 /// Return an iterator providing non-modifiable access to the first
2969 /// `value_type` object in the sequence of `value_type` objects
2970 /// maintained by this unordered map, or the `end` iterator if this
2971 /// unordered map is empty.
2973
2975
2976 /// Return an iterator providing non-modifiable access to the
2977 /// past-the-end position in the sequence of `value_type` objects
2978 /// maintained by this unordered map.
2980
2982
2983 /// Return a local iterator providing non-modifiable access to the first
2984 /// `value_type` object in the sequence of `value_type` objects of the
2985 /// bucket having the specified `index` in the array of buckets
2986 /// maintained by this unordered map, or the `end(index)` iterator if the bucket is empty.
2987 ///
2988 /// \pre The behavior is undefined unless
2989 /// `index < bucket_count()`.
2991
2992 const_local_iterator end(size_type index) const;
2993
2994 /// Return a local iterator providing non-modifiable access to the
2995 /// past-the-end position in the sequence of `value_type` objects of the
2996 /// bucket having the specified `index` in the array of buckets maintained by this unordered map.
2997 ///
2998 /// \pre The behavior is undefined unless
2999 /// `index < bucket_count()`.
3000 const_local_iterator cend(size_type index) const;
3001
3002 /// Return the index of the bucket, in the array of buckets maintained
3003 /// by this unordered map, where values having a key equivalent to the
3004 /// specified `key` would be inserted.
3005 size_type bucket(const key_type& key) const;
3006
3007 /// Return the index of the bucket, in the array of buckets maintained
3008 /// by this unordered map, where values having a key equivalent to the
3009 /// specified `key` would be inserted.
3010 ///
3011 /// Note: implemented inline due to Sun CC compilation error.
3012 template <class LOOKUP_KEY>
3013 typename enable_if<
3014 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
3015 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
3016 size_type>::type
3017 bucket(const LOOKUP_KEY& key) const
3018 {
3019 return d_impl.bucketIndexForKey(key);
3020 }
3021
3022 /// Return the number of buckets in the array of buckets maintained by
3023 /// this unordered map.
3025
3026 /// Return a theoretical upper bound on the largest number of buckets that this unordered map could possibly manage.
3027 ///
3028 /// \note Note that there is
3029 /// no guarantee that the unordered map can successfully grow to the
3030 /// returned size, or even close to that size, without running out of
3031 /// resources.
3033
3034 /// Return the number of elements contained in the bucket at the
3035 /// specified `index` in the array of buckets maintained by this unordered map.
3036 ///
3037 /// \pre The behavior is undefined unless
3038 /// `index < bucket_count()`.
3039 size_type bucket_size(size_type index) const;
3040
3041 /// Return the number of `value_type` objects within this unordered map
3042 /// that have a key equivalent to the specified `key`.
3043 ///
3044 /// \pre The behavior is undefined unless `key` is equivalent to at most one key in this unordered map.
3045 ///
3046 /// \note Note that since an unordered map maintains unique
3047 /// keys, the returned value will be either 0 or 1.
3048 ///
3049 /// Note: implemented inline due to Sun CC compilation error.
3050 template <class LOOKUP_KEY>
3051 typename enable_if<
3052 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
3053 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
3054 size_type>::type
3055 count(const LOOKUP_KEY& key) const
3056 {
3057 return d_impl.find(key) != 0;
3058 }
3059
3060 /// Return the number of `value_type` objects contained within this unordered map having the specified `key`.
3061 ///
3062 /// \note Note that since an
3063 /// unordered map maintains unique keys, the returned value will be
3064 /// either 0 or 1.
3065 size_type count(const key_type& key) const;
3066
3067 /// Return `true` if this unordered map contains an element whose key is
3068 /// equivalent to the specified `key`.
3069 bool contains(const key_type &key) const;
3070
3071 /// Return `true` if this unordered map contains an element whose key is
3072 /// equivalent to the specified `key`.
3073 ///
3074 /// Note: implemented inline due to Sun CC compilation error
3075 template <class LOOKUP_KEY>
3076 typename enable_if<
3077 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value &&
3078 BloombergLP::bslmf::IsTransparentPredicate<EQUAL,
3079 LOOKUP_KEY>::value,
3080 bool>::type
3081 contains(const LOOKUP_KEY& key) const
3082 {
3083 return find(key) != end();
3084 }
3085
3086 /// Return `true` if this unordered map contains no elements, and
3087 /// `false` otherwise.
3088 bool empty() const BSLS_KEYWORD_NOEXCEPT;
3089
3090 /// Return a pair of iterators providing non-modifiable access to the
3091 /// sequence of `value_type` objects in this unordered map with a key
3092 /// equivalent to specified `key`, where the first iterator is
3093 /// positioned at the start of the sequence, and the second is
3094 /// positioned one past the end of the sequence. If this unordered map
3095 /// contains no `value_type` objects having a key equivalent to `key`,
3096 /// then the two returned iterators will have the same value, `end()`.
3097 ///
3098 /// \pre The behavior is undefined unless `key` is equivalent to at most one key in this unordered map.
3099 ///
3100 /// \note Note that since an unordered map
3101 /// maintains unique keys, the range will contain at most one element.
3102 ///
3103 /// Note: implemented inline due to Sun CC compilation error.
3104 template <class LOOKUP_KEY>
3105 typename enable_if<
3106 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
3107 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
3108 pair<const_iterator, const_iterator> >::type
3109 equal_range(const LOOKUP_KEY& key) const
3110 {
3112
3113 HashTableLink *first = d_impl.find(key);
3114 return first
3115 ? ResultType(iterator(first), iterator(first->nextLink()))
3116 : ResultType(iterator(0), iterator(0));
3117 }
3118
3119 /// Return a pair of iterators providing non-modifiable access to the
3120 /// sequence of `value_type` objects in this unordered map having the
3121 /// specified `key`, where the first iterator is positioned at the start
3122 /// of the sequence, and the second is positioned one past the end of
3123 /// the sequence. If this unordered map contains no `value_type` object
3124 /// having `key`, then the two returned iterators will have the same value, `end()`.
3125 ///
3126 /// \note Note that since an unordered map maintains unique
3127 /// keys, the range will contain at most one element.
3128 pair<const_iterator, const_iterator> equal_range(
3129 const key_type& key) const;
3130
3131 /// Return an iterator providing non-modifiable access to the
3132 /// `value_type` object in this unordered map with a key equivalent to
3133 /// the specified `key`, if such an entry exists, and the past-the-end iterator (`end`) otherwise.
3134 ///
3135 /// \pre The behavior is undefined unless `key`
3136 /// is equivalent to at most one key in this unordered map.
3137 ///
3138 /// Note: implemented inline due to Sun CC compilation error.
3139 template <class LOOKUP_KEY>
3140 typename enable_if<
3141 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
3142 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value,
3143 const_iterator>::type
3144 find(const LOOKUP_KEY& key) const
3145 {
3146 return const_iterator(d_impl.find(key));
3147 }
3148
3149 /// Return an iterator providing non-modifiable access to the
3150 /// `value_type` object in this unordered map with a key equivalent to
3151 /// the specified `key`, if such an entry exists, and the past-the-end
3152 /// iterator (`end`) otherwise.
3153 const_iterator find(const key_type& key) const;
3154
3155 /// Return (a copy of) the allocator used for memory allocation by this
3156 /// unordered map.
3158
3159 /// Return (a copy of) the unary hash functor used by this unordered map
3160 /// to generate a hash value (of type `size_type`) for a `key_type`
3161 /// object.
3162 HASH hash_function() const;
3163
3164 /// Return (a copy of) binary the key-equality functor used by this
3165 /// unordered map that returns `true` if two `key_type` objects are
3166 /// equivalent, and `false` otherwise.
3167 EQUAL key_eq() const;
3168
3169 /// Return the current ratio between the `size` of this unordered map
3170 /// and the number of buckets. The load factor is a measure of how
3171 /// full the container is, and a higher load factor typically leads to
3172 /// an increased number of collisions, thus resulting in a loss of
3173 /// performance.
3174 float load_factor() const BSLS_KEYWORD_NOEXCEPT;
3175
3176 /// Return the maximum load factor allowed for this unordered map.
3177 ///
3178 /// \note Note that if an insert operation would cause the load factor to exceed
3179 /// the @ref max_load_factor , that same insert operation will increase the
3180 /// number of buckets and rehash the elements of the container into
3181 /// those buckets (see `rehash`).
3183
3184 /// Return the number of elements in this unordered map.
3186
3187 /// Return a theoretical upper bound on the largest number of elements that this unordered map could possibly hold.
3188 ///
3189 /// \note Note that there is no
3190 /// guarantee that the unordered map can successfully grow to the
3191 /// returned size, or even close to that size, without running out of
3192 /// resources.
3194};
3195
3196#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3197// CLASS TEMPLATE DEDUCTION GUIDES
3198
3199/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3200/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3201/// the template parameters `HASH`, `EQUAL` and `ALLOCATOR` from the other
3202/// parameters passed to the constructor of `unordered_map`. This deduction
3203/// guide does not participate unless: (1) the supplied `HASH` is invokable
3204/// with a `KEY`, (2) the supplied `EQUAL` is invokable with two `KEY`s, and
3205/// (3) the supplied allocator meets the requirements of a standard
3206/// allocator.
3207template <
3208 class INPUT_ITERATOR,
3209 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3210 class VALUE =
3211 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3212 class HASH = bsl::hash<KEY>,
3213 class EQUAL = bsl::equal_to<KEY>,
3214 class ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
3215 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
3216 class = bsl::enable_if_t<
3217 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
3218 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3219 >
3220unordered_map(INPUT_ITERATOR,
3221 INPUT_ITERATOR,
3222 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
3223 HASH = HASH(),
3224 EQUAL = EQUAL(),
3225 ALLOCATOR = ALLOCATOR())
3226-> unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>;
3227
3228/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3229/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3230/// the template parameters `HASH` and "EQUAL' from the other parameters
3231/// passed to the constructor of `unordered_map`. This deduction guide does
3232/// not participate unless the supplied allocator is convertible to
3233/// `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3234template <
3235 class INPUT_ITERATOR,
3236 class HASH,
3237 class EQUAL,
3238 class ALLOC,
3239 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3240 class VALUE =
3241 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3242 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
3243 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3244 >
3245unordered_map(INPUT_ITERATOR,
3246 INPUT_ITERATOR,
3247 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3248 HASH,
3249 EQUAL,
3250 ALLOC *)
3251-> unordered_map<KEY, VALUE, HASH, EQUAL>;
3252
3253/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3254/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3255/// the template parameters `HASH` and `ALLOCATOR` from the other
3256/// parameters passed to the constructor of `unordered_map`. This deduction
3257/// guide does not participate unless the supplied hash is invokable with a
3258/// `KEY` and the supplied allocator meets the requirements of a standard
3259/// allocator.
3260template <
3261 class INPUT_ITERATOR,
3262 class HASH,
3263 class ALLOCATOR,
3264 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3265 class VALUE =
3266 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3267 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
3268 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3269 >
3270unordered_map(INPUT_ITERATOR,
3271 INPUT_ITERATOR,
3272 typename bsl::allocator_traits<ALLOCATOR>::size_type,
3273 HASH,
3274 ALLOCATOR)
3275-> unordered_map<KEY, VALUE, HASH, bsl::equal_to<KEY>, ALLOCATOR>;
3276
3277/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3278/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3279/// the template parameter `HASH` from the other parameters passed to the
3280/// constructor of `unordered_map`. This deduction guide does not
3281/// participate unless the supplied allocator is convertible to
3282/// `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3283template <
3284 class INPUT_ITERATOR,
3285 class HASH,
3286 class ALLOC,
3287 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3288 class VALUE =
3289 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3290 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3291 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3292 >
3293unordered_map(INPUT_ITERATOR,
3294 INPUT_ITERATOR,
3295 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3296 HASH,
3297 ALLOC *)
3298-> unordered_map<KEY, VALUE, HASH>;
3299
3300/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3301/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3302/// the template parameter `ALLOCATOR` from the other parameter passed to
3303/// the constructor of `unordered_map`. This deduction guide does not
3304/// participate unless the supplied allocator meets the requirements of a
3305/// standard allocator.
3306template <
3307 class INPUT_ITERATOR,
3308 class ALLOCATOR,
3309 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3310 class VALUE =
3311 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3312 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3313 >
3314unordered_map(INPUT_ITERATOR,
3315 INPUT_ITERATOR,
3316 typename bsl::allocator_traits<ALLOCATOR>::size_type,
3317 ALLOCATOR)
3318-> unordered_map<KEY, VALUE, bsl::hash<KEY>, bsl::equal_to<KEY>, ALLOCATOR>;
3319
3320/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3321/// of the iterators supplied to the constructor of `unordered_map`. This
3322/// deduction guide does not participate unless the supplied allocator is
3323/// convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3324template <
3325 class INPUT_ITERATOR,
3326 class ALLOC,
3327 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3328 class VALUE =
3329 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3330 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3331 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3332 >
3333unordered_map(INPUT_ITERATOR,
3334 INPUT_ITERATOR,
3335 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3336 ALLOC *)
3337-> unordered_map<KEY, VALUE>;
3338
3339/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3340/// of the iterators supplied to the constructor of `unordered_map`. Deduce
3341/// the template parameter `ALLOCATOR` from the other parameter passed to
3342/// the constructor of `unordered_map`. This deduction guide does not
3343/// participate unless the supplied allocator meets the requirements of a
3344/// standard allocator.
3345template <
3346 class INPUT_ITERATOR,
3347 class ALLOCATOR,
3348 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3349 class VALUE =
3350 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3351 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3352 >
3353unordered_map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR)
3354-> unordered_map<KEY, VALUE, bsl::hash<KEY>, bsl::equal_to<KEY>, ALLOCATOR>;
3355
3356/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3357/// of the iterators supplied to the constructor of `unordered_map`. This
3358/// deduction guide does not participate unless the supplied allocator is
3359/// convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3360template <
3361 class INPUT_ITERATOR,
3362 class ALLOC,
3363 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
3364 class VALUE =
3365 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
3366 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3367 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3368 >
3369unordered_map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
3370-> unordered_map<KEY, VALUE>;
3371
3372/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3373/// of the initializer_list supplied to the constructor of `unordered_map`.
3374/// Deduce the template parameters `HASH`, `EQUAL` and `ALLOCATOR` from the
3375/// other parameters supplied to the constructor of `unordered_map`. This
3376/// deduction guide does not participate unless: (1) the supplied `HASH` is
3377/// invokable with a `KEY`, (2) the supplied `EQUAL` is invokable with two
3378/// `KEY`s, and (3) the supplied allocator meets the requirements of a
3379/// standard allocator.
3380template <
3381 class KEY,
3382 class VALUE,
3383 class HASH = bsl::hash<KEY>,
3384 class EQUAL = bsl::equal_to<KEY>,
3385 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3386 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
3387 class = bsl::enable_if_t<
3388 std::is_invocable_v<EQUAL, const KEY &, const KEY &>>,
3389 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3390 >
3391unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3392 typename bsl::allocator_traits<ALLOCATOR>::size_type = 0,
3393 HASH = HASH(),
3394 EQUAL = EQUAL(),
3395 ALLOCATOR = ALLOCATOR())
3396-> unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>;
3397
3398/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3399/// of the initializer_list supplied to the constructor of `unordered_map`.
3400/// Deduce the template parameters `HASH` and `EQUAL` from the other
3401/// parameters supplied to the constructor of `unordered_map`. This
3402/// deduction guide does not participate unless the supplied allocator is
3403/// convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3404template <
3405 class KEY,
3406 class VALUE,
3407 class HASH,
3408 class EQUAL,
3409 class ALLOC,
3410 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3411 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3412 >
3413unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3414 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3415 HASH,
3416 EQUAL,
3417 ALLOC *)
3418-> unordered_map<KEY, VALUE, HASH, EQUAL>;
3419
3420/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3421/// of the initializer_list supplied to the constructor of `unordered_map`.
3422/// Deduce the template parameters `HASH` and `ALLOCATOR` from the other
3423/// parameters supplied to the constructor of `unordered_map`. This
3424/// deduction guide does not participate unless the supplied `HASH` is
3425/// invokable with a `KEY`, and the supplied allocator meets the
3426/// requirements of a standard allocator.
3427template <
3428 class KEY,
3429 class VALUE,
3430 class HASH,
3431 class ALLOCATOR,
3432 class = bsl::enable_if_t<std::is_invocable_v<HASH, const KEY &>>,
3433 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3434 >
3435unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3436 typename bsl::allocator_traits<ALLOCATOR>::size_type,
3437 HASH,
3438 ALLOCATOR)
3439-> unordered_map<KEY, VALUE, HASH, bsl::equal_to<KEY>, ALLOCATOR>;
3440
3441/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3442/// of the initializer_list supplied to the constructor of `unordered_map`.
3443/// Deduce the template parameter `HASH` from the other parameters supplied
3444/// to the constructor of `unordered_map`. This deduction guide does not
3445/// participate unless the supplied allocator is convertible to
3446/// `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3447template <
3448 class KEY,
3449 class VALUE,
3450 class HASH,
3451 class ALLOC,
3452 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3453 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3454 >
3455unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3456 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3457 HASH,
3458 ALLOC *)
3459-> unordered_map<KEY, VALUE, HASH>;
3460
3461/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3462/// of the initializer_list supplied to the constructor of `unordered_map`.
3463/// This deduction guide does not participate unless the supplied allocator
3464/// meets the requirements of a standard allocator.
3465template <
3466 class KEY,
3467 class VALUE,
3468 class ALLOCATOR,
3469 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3470 >
3471unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3472 typename bsl::allocator_traits<ALLOCATOR>::size_type,
3473 ALLOCATOR)
3474-> unordered_map<KEY, VALUE, bsl::hash<KEY>, bsl::equal_to<KEY>, ALLOCATOR>;
3475
3476/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3477/// of the initializer_list supplied to the constructor of `unordered_map`.
3478/// This deduction guide does not participate unless the supplied allocator
3479/// is convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3480template <
3481 class KEY,
3482 class VALUE,
3483 class ALLOC,
3484 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3485 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3486 >
3487unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>,
3488 typename bsl::allocator_traits<DEFAULT_ALLOCATOR>::size_type,
3489 ALLOC *)
3490-> unordered_map<KEY, VALUE>;
3491
3492/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3493/// of the initializer_list supplied to the constructor of `unordered_map`.
3494/// Deduce the template parameter `ALLOCATOR` from the other parameters
3495/// supplied to the constructor of `unordered_map`. This deduction guide
3496/// does not participate unless the supplied allocator meets the
3497/// requirements of a standard allocator.
3498template <
3499 class KEY,
3500 class VALUE,
3501 class ALLOCATOR,
3502 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
3503 >
3504unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>, ALLOCATOR)
3505-> unordered_map<KEY, VALUE, bsl::hash<KEY>, bsl::equal_to<KEY>, ALLOCATOR>;
3506
3507/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
3508/// of the initializer_list supplied to the constructor of `unordered_map`.
3509/// This deduction guide does not participate unless the supplied allocator
3510/// is convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
3511template <
3512 class KEY,
3513 class VALUE,
3514 class ALLOC,
3515 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
3516 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
3517 >
3518unordered_map(std::initializer_list<bsl::pair<const KEY, VALUE>>, ALLOC *)
3519-> unordered_map<KEY, VALUE>;
3520#endif
3521
3522// FREE OPERATORS
3523
3524/// Return `true` if the specified `lhs` and `rhs` objects have the same
3525/// value, and `false` otherwise. Two `unordered_map` objects have the
3526/// same value if they have the same number of key-value pairs, and for each
3527/// key-value pair that is contained in `lhs` there is a key-value pair
3528/// contained in `rhs` having the same value, and vice versa.
3529///
3530/// \note Note that this method requires that the (template parameter) types `KEY` and
3531/// `VALUE` both be `equality-comparable` (see {Requirements on
3532/// `value_type`}).
3533template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3534bool operator==(const unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& lhs,
3535 const unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& rhs);
3536
3537#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
3538template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3539bool operator!=(const unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& lhs,
3540 const unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& rhs);
3541 // Return 'true' if the specified 'lhs' and 'rhs' objects do not have the
3542 // same value, and 'false' otherwise. Two 'unordered_map' objects do not
3543 // have the same value if they do not have the same number of key-value
3544 // pairs, or for some key-value pair that is contained in 'lhs' there is
3545 // not a key-value pair in 'rhs' having the same value or vice-versa. Note
3546 // that this method requires that the (template parameter) types 'KEY' and
3547 // 'VALUE' both be 'equality-comparable' (see {Requirements on
3548 // 'value_type'}).
3549#endif
3550
3551// FREE FUNCTIONS
3552
3553/// Erase all the elements in the specified unordered_map `m` that satisfy
3554/// the specified predicate `predicate`. Return the number of elements
3555/// erased.
3556template <class KEY,
3557 class VALUE,
3558 class HASH,
3559 class EQUAL,
3560 class ALLOCATOR,
3561 class PREDICATE>
3562typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
3563erase_if(unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& m,
3564 PREDICATE predicate);
3565
3566/// Exchange the value, hasher, key-equality functor, and @ref max_load_factor
3567/// of the specified `a` object with those of the specified `b` object; also
3568/// exchange the allocator of `a` with that of `b` if the (template
3569/// parameter) type `ALLOCATOR` has the @ref propagate_on_container_swap trait,
3570/// and do not modify either allocator otherwise. This function provides
3571/// the no-throw exception-safety guarantee if and only if both the
3572/// (template parameter) types `HASH` and `EQUAL` provide no-throw swap
3573/// operations; if an exception is thrown, both objects are left in valid
3574/// but unspecified states. This operation guarantees `O[1]` complexity.
3575///
3576/// \pre The behavior is undefined unless either `a` was created with the same
3577/// allocator as `b` or `ALLOCATOR` has the @ref propagate_on_container_swap
3578/// trait.
3579template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3580void swap(unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& a,
3581 unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& b)
3583
3584} // close namespace bsl
3585
3586// ============================================================================
3587// TEMPLATE AND INLINE FUNCTION DEFINITIONS
3588// ============================================================================
3589
3590namespace bsl {
3591 //--------------------
3592 // class unordered_map
3593 //--------------------
3594
3595// PRIVATE MANIPULATORS
3596template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3597template <class INPUT_ITERATOR, class SENTINEL>
3598inline
3599void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::constructFromRange(
3600 INPUT_ITERATOR first,
3601 SENTINEL last)
3602{
3603 ///Implementation Notes
3604 ///--------------------
3605 // If we can calculate the number of elements, reserve space for them
3606 // upfront to reduce rehashing. The calculation is done once since
3607 // `IteratorUtil::insertdistance` may be expensive for non-random-access
3608 // iterators.
3609
3610 if (first == last) {
3611 return; // RETURN
3612 }
3613
3615 BloombergLP::bslstl::IteratorUtil::
3616 canCalculateInsertDistance<INPUT_ITERATOR,SENTINEL>()) {
3617 this->reserve(
3618 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
3619 }
3620
3621 bool isInsertedFlag; // value is not used
3622
3623 while (first != last) {
3624 d_impl.insertIfMissing(&isInsertedFlag, *first);
3625 ++first;
3626 }
3627}
3628
3629#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
3630 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
3631
3632template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3633template <class INPUT_ITERATOR, class SENTINEL>
3634inline
3635void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::constructFromRange(
3636 INPUT_ITERATOR first,
3637 SENTINEL last,
3638 size_t numElements)
3639{
3641 !BloombergLP::bslstl::IteratorUtil
3642 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
3643 || numElements == static_cast<size_t>(
3644 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
3645
3646 if (0 < numElements) {
3647 this->reserve(numElements);
3648 }
3649
3650 bool isInsertedFlag; // value is not used
3651
3652 while (first != last) {
3653 d_impl.insertIfMissing(&isInsertedFlag, *first);
3654 ++first;
3655 }
3656}
3657
3658#endif
3659
3660// CREATORS
3661template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3662inline
3663unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::
3664unordered_map(size_type initialNumBuckets,
3665 const HASH& hashFunction,
3666 const EQUAL& keyEqual,
3667 const ALLOCATOR& basicAllocator)
3668: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
3669{
3670}
3671
3672template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3673inline
3674unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3675 size_type initialNumBuckets,
3676 const HASH& hashFunction,
3677 const ALLOCATOR& basicAllocator)
3678: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3679{
3680}
3681
3682template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3683inline
3684unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3685 size_type initialNumBuckets,
3686 const ALLOCATOR& basicAllocator)
3687: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3688{
3689}
3690
3691template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3692inline
3693unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3694 const ALLOCATOR& basicAllocator)
3695: d_impl(basicAllocator)
3696{
3697}
3698
3699template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3700inline
3701unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map()
3702: d_impl()
3703{
3704}
3705
3706template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3707template <class INPUT_ITERATOR>
3708inline
3709unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3710 INPUT_ITERATOR first,
3711 INPUT_ITERATOR last,
3712 size_type initialNumBuckets,
3713 const HASH& hashFunction,
3714 const EQUAL& keyEqual,
3715 const ALLOCATOR& basicAllocator)
3716: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
3717{
3718 constructFromRange(first, last);
3719}
3720
3721template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3722template <class INPUT_ITERATOR>
3723inline
3724unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3725 INPUT_ITERATOR first,
3726 INPUT_ITERATOR last,
3727 size_type initialNumBuckets,
3728 const HASH& hashFunction,
3729 const ALLOCATOR& basicAllocator)
3730: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3731{
3732 this->insert(first, last);
3733}
3734
3735template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3736template <class INPUT_ITERATOR>
3737inline
3738unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3739 INPUT_ITERATOR first,
3740 INPUT_ITERATOR last,
3741 size_type initialNumBuckets,
3742 const ALLOCATOR& basicAllocator)
3743: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3744{
3745 this->insert(first, last);
3746}
3747
3748template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3749template <class INPUT_ITERATOR>
3750inline
3751unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3752 INPUT_ITERATOR first,
3753 INPUT_ITERATOR last,
3754 const ALLOCATOR& basicAllocator)
3755: d_impl(basicAllocator)
3756{
3757 this->insert(first, last);
3758}
3759
3760#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3761template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3762# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3763template <class, class, class>
3764# endif
3765inline
3766unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3767 std::initializer_list<value_type> values,
3768 size_type initialNumBuckets,
3769 const HASH& hashFunction,
3770 const EQUAL& keyEqual,
3771 const ALLOCATOR& basicAllocator)
3772: d_impl(hashFunction, keyEqual, initialNumBuckets, 1.0f, basicAllocator)
3773{
3774 insert(values.begin(), values.end());
3775}
3776
3777template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3778# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3779template <class, class>
3780# endif
3781inline
3782unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3783 std::initializer_list<value_type> values,
3784 size_type initialNumBuckets,
3785 const HASH& hashFunction,
3786 const ALLOCATOR& basicAllocator)
3787: d_impl(hashFunction, EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3788{
3789 insert(values.begin(), values.end());
3790}
3791
3792template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3793# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3794template <class>
3795# endif
3796inline
3797unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3798 std::initializer_list<value_type> values,
3799 size_type initialNumBuckets,
3800 const ALLOCATOR& basicAllocator)
3801: d_impl(HASH(), EQUAL(), initialNumBuckets, 1.0f, basicAllocator)
3802{
3803 insert(values.begin(), values.end());
3804}
3805
3806template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3807# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
3808template <class>
3809# endif
3810inline
3811unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3812 std::initializer_list<value_type> values,
3813 const ALLOCATOR& basicAllocator)
3814: d_impl(basicAllocator)
3815{
3816 insert(values.begin(), values.end());
3817}
3818#endif
3819
3820template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3821inline
3822unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3823 const unordered_map& original)
3824: d_impl(original.d_impl,
3825 AllocatorTraits::select_on_container_copy_construction(
3826 original.get_allocator()))
3827{
3828}
3829
3830template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3831inline
3832unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3833 const unordered_map& original,
3834 const typename type_identity<ALLOCATOR>::type& basicAllocator)
3835: d_impl(original.d_impl, basicAllocator)
3836{
3837}
3838
3839template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3840inline
3841unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3842 BloombergLP::bslmf::MovableRef<unordered_map> original)
3843: d_impl(MoveUtil::access(original).get_allocator())
3844{
3845 unordered_map& lvalue = original;
3846
3847 this->swap(lvalue);
3848}
3849
3850template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3851inline
3852unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::unordered_map(
3853 BloombergLP::bslmf::MovableRef<unordered_map> original,
3854 const typename type_identity<ALLOCATOR>::type& basicAllocator)
3855: d_impl(MoveUtil::move(MoveUtil::access(original).d_impl), basicAllocator)
3856{
3857}
3858
3859template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3860inline
3861unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::~unordered_map()
3862{
3863 // All memory management is handled by the base 'd_impl' member.
3864}
3865
3866// MANIPULATORS
3867template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3868inline
3869unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>&
3870unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::operator=(
3871 const unordered_map& rhs)
3872{
3873 // Note that we have delegated responsibility for correct handling of
3874 // allocator propagation to the 'HashTable' implementation.
3875
3876 d_impl = rhs.d_impl;
3877
3878 return *this;
3879}
3880
3881template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3882inline
3883unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>&
3884unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::operator=(
3885 BloombergLP::bslmf::MovableRef<unordered_map> rhs)
3887 AllocatorTraits::is_always_equal::value &&
3888 std::is_nothrow_move_assignable<HASH>::value &&
3889 std::is_nothrow_move_assignable<EQUAL>::value)
3890{
3891 // Note that we have delegated responsibility for correct handling of
3892 // allocator propagation to the 'HashTable' implementation.
3893
3894 unordered_map& lvalue = rhs;
3895
3896 d_impl = MoveUtil::move(lvalue.d_impl);
3897
3898 return *this;
3899}
3900
3901#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3902template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3903inline
3904unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>&
3905unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::operator=(
3906 std::initializer_list<value_type> rhs)
3907{
3908 unordered_map tmp(rhs.begin(), rhs.end(), d_impl.allocator());
3909
3910 this->swap(tmp);
3911
3912 return *this;
3913}
3914#endif
3915
3916template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3917inline
3918typename add_lvalue_reference<VALUE>::type
3919unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::operator[](
3920 const key_type& key)
3921{
3922 HashTableLink *node = d_impl.insertIfMissing(key);
3923 return static_cast<HashTableNode *>(node)->value().second;
3924}
3925
3926template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3927inline
3928typename add_lvalue_reference<VALUE>::type
3929unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::operator[](
3930 BloombergLP::bslmf::MovableRef<key_type> key)
3931{
3932 HashTableLink *node = d_impl.insertIfMissing(
3933 MoveUtil::move(MoveUtil::access(key)));
3934 return static_cast<HashTableNode *>(node)->value().second;
3935}
3936
3937template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3938inline
3939typename add_lvalue_reference<VALUE>::type
3940unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::at(const key_type& key)
3941{
3942 HashTableLink *node = d_impl.find(key);
3943
3944 if (!node) {
3945 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
3946 "unordered_map<...>::at(key_type): invalid key value");
3947 }
3948
3949 return static_cast<HashTableNode *>(node)->value().second;
3950}
3951
3952template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3953inline
3954typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
3955unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::begin()
3957{
3958 return iterator(d_impl.elementListRoot());
3959}
3960
3961template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3962inline
3963typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
3964unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::end() BSLS_KEYWORD_NOEXCEPT
3965{
3966 return iterator();
3967}
3968
3969template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3970inline
3971typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::local_iterator
3972unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::begin(size_type index)
3973{
3974 BSLS_ASSERT_SAFE(index < this->bucket_count());
3975
3976 return local_iterator(&d_impl.bucketAtIndex(index));
3977}
3978
3979template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3980inline
3981typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::local_iterator
3982unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::end(size_type index)
3983{
3984 BSLS_ASSERT_SAFE(index < this->bucket_count());
3985
3986 return local_iterator(0, &d_impl.bucketAtIndex(index));
3987}
3988
3989template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
3990inline
3991void
3992unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::clear()
3994{
3995 d_impl.removeAll();
3996}
3997
3998#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3999// {{{ BEGIN GENERATED CODE
4000// Command line: sim_cpp11_features.pl bslstl_unorderedmap.h
4001#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
4002#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT 10
4003#endif
4004#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E
4005#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
4006#endif
4007#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 0
4008template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4009bsl::pair<
4010 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4011 bool>
4012unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4013 )
4014{
4015 typedef bsl::pair<iterator, bool> ResultType;
4016
4017 bool isInsertedFlag = false;
4018
4019 HashTableLink *result = d_impl.emplaceIfMissing(
4020 &isInsertedFlag);
4021
4022 return ResultType(iterator(result), isInsertedFlag);
4023}
4024#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 0
4025
4026#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 1
4027template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4028template <class Args_01>
4029bsl::pair<
4030 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4031 bool>
4032unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4033 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
4034{
4035 typedef bsl::pair<iterator, bool> ResultType;
4036
4037 bool isInsertedFlag = false;
4038
4039 HashTableLink *result = d_impl.emplaceIfMissing(
4040 &isInsertedFlag,
4041 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
4042
4043 return ResultType(iterator(result), isInsertedFlag);
4044}
4045#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 1
4046
4047#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 2
4048template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4049template <class Args_01,
4050 class Args_02>
4051bsl::pair<
4052 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4053 bool>
4054unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4055 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4056 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
4057{
4058 typedef bsl::pair<iterator, bool> ResultType;
4059
4060 bool isInsertedFlag = false;
4061
4062 HashTableLink *result = d_impl.emplaceIfMissing(
4063 &isInsertedFlag,
4064 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4065 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
4066
4067 return ResultType(iterator(result), isInsertedFlag);
4068}
4069#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 2
4070
4071#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 3
4072template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4073template <class Args_01,
4074 class Args_02,
4075 class Args_03>
4076bsl::pair<
4077 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4078 bool>
4079unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4080 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4081 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4082 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
4083{
4084 typedef bsl::pair<iterator, bool> ResultType;
4085
4086 bool isInsertedFlag = false;
4087
4088 HashTableLink *result = d_impl.emplaceIfMissing(
4089 &isInsertedFlag,
4090 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4091 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4092 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
4093
4094 return ResultType(iterator(result), isInsertedFlag);
4095}
4096#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 3
4097
4098#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 4
4099template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4100template <class Args_01,
4101 class Args_02,
4102 class Args_03,
4103 class Args_04>
4104bsl::pair<
4105 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4106 bool>
4107unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4108 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4109 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4110 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4111 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
4112{
4113 typedef bsl::pair<iterator, bool> ResultType;
4114
4115 bool isInsertedFlag = false;
4116
4117 HashTableLink *result = d_impl.emplaceIfMissing(
4118 &isInsertedFlag,
4119 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4120 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4121 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4122 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
4123
4124 return ResultType(iterator(result), isInsertedFlag);
4125}
4126#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 4
4127
4128#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 5
4129template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4130template <class Args_01,
4131 class Args_02,
4132 class Args_03,
4133 class Args_04,
4134 class Args_05>
4135bsl::pair<
4136 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4137 bool>
4138unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4139 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4140 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4141 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4142 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
4144{
4145 typedef bsl::pair<iterator, bool> ResultType;
4146
4147 bool isInsertedFlag = false;
4148
4149 HashTableLink *result = d_impl.emplaceIfMissing(
4150 &isInsertedFlag,
4151 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4152 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4153 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4154 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4155 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
4156
4157 return ResultType(iterator(result), isInsertedFlag);
4158}
4159#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 5
4160
4161#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 6
4162template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4163template <class Args_01,
4164 class Args_02,
4165 class Args_03,
4166 class Args_04,
4167 class Args_05,
4168 class Args_06>
4169bsl::pair<
4170 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4171 bool>
4172unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4173 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4174 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4175 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4176 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4177 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4178 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
4179{
4180 typedef bsl::pair<iterator, bool> ResultType;
4181
4182 bool isInsertedFlag = false;
4183
4184 HashTableLink *result = d_impl.emplaceIfMissing(
4185 &isInsertedFlag,
4186 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4187 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4188 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4189 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4190 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4191 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
4192
4193 return ResultType(iterator(result), isInsertedFlag);
4194}
4195#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 6
4196
4197#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 7
4198template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4199template <class Args_01,
4200 class Args_02,
4201 class Args_03,
4202 class Args_04,
4203 class Args_05,
4204 class Args_06,
4205 class Args_07>
4206bsl::pair<
4207 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4208 bool>
4209unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4210 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4211 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4212 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4213 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4214 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4215 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4216 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
4217{
4218 typedef bsl::pair<iterator, bool> ResultType;
4219
4220 bool isInsertedFlag = false;
4221
4222 HashTableLink *result = d_impl.emplaceIfMissing(
4223 &isInsertedFlag,
4224 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4225 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4226 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4227 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4228 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4229 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4230 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
4231
4232 return ResultType(iterator(result), isInsertedFlag);
4233}
4234#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 7
4235
4236#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 8
4237template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4238template <class Args_01,
4239 class Args_02,
4240 class Args_03,
4241 class Args_04,
4242 class Args_05,
4243 class Args_06,
4244 class Args_07,
4245 class Args_08>
4246bsl::pair<
4247 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4248 bool>
4249unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4250 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4251 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4252 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4253 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4254 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4255 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4256 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4257 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
4258{
4259 typedef bsl::pair<iterator, bool> ResultType;
4260
4261 bool isInsertedFlag = false;
4262
4263 HashTableLink *result = d_impl.emplaceIfMissing(
4264 &isInsertedFlag,
4265 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4266 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4267 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4268 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4269 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4270 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4271 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4272 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
4273
4274 return ResultType(iterator(result), isInsertedFlag);
4275}
4276#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 8
4277
4278#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 9
4279template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4280template <class Args_01,
4281 class Args_02,
4282 class Args_03,
4283 class Args_04,
4284 class Args_05,
4285 class Args_06,
4286 class Args_07,
4287 class Args_08,
4288 class Args_09>
4289bsl::pair<
4290 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4291 bool>
4292unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4293 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4294 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4295 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4296 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4297 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4298 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4299 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4300 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
4301 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
4302{
4303 typedef bsl::pair<iterator, bool> ResultType;
4304
4305 bool isInsertedFlag = false;
4306
4307 HashTableLink *result = d_impl.emplaceIfMissing(
4308 &isInsertedFlag,
4309 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4310 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4311 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4312 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4313 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4314 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4315 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4316 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
4317 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
4318
4319 return ResultType(iterator(result), isInsertedFlag);
4320}
4321#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 9
4322
4323#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 10
4324template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4325template <class Args_01,
4326 class Args_02,
4327 class Args_03,
4328 class Args_04,
4329 class Args_05,
4330 class Args_06,
4331 class Args_07,
4332 class Args_08,
4333 class Args_09,
4334 class Args_10>
4335bsl::pair<
4336 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4337 bool>
4338unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4339 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4340 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4341 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4342 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4343 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4344 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4345 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4346 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
4347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
4348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
4349{
4350 typedef bsl::pair<iterator, bool> ResultType;
4351
4352 bool isInsertedFlag = false;
4353
4354 HashTableLink *result = d_impl.emplaceIfMissing(
4355 &isInsertedFlag,
4356 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4357 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4358 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4359 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4360 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4361 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4362 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4363 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
4364 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
4365 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
4366
4367 return ResultType(iterator(result), isInsertedFlag);
4368}
4369#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 10
4370
4371
4372#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 0
4373template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4374typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4375unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4376 const_iterator)
4377{
4378
4379 bool isInsertedFlag = false;
4380
4381 HashTableLink *result = d_impl.emplaceIfMissing(
4382 &isInsertedFlag);
4383
4384 return iterator(result);
4385}
4386#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 0
4387
4388#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 1
4389template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4390template <class Args_01>
4391typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4392unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4393 const_iterator,
4394 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
4395{
4396
4397 bool isInsertedFlag = false;
4398
4399 HashTableLink *result = d_impl.emplaceIfMissing(
4400 &isInsertedFlag,
4401 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
4402
4403 return iterator(result);
4404}
4405#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 1
4406
4407#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 2
4408template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4409template <class Args_01,
4410 class Args_02>
4411typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4412unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4413 const_iterator,
4414 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4415 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
4416{
4417
4418 bool isInsertedFlag = false;
4419
4420 HashTableLink *result = d_impl.emplaceIfMissing(
4421 &isInsertedFlag,
4422 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4423 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
4424
4425 return iterator(result);
4426}
4427#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 2
4428
4429#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 3
4430template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4431template <class Args_01,
4432 class Args_02,
4433 class Args_03>
4434typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4435unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4436 const_iterator,
4437 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4438 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
4440{
4441
4442 bool isInsertedFlag = false;
4443
4444 HashTableLink *result = d_impl.emplaceIfMissing(
4445 &isInsertedFlag,
4446 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4447 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4448 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
4449
4450 return iterator(result);
4451}
4452#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 3
4453
4454#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 4
4455template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4456template <class Args_01,
4457 class Args_02,
4458 class Args_03,
4459 class Args_04>
4460typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4461unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4462 const_iterator,
4463 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4465 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4466 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
4467{
4468
4469 bool isInsertedFlag = false;
4470
4471 HashTableLink *result = d_impl.emplaceIfMissing(
4472 &isInsertedFlag,
4473 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4474 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4475 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4476 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
4477
4478 return iterator(result);
4479}
4480#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 4
4481
4482#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 5
4483template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4484template <class Args_01,
4485 class Args_02,
4486 class Args_03,
4487 class Args_04,
4488 class Args_05>
4489typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4490unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4491 const_iterator,
4492 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4493 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4494 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4495 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4496 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
4497{
4498
4499 bool isInsertedFlag = false;
4500
4501 HashTableLink *result = d_impl.emplaceIfMissing(
4502 &isInsertedFlag,
4503 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4504 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4505 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4506 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4507 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
4508
4509 return iterator(result);
4510}
4511#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 5
4512
4513#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 6
4514template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4515template <class Args_01,
4516 class Args_02,
4517 class Args_03,
4518 class Args_04,
4519 class Args_05,
4520 class Args_06>
4521typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4522unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4523 const_iterator,
4524 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4525 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4526 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4527 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4528 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4529 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
4530{
4531
4532 bool isInsertedFlag = false;
4533
4534 HashTableLink *result = d_impl.emplaceIfMissing(
4535 &isInsertedFlag,
4536 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4537 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4538 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4539 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4540 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4541 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
4542
4543 return iterator(result);
4544}
4545#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 6
4546
4547#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 7
4548template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4549template <class Args_01,
4550 class Args_02,
4551 class Args_03,
4552 class Args_04,
4553 class Args_05,
4554 class Args_06,
4555 class Args_07>
4556typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4557unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4558 const_iterator,
4559 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4560 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4561 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4562 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4563 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4564 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4565 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
4566{
4567
4568 bool isInsertedFlag = false;
4569
4570 HashTableLink *result = d_impl.emplaceIfMissing(
4571 &isInsertedFlag,
4572 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4573 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4574 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4575 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4576 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4577 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4578 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
4579
4580 return iterator(result);
4581}
4582#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 7
4583
4584#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 8
4585template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4586template <class Args_01,
4587 class Args_02,
4588 class Args_03,
4589 class Args_04,
4590 class Args_05,
4591 class Args_06,
4592 class Args_07,
4593 class Args_08>
4594typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4595unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4596 const_iterator,
4597 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4598 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4599 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4600 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4601 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4602 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4603 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4604 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
4605{
4606
4607 bool isInsertedFlag = false;
4608
4609 HashTableLink *result = d_impl.emplaceIfMissing(
4610 &isInsertedFlag,
4611 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4612 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4613 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4614 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4615 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4616 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4617 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4618 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
4619
4620 return iterator(result);
4621}
4622#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 8
4623
4624#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 9
4625template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4626template <class Args_01,
4627 class Args_02,
4628 class Args_03,
4629 class Args_04,
4630 class Args_05,
4631 class Args_06,
4632 class Args_07,
4633 class Args_08,
4634 class Args_09>
4635typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4636unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4637 const_iterator,
4638 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4639 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4640 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4641 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4642 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4643 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4644 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4645 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
4646 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
4647{
4648
4649 bool isInsertedFlag = false;
4650
4651 HashTableLink *result = d_impl.emplaceIfMissing(
4652 &isInsertedFlag,
4653 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4654 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4655 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4656 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4657 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4658 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4659 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4660 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
4661 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
4662
4663 return iterator(result);
4664}
4665#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 9
4666
4667#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 10
4668template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4669template <class Args_01,
4670 class Args_02,
4671 class Args_03,
4672 class Args_04,
4673 class Args_05,
4674 class Args_06,
4675 class Args_07,
4676 class Args_08,
4677 class Args_09,
4678 class Args_10>
4679typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4680unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4681 const_iterator,
4682 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
4683 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
4684 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
4685 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
4686 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
4687 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
4688 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
4689 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
4690 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
4691 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
4692{
4693
4694 bool isInsertedFlag = false;
4695
4696 HashTableLink *result = d_impl.emplaceIfMissing(
4697 &isInsertedFlag,
4698 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
4699 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
4700 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
4701 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
4702 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
4703 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
4704 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
4705 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
4706 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
4707 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
4708
4709 return iterator(result);
4710}
4711#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_E >= 10
4712
4713#else
4714// The generated code below is a workaround for the absence of perfect
4715// forwarding in some compilers.
4716template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4717template <class... Args>
4718bsl::pair<
4719 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4720 bool>
4721unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace(
4723{
4724 typedef bsl::pair<iterator, bool> ResultType;
4725
4726 bool isInsertedFlag = false;
4727
4728 HashTableLink *result = d_impl.emplaceIfMissing(
4729 &isInsertedFlag,
4730 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
4731
4732 return ResultType(iterator(result), isInsertedFlag);
4733}
4734
4735template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4736template <class... Args>
4737typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4738unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::emplace_hint(
4739 const_iterator,
4741{
4742
4743 bool isInsertedFlag = false;
4744
4745 HashTableLink *result = d_impl.emplaceIfMissing(
4746 &isInsertedFlag,
4747 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
4748
4749 return iterator(result);
4750}
4751// }}} END GENERATED CODE
4752#endif
4753
4754template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4755inline
4756typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4757unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::erase(
4758 const_iterator position)
4759{
4760 BSLS_ASSERT_SAFE(position != this->end());
4761
4762 return iterator(d_impl.remove(position.node()));
4763}
4764
4765template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4766inline
4767typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4768unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::erase(iterator position)
4769{
4770 return erase(const_iterator(position));
4771}
4772
4773template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4774typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
4775unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::erase(const key_type& key)
4776{
4777 HashTableLink *target = d_impl.find(key);
4778 if (target) {
4779 d_impl.remove(target);
4780 return 1; // RETURN
4781 }
4782 else {
4783 return 0; // RETURN
4784 }
4785}
4786
4787template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4788typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4789unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::erase(const_iterator first,
4790 const_iterator last)
4791{
4792
4793#if defined BDE_BUILD_TARGET_SAFE_2
4794 if (first != last) {
4795 iterator it = this->begin();
4796 const iterator end = this->end();
4797 for (; it != first; ++it) {
4798 BSLS_ASSERT(last != it);
4799 BSLS_ASSERT(end != it);
4800 }
4801 for (; it != last; ++it) {
4802 BSLS_ASSERT(end != it);
4803 }
4804 }
4805#endif
4806
4807 while (first != last) {
4808 first = this->erase(first);
4809 }
4810
4811 return iterator(first.node()); // convert from const_iterator
4812}
4813
4814template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4815inline
4816bool unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::contains(
4817 const key_type& key) const
4818{
4819 return find(key) != end();
4820}
4821
4822template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4823inline
4824typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4825unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::find(const key_type& key)
4826{
4827 return iterator(d_impl.find(key));
4828}
4829
4830template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4831inline
4832pair<typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4833 bool>
4834unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insert(
4835 const value_type& value)
4836{
4837 typedef bsl::pair<iterator, bool> ResultType;
4838
4839 bool isInsertedFlag = false;
4840
4841 HashTableLink *result = d_impl.insertIfMissing(&isInsertedFlag, value);
4842
4843 return ResultType(iterator(result), isInsertedFlag);
4844}
4845
4846template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4847inline
4848typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4849unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insert(
4850 const_iterator,
4851 const value_type& value)
4852{
4853 bool isInsertedFlag; // not used
4854
4855 HashTableLink *result = d_impl.insertIfMissing(&isInsertedFlag, value);
4856
4857 return iterator(result);
4858}
4859
4860template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4861template <class INPUT_ITERATOR>
4862void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insert(
4863 INPUT_ITERATOR first,
4864 INPUT_ITERATOR last)
4865{
4866 insertFromRange(first, last);
4867}
4868
4869#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4870template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4871void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insert(
4872 std::initializer_list<value_type> values)
4873{
4874 insert(values.begin(), values.end());
4875}
4876#endif
4877
4878// {{{ BEGIN GENERATED CODE
4879// The generated code below is a workaround for the absence of perfect
4880// forwarding in some compilers.
4881template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4882template <class BDE_OTHER_TYPE>
4884 bool>
4886 const KEY& key,
4887 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
4888{
4889 typedef bsl::pair<iterator, bool> ResultType;
4890 bool isInsertedFlag = false;
4891 HashTableLink *result = d_impl.insertOrAssign(
4892 &isInsertedFlag,
4893 NULL,
4894 key,
4895 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
4896 return ResultType(iterator(result), isInsertedFlag);
4897}
4898
4899template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4900template <class BDE_OTHER_TYPE>
4902 bool>
4904 BloombergLP::bslmf::MovableRef<KEY> key,
4905 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
4906{
4907 typedef bsl::pair<iterator, bool> ResultType;
4908 bool isInsertedFlag = false;
4909 HashTableLink *result = d_impl.insertOrAssign(
4910 &isInsertedFlag,
4911 NULL,
4913 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
4914 return ResultType(iterator(result), isInsertedFlag);
4915}
4916
4917template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4918template <class BDE_OTHER_TYPE>
4919typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4921 const_iterator hint,
4922 const KEY& key,
4923 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
4924{
4925 bool isInsertedFlag = false;
4926 HashTableLink *result = d_impl.insertOrAssign(
4927 &isInsertedFlag,
4928 hint.node(),
4929 key,
4930 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
4931 return iterator(result);
4932}
4933
4934template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4935template <class BDE_OTHER_TYPE>
4936typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator
4938 const_iterator hint,
4939 BloombergLP::bslmf::MovableRef<KEY> key,
4940 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
4941{
4942 bool isInsertedFlag = false;
4943 HashTableLink *result = d_impl.insertOrAssign(
4944 &isInsertedFlag,
4945 hint.node(),
4947 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
4948 return iterator(result);
4949}
4950// }}} END GENERATED CODE
4951
4952template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4953bsl::pair<
4954 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator,
4955 typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::iterator>
4956unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::equal_range(
4957 const key_type& key)
4958{
4959 typedef bsl::pair<iterator, iterator> ResultType;
4960
4961 HashTableLink *first = d_impl.find(key);
4962 return first ? ResultType(iterator(first), iterator(first->nextLink()))
4963 : ResultType(iterator(0), iterator(0));
4964}
4965
4966template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4967inline
4968void
4969unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::max_load_factor(
4970 float newMaxLoadFactor)
4971{
4972 d_impl.setMaxLoadFactor(newMaxLoadFactor);
4973}
4974
4975template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4976inline
4977void
4978unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::rehash(
4979 size_type numBuckets)
4980{
4981 d_impl.rehashForNumBuckets(numBuckets);
4982}
4983
4984template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4985inline
4986void
4987unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::reserve(
4988 size_type numElements)
4989{
4990 d_impl.reserveForNumElements(numElements);
4991}
4992
4993template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
4994inline
4995void
4996unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::swap(unordered_map& other)
4998 AllocatorTraits::is_always_equal::value &&
4999 bsl::is_nothrow_swappable<HASH>::value &&
5000 bsl::is_nothrow_swappable<EQUAL>::value)
5001{
5002 d_impl.swap(other.d_impl);
5003}
5004
5005#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
5006// {{{ BEGIN GENERATED CODE
5007// Command line: sim_cpp11_features.pl bslstl_unorderedmap.h
5008#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
5009#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT 10
5010#endif
5011#ifndef BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G
5012#define BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT
5013#endif
5014#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5015template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5016inline
5017bsl::pair<
5019 bool>
5021 const KEY& key)
5022{
5023 typedef bsl::pair<iterator, bool> ResultType;
5024 bool isInsertedFlag = false;
5025 HashTableLink *result = d_impl.tryEmplace(
5026 &isInsertedFlag,
5027 NULL,
5028 key);
5029
5030 return ResultType(iterator(result), isInsertedFlag);
5031}
5032#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5033
5034#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5035template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5036template <class Args_01>
5037inline
5038bsl::pair<
5040 bool>
5042 const KEY& key,
5043 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
5044{
5045 typedef bsl::pair<iterator, bool> ResultType;
5046 bool isInsertedFlag = false;
5047 HashTableLink *result = d_impl.tryEmplace(
5048 &isInsertedFlag,
5049 NULL,
5050 key,
5051 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
5052
5053 return ResultType(iterator(result), isInsertedFlag);
5054}
5055#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5056
5057#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5058template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5059template <class Args_01,
5060 class Args_02>
5061inline
5062bsl::pair<
5064 bool>
5066 const KEY& key,
5067 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5068 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
5069{
5070 typedef bsl::pair<iterator, bool> ResultType;
5071 bool isInsertedFlag = false;
5072 HashTableLink *result = d_impl.tryEmplace(
5073 &isInsertedFlag,
5074 NULL,
5075 key,
5076 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5077 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
5078
5079 return ResultType(iterator(result), isInsertedFlag);
5080}
5081#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5082
5083#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5084template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5085template <class Args_01,
5086 class Args_02,
5087 class Args_03>
5088inline
5089bsl::pair<
5091 bool>
5093 const KEY& key,
5094 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5095 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5096 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
5097{
5098 typedef bsl::pair<iterator, bool> ResultType;
5099 bool isInsertedFlag = false;
5100 HashTableLink *result = d_impl.tryEmplace(
5101 &isInsertedFlag,
5102 NULL,
5103 key,
5104 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5105 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5106 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
5107
5108 return ResultType(iterator(result), isInsertedFlag);
5109}
5110#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5111
5112#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5113template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5114template <class Args_01,
5115 class Args_02,
5116 class Args_03,
5117 class Args_04>
5118inline
5119bsl::pair<
5121 bool>
5123 const KEY& key,
5124 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5125 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5126 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5127 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
5128{
5129 typedef bsl::pair<iterator, bool> ResultType;
5130 bool isInsertedFlag = false;
5131 HashTableLink *result = d_impl.tryEmplace(
5132 &isInsertedFlag,
5133 NULL,
5134 key,
5135 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5136 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5137 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5138 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
5139
5140 return ResultType(iterator(result), isInsertedFlag);
5141}
5142#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5143
5144#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5145template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5146template <class Args_01,
5147 class Args_02,
5148 class Args_03,
5149 class Args_04,
5150 class Args_05>
5151inline
5152bsl::pair<
5154 bool>
5156 const KEY& key,
5157 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5158 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5159 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5160 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5161 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
5162{
5163 typedef bsl::pair<iterator, bool> ResultType;
5164 bool isInsertedFlag = false;
5165 HashTableLink *result = d_impl.tryEmplace(
5166 &isInsertedFlag,
5167 NULL,
5168 key,
5169 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5170 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5171 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5172 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5173 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
5174
5175 return ResultType(iterator(result), isInsertedFlag);
5176}
5177#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5178
5179#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5180template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5181template <class Args_01,
5182 class Args_02,
5183 class Args_03,
5184 class Args_04,
5185 class Args_05,
5186 class Args_06>
5187inline
5188bsl::pair<
5190 bool>
5192 const KEY& key,
5193 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5194 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5195 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5196 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5197 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5198 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
5199{
5200 typedef bsl::pair<iterator, bool> ResultType;
5201 bool isInsertedFlag = false;
5202 HashTableLink *result = d_impl.tryEmplace(
5203 &isInsertedFlag,
5204 NULL,
5205 key,
5206 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5207 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5208 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5209 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5210 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5211 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
5212
5213 return ResultType(iterator(result), isInsertedFlag);
5214}
5215#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5216
5217#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
5218template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5219template <class Args_01,
5220 class Args_02,
5221 class Args_03,
5222 class Args_04,
5223 class Args_05,
5224 class Args_06,
5225 class Args_07>
5226inline
5227bsl::pair<
5229 bool>
5231 const KEY& key,
5232 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5233 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5234 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5235 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5236 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5237 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5238 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
5239{
5240 typedef bsl::pair<iterator, bool> ResultType;
5241 bool isInsertedFlag = false;
5242 HashTableLink *result = d_impl.tryEmplace(
5243 &isInsertedFlag,
5244 NULL,
5245 key,
5246 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5247 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5248 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5249 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5250 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5251 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5252 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
5253
5254 return ResultType(iterator(result), isInsertedFlag);
5255}
5256#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
5257
5258#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
5259template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5260template <class Args_01,
5261 class Args_02,
5262 class Args_03,
5263 class Args_04,
5264 class Args_05,
5265 class Args_06,
5266 class Args_07,
5267 class Args_08>
5268inline
5269bsl::pair<
5271 bool>
5273 const KEY& key,
5274 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5275 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5276 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5277 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5278 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5279 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5280 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5281 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
5282{
5283 typedef bsl::pair<iterator, bool> ResultType;
5284 bool isInsertedFlag = false;
5285 HashTableLink *result = d_impl.tryEmplace(
5286 &isInsertedFlag,
5287 NULL,
5288 key,
5289 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5290 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5291 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5292 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5293 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5294 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5295 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5296 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
5297
5298 return ResultType(iterator(result), isInsertedFlag);
5299}
5300#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
5301
5302#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
5303template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5304template <class Args_01,
5305 class Args_02,
5306 class Args_03,
5307 class Args_04,
5308 class Args_05,
5309 class Args_06,
5310 class Args_07,
5311 class Args_08,
5312 class Args_09>
5313inline
5314bsl::pair<
5316 bool>
5318 const KEY& key,
5319 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5320 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5321 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5322 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5323 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5324 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5325 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5326 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5327 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
5328{
5329 typedef bsl::pair<iterator, bool> ResultType;
5330 bool isInsertedFlag = false;
5331 HashTableLink *result = d_impl.tryEmplace(
5332 &isInsertedFlag,
5333 NULL,
5334 key,
5335 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5336 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5337 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5338 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5339 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5340 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5341 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5342 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5343 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
5344
5345 return ResultType(iterator(result), isInsertedFlag);
5346}
5347#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
5348
5349#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
5350template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5351template <class Args_01,
5352 class Args_02,
5353 class Args_03,
5354 class Args_04,
5355 class Args_05,
5356 class Args_06,
5357 class Args_07,
5358 class Args_08,
5359 class Args_09,
5360 class Args_10>
5361inline
5362bsl::pair<
5364 bool>
5366 const KEY& key,
5367 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5368 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5369 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5370 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5371 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5372 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5373 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5374 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5375 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
5376 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
5377{
5378 typedef bsl::pair<iterator, bool> ResultType;
5379 bool isInsertedFlag = false;
5380 HashTableLink *result = d_impl.tryEmplace(
5381 &isInsertedFlag,
5382 NULL,
5383 key,
5384 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5385 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5386 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5387 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5388 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5389 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5390 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5391 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5392 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
5393 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
5394
5395 return ResultType(iterator(result), isInsertedFlag);
5396}
5397#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
5398
5399
5400#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5401template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5402inline
5403bsl::pair<
5405 bool>
5407 BloombergLP::bslmf::MovableRef<KEY> key)
5408{
5409 typedef bsl::pair<iterator, bool> ResultType;
5410 bool isInsertedFlag = false;
5411 HashTableLink *result = d_impl.tryEmplace(
5412 &isInsertedFlag,
5413 NULL,
5415
5416 return ResultType(iterator(result), isInsertedFlag);
5417}
5418#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5419
5420#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5421template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5422template <class Args_01>
5423inline
5424bsl::pair<
5426 bool>
5428 BloombergLP::bslmf::MovableRef<KEY> key,
5429 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
5430{
5431 typedef bsl::pair<iterator, bool> ResultType;
5432 bool isInsertedFlag = false;
5433 HashTableLink *result = d_impl.tryEmplace(
5434 &isInsertedFlag,
5435 NULL,
5437 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
5438
5439 return ResultType(iterator(result), isInsertedFlag);
5440}
5441#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5442
5443#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5444template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5445template <class Args_01,
5446 class Args_02>
5447inline
5448bsl::pair<
5450 bool>
5452 BloombergLP::bslmf::MovableRef<KEY> key,
5453 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5454 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
5455{
5456 typedef bsl::pair<iterator, bool> ResultType;
5457 bool isInsertedFlag = false;
5458 HashTableLink *result = d_impl.tryEmplace(
5459 &isInsertedFlag,
5460 NULL,
5462 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5463 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
5464
5465 return ResultType(iterator(result), isInsertedFlag);
5466}
5467#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5468
5469#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5470template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5471template <class Args_01,
5472 class Args_02,
5473 class Args_03>
5474inline
5475bsl::pair<
5477 bool>
5479 BloombergLP::bslmf::MovableRef<KEY> key,
5480 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5481 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5482 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
5483{
5484 typedef bsl::pair<iterator, bool> ResultType;
5485 bool isInsertedFlag = false;
5486 HashTableLink *result = d_impl.tryEmplace(
5487 &isInsertedFlag,
5488 NULL,
5490 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5491 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5492 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
5493
5494 return ResultType(iterator(result), isInsertedFlag);
5495}
5496#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5497
5498#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5499template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5500template <class Args_01,
5501 class Args_02,
5502 class Args_03,
5503 class Args_04>
5504inline
5505bsl::pair<
5507 bool>
5509 BloombergLP::bslmf::MovableRef<KEY> key,
5510 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5511 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5512 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5513 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
5514{
5515 typedef bsl::pair<iterator, bool> ResultType;
5516 bool isInsertedFlag = false;
5517 HashTableLink *result = d_impl.tryEmplace(
5518 &isInsertedFlag,
5519 NULL,
5521 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5522 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5523 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5524 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
5525
5526 return ResultType(iterator(result), isInsertedFlag);
5527}
5528#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5529
5530#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5531template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5532template <class Args_01,
5533 class Args_02,
5534 class Args_03,
5535 class Args_04,
5536 class Args_05>
5537inline
5538bsl::pair<
5540 bool>
5542 BloombergLP::bslmf::MovableRef<KEY> key,
5543 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5544 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5545 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5546 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5547 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
5548{
5549 typedef bsl::pair<iterator, bool> ResultType;
5550 bool isInsertedFlag = false;
5551 HashTableLink *result = d_impl.tryEmplace(
5552 &isInsertedFlag,
5553 NULL,
5555 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5556 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5557 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5558 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5559 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
5560
5561 return ResultType(iterator(result), isInsertedFlag);
5562}
5563#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5564
5565#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5566template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5567template <class Args_01,
5568 class Args_02,
5569 class Args_03,
5570 class Args_04,
5571 class Args_05,
5572 class Args_06>
5573inline
5574bsl::pair<
5576 bool>
5578 BloombergLP::bslmf::MovableRef<KEY> key,
5579 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5580 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5581 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5582 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5583 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5584 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
5585{
5586 typedef bsl::pair<iterator, bool> ResultType;
5587 bool isInsertedFlag = false;
5588 HashTableLink *result = d_impl.tryEmplace(
5589 &isInsertedFlag,
5590 NULL,
5592 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5593 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5594 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5595 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5596 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5597 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
5598
5599 return ResultType(iterator(result), isInsertedFlag);
5600}
5601#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5602
5603#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
5604template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5605template <class Args_01,
5606 class Args_02,
5607 class Args_03,
5608 class Args_04,
5609 class Args_05,
5610 class Args_06,
5611 class Args_07>
5612inline
5613bsl::pair<
5615 bool>
5617 BloombergLP::bslmf::MovableRef<KEY> key,
5618 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5619 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5620 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5621 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5622 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5623 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5624 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
5625{
5626 typedef bsl::pair<iterator, bool> ResultType;
5627 bool isInsertedFlag = false;
5628 HashTableLink *result = d_impl.tryEmplace(
5629 &isInsertedFlag,
5630 NULL,
5632 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5633 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5634 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5635 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5636 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5637 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5638 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
5639
5640 return ResultType(iterator(result), isInsertedFlag);
5641}
5642#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
5643
5644#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
5645template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5646template <class Args_01,
5647 class Args_02,
5648 class Args_03,
5649 class Args_04,
5650 class Args_05,
5651 class Args_06,
5652 class Args_07,
5653 class Args_08>
5654inline
5655bsl::pair<
5657 bool>
5659 BloombergLP::bslmf::MovableRef<KEY> key,
5660 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5661 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5662 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5663 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5664 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5665 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5666 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5667 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
5668{
5669 typedef bsl::pair<iterator, bool> ResultType;
5670 bool isInsertedFlag = false;
5671 HashTableLink *result = d_impl.tryEmplace(
5672 &isInsertedFlag,
5673 NULL,
5675 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5676 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5677 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5678 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5679 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5680 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5681 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5682 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
5683
5684 return ResultType(iterator(result), isInsertedFlag);
5685}
5686#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
5687
5688#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
5689template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5690template <class Args_01,
5691 class Args_02,
5692 class Args_03,
5693 class Args_04,
5694 class Args_05,
5695 class Args_06,
5696 class Args_07,
5697 class Args_08,
5698 class Args_09>
5699inline
5700bsl::pair<
5702 bool>
5704 BloombergLP::bslmf::MovableRef<KEY> key,
5705 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5706 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5707 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5708 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5709 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5710 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5711 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5712 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5713 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
5714{
5715 typedef bsl::pair<iterator, bool> ResultType;
5716 bool isInsertedFlag = false;
5717 HashTableLink *result = d_impl.tryEmplace(
5718 &isInsertedFlag,
5719 NULL,
5721 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5722 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5723 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5724 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5725 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5726 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5727 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5728 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5729 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
5730
5731 return ResultType(iterator(result), isInsertedFlag);
5732}
5733#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
5734
5735#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
5736template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5737template <class Args_01,
5738 class Args_02,
5739 class Args_03,
5740 class Args_04,
5741 class Args_05,
5742 class Args_06,
5743 class Args_07,
5744 class Args_08,
5745 class Args_09,
5746 class Args_10>
5747inline
5748bsl::pair<
5750 bool>
5752 BloombergLP::bslmf::MovableRef<KEY> key,
5753 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5754 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5755 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5756 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5757 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5758 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5759 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5760 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5761 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
5762 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
5763{
5764 typedef bsl::pair<iterator, bool> ResultType;
5765 bool isInsertedFlag = false;
5766 HashTableLink *result = d_impl.tryEmplace(
5767 &isInsertedFlag,
5768 NULL,
5770 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5771 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5772 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5773 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5774 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5775 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5776 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5777 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5778 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
5779 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
5780
5781 return ResultType(iterator(result), isInsertedFlag);
5782}
5783#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
5784
5785
5786#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5787template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5788inline
5791 const_iterator hint,
5792 const KEY& key)
5793{
5794 bool isInsertedFlag = false;
5795 HashTableLink *result = d_impl.tryEmplace(
5796 &isInsertedFlag,
5797 hint.node(),
5798 key);
5799
5800 return iterator(result);
5801}
5802#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
5803
5804#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5805template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5806template <class Args_01>
5807inline
5810 const_iterator hint,
5811 const KEY& key,
5812 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
5813{
5814 bool isInsertedFlag = false;
5815 HashTableLink *result = d_impl.tryEmplace(
5816 &isInsertedFlag,
5817 hint.node(),
5818 key,
5819 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
5820
5821 return iterator(result);
5822}
5823#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
5824
5825#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5826template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5827template <class Args_01,
5828 class Args_02>
5829inline
5832 const_iterator hint,
5833 const KEY& key,
5834 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5835 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
5836{
5837 bool isInsertedFlag = false;
5838 HashTableLink *result = d_impl.tryEmplace(
5839 &isInsertedFlag,
5840 hint.node(),
5841 key,
5842 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5843 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
5844
5845 return iterator(result);
5846}
5847#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
5848
5849#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5850template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5851template <class Args_01,
5852 class Args_02,
5853 class Args_03>
5854inline
5857 const_iterator hint,
5858 const KEY& key,
5859 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5860 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
5862{
5863 bool isInsertedFlag = false;
5864 HashTableLink *result = d_impl.tryEmplace(
5865 &isInsertedFlag,
5866 hint.node(),
5867 key,
5868 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5869 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5870 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
5871
5872 return iterator(result);
5873}
5874#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
5875
5876#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5877template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5878template <class Args_01,
5879 class Args_02,
5880 class Args_03,
5881 class Args_04>
5882inline
5885 const_iterator hint,
5886 const KEY& key,
5887 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5888 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5889 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5890 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
5891{
5892 bool isInsertedFlag = false;
5893 HashTableLink *result = d_impl.tryEmplace(
5894 &isInsertedFlag,
5895 hint.node(),
5896 key,
5897 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5898 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5899 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5900 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
5901
5902 return iterator(result);
5903}
5904#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
5905
5906#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5907template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5908template <class Args_01,
5909 class Args_02,
5910 class Args_03,
5911 class Args_04,
5912 class Args_05>
5913inline
5916 const_iterator hint,
5917 const KEY& key,
5918 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5919 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5920 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5921 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5922 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
5923{
5924 bool isInsertedFlag = false;
5925 HashTableLink *result = d_impl.tryEmplace(
5926 &isInsertedFlag,
5927 hint.node(),
5928 key,
5929 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5930 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5931 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5932 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5933 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
5934
5935 return iterator(result);
5936}
5937#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
5938
5939#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5940template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5941template <class Args_01,
5942 class Args_02,
5943 class Args_03,
5944 class Args_04,
5945 class Args_05,
5946 class Args_06>
5947inline
5950 const_iterator hint,
5951 const KEY& key,
5952 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5953 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5954 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5955 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5956 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5957 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
5958{
5959 bool isInsertedFlag = false;
5960 HashTableLink *result = d_impl.tryEmplace(
5961 &isInsertedFlag,
5962 hint.node(),
5963 key,
5964 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5965 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5966 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5967 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5968 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5969 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
5970
5971 return iterator(result);
5972}
5973#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
5974
5975#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
5976template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
5977template <class Args_01,
5978 class Args_02,
5979 class Args_03,
5980 class Args_04,
5981 class Args_05,
5982 class Args_06,
5983 class Args_07>
5984inline
5987 const_iterator hint,
5988 const KEY& key,
5989 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5990 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5991 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5992 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5993 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5994 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5995 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
5996{
5997 bool isInsertedFlag = false;
5998 HashTableLink *result = d_impl.tryEmplace(
5999 &isInsertedFlag,
6000 hint.node(),
6001 key,
6002 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6003 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6004 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6005 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6006 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6007 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6008 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
6009
6010 return iterator(result);
6011}
6012#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
6013
6014#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
6015template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6016template <class Args_01,
6017 class Args_02,
6018 class Args_03,
6019 class Args_04,
6020 class Args_05,
6021 class Args_06,
6022 class Args_07,
6023 class Args_08>
6024inline
6027 const_iterator hint,
6028 const KEY& key,
6029 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6030 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6031 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6032 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6033 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6034 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6035 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6036 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
6037{
6038 bool isInsertedFlag = false;
6039 HashTableLink *result = d_impl.tryEmplace(
6040 &isInsertedFlag,
6041 hint.node(),
6042 key,
6043 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6044 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6045 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6046 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6047 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6048 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6049 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6050 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
6051
6052 return iterator(result);
6053}
6054#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
6055
6056#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
6057template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6058template <class Args_01,
6059 class Args_02,
6060 class Args_03,
6061 class Args_04,
6062 class Args_05,
6063 class Args_06,
6064 class Args_07,
6065 class Args_08,
6066 class Args_09>
6067inline
6070 const_iterator hint,
6071 const KEY& key,
6072 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6073 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6074 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6075 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6076 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6077 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6078 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6079 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6080 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
6081{
6082 bool isInsertedFlag = false;
6083 HashTableLink *result = d_impl.tryEmplace(
6084 &isInsertedFlag,
6085 hint.node(),
6086 key,
6087 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6088 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6089 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6090 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6091 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6092 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6093 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6094 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6095 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
6096
6097 return iterator(result);
6098}
6099#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
6100
6101#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
6102template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6103template <class Args_01,
6104 class Args_02,
6105 class Args_03,
6106 class Args_04,
6107 class Args_05,
6108 class Args_06,
6109 class Args_07,
6110 class Args_08,
6111 class Args_09,
6112 class Args_10>
6113inline
6116 const_iterator hint,
6117 const KEY& key,
6118 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6119 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6120 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6121 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6122 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6123 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6124 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6125 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6126 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
6127 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
6128{
6129 bool isInsertedFlag = false;
6130 HashTableLink *result = d_impl.tryEmplace(
6131 &isInsertedFlag,
6132 hint.node(),
6133 key,
6134 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6135 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6136 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6137 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6138 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6139 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6140 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6141 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6142 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
6143 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
6144
6145 return iterator(result);
6146}
6147#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
6148
6149
6150#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
6151template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6152inline
6155 const_iterator hint,
6156 BloombergLP::bslmf::MovableRef<KEY> key)
6157{
6158 bool isInsertedFlag = false;
6159 HashTableLink *result = d_impl.tryEmplace(
6160 &isInsertedFlag,
6161 hint.node(),
6163
6164 return iterator(result);
6165}
6166#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 0
6167
6168#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
6169template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6170template <class Args_01>
6171inline
6174 const_iterator hint,
6175 BloombergLP::bslmf::MovableRef<KEY> key,
6176 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
6177{
6178 bool isInsertedFlag = false;
6179 HashTableLink *result = d_impl.tryEmplace(
6180 &isInsertedFlag,
6181 hint.node(),
6183 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
6184
6185 return iterator(result);
6186}
6187#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 1
6188
6189#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
6190template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6191template <class Args_01,
6192 class Args_02>
6193inline
6196 const_iterator hint,
6197 BloombergLP::bslmf::MovableRef<KEY> key,
6198 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6199 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
6200{
6201 bool isInsertedFlag = false;
6202 HashTableLink *result = d_impl.tryEmplace(
6203 &isInsertedFlag,
6204 hint.node(),
6206 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6207 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
6208
6209 return iterator(result);
6210}
6211#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 2
6212
6213#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
6214template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6215template <class Args_01,
6216 class Args_02,
6217 class Args_03>
6218inline
6221 const_iterator hint,
6222 BloombergLP::bslmf::MovableRef<KEY> key,
6223 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6224 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6225 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
6226{
6227 bool isInsertedFlag = false;
6228 HashTableLink *result = d_impl.tryEmplace(
6229 &isInsertedFlag,
6230 hint.node(),
6232 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6233 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6234 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
6235
6236 return iterator(result);
6237}
6238#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 3
6239
6240#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
6241template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6242template <class Args_01,
6243 class Args_02,
6244 class Args_03,
6245 class Args_04>
6246inline
6249 const_iterator hint,
6250 BloombergLP::bslmf::MovableRef<KEY> key,
6251 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6252 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6253 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6254 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
6255{
6256 bool isInsertedFlag = false;
6257 HashTableLink *result = d_impl.tryEmplace(
6258 &isInsertedFlag,
6259 hint.node(),
6261 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6262 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6263 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6264 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
6265
6266 return iterator(result);
6267}
6268#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 4
6269
6270#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
6271template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6272template <class Args_01,
6273 class Args_02,
6274 class Args_03,
6275 class Args_04,
6276 class Args_05>
6277inline
6280 const_iterator hint,
6281 BloombergLP::bslmf::MovableRef<KEY> key,
6282 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6283 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6284 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6285 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6286 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
6287{
6288 bool isInsertedFlag = false;
6289 HashTableLink *result = d_impl.tryEmplace(
6290 &isInsertedFlag,
6291 hint.node(),
6293 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6294 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6295 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6296 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6297 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
6298
6299 return iterator(result);
6300}
6301#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 5
6302
6303#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
6304template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6305template <class Args_01,
6306 class Args_02,
6307 class Args_03,
6308 class Args_04,
6309 class Args_05,
6310 class Args_06>
6311inline
6314 const_iterator hint,
6315 BloombergLP::bslmf::MovableRef<KEY> key,
6316 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6317 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6318 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6319 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6320 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6321 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
6322{
6323 bool isInsertedFlag = false;
6324 HashTableLink *result = d_impl.tryEmplace(
6325 &isInsertedFlag,
6326 hint.node(),
6328 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6329 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6330 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6331 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6332 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6333 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
6334
6335 return iterator(result);
6336}
6337#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 6
6338
6339#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
6340template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6341template <class Args_01,
6342 class Args_02,
6343 class Args_03,
6344 class Args_04,
6345 class Args_05,
6346 class Args_06,
6347 class Args_07>
6348inline
6351 const_iterator hint,
6352 BloombergLP::bslmf::MovableRef<KEY> key,
6353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6354 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6355 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6356 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6357 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6358 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6359 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
6360{
6361 bool isInsertedFlag = false;
6362 HashTableLink *result = d_impl.tryEmplace(
6363 &isInsertedFlag,
6364 hint.node(),
6366 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6367 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6368 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6369 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6370 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6371 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6372 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
6373
6374 return iterator(result);
6375}
6376#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 7
6377
6378#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
6379template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6380template <class Args_01,
6381 class Args_02,
6382 class Args_03,
6383 class Args_04,
6384 class Args_05,
6385 class Args_06,
6386 class Args_07,
6387 class Args_08>
6388inline
6391 const_iterator hint,
6392 BloombergLP::bslmf::MovableRef<KEY> key,
6393 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6394 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6395 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6396 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6397 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6398 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6399 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6400 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
6401{
6402 bool isInsertedFlag = false;
6403 HashTableLink *result = d_impl.tryEmplace(
6404 &isInsertedFlag,
6405 hint.node(),
6407 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6408 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6409 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6410 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6411 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6412 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6413 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6414 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
6415
6416 return iterator(result);
6417}
6418#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 8
6419
6420#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
6421template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6422template <class Args_01,
6423 class Args_02,
6424 class Args_03,
6425 class Args_04,
6426 class Args_05,
6427 class Args_06,
6428 class Args_07,
6429 class Args_08,
6430 class Args_09>
6431inline
6434 const_iterator hint,
6435 BloombergLP::bslmf::MovableRef<KEY> key,
6436 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6437 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6438 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6441 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6442 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6443 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6444 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
6445{
6446 bool isInsertedFlag = false;
6447 HashTableLink *result = d_impl.tryEmplace(
6448 &isInsertedFlag,
6449 hint.node(),
6451 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6452 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6453 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6454 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6455 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6456 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6457 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6458 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6459 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
6460
6461 return iterator(result);
6462}
6463#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 9
6464
6465#if BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
6466template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6467template <class Args_01,
6468 class Args_02,
6469 class Args_03,
6470 class Args_04,
6471 class Args_05,
6472 class Args_06,
6473 class Args_07,
6474 class Args_08,
6475 class Args_09,
6476 class Args_10>
6477inline
6480 const_iterator hint,
6481 BloombergLP::bslmf::MovableRef<KEY> key,
6482 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6483 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6484 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6485 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6486 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6487 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6488 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6489 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6490 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
6491 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
6492{
6493 bool isInsertedFlag = false;
6494 HashTableLink *result = d_impl.tryEmplace(
6495 &isInsertedFlag,
6496 hint.node(),
6498 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6499 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6500 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6501 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6502 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6503 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6504 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6505 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6506 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
6507 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
6508
6509 return iterator(result);
6510}
6511#endif // BSLSTL_UNORDEREDMAP_VARIADIC_LIMIT_G >= 10
6512
6513#else
6514// The generated code below is a workaround for the absence of perfect
6515// forwarding in some compilers.
6516template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6517template <class... Args>
6518inline
6519bsl::pair<
6521 bool>
6523 const KEY& key,
6525{
6526 typedef bsl::pair<iterator, bool> ResultType;
6527 bool isInsertedFlag = false;
6528 HashTableLink *result = d_impl.tryEmplace(
6529 &isInsertedFlag,
6530 NULL,
6531 key,
6532 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6533
6534 return ResultType(iterator(result), isInsertedFlag);
6535}
6536
6537template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6538template <class... Args>
6539inline
6540bsl::pair<
6542 bool>
6544 BloombergLP::bslmf::MovableRef<KEY> key,
6546{
6547 typedef bsl::pair<iterator, bool> ResultType;
6548 bool isInsertedFlag = false;
6549 HashTableLink *result = d_impl.tryEmplace(
6550 &isInsertedFlag,
6551 NULL,
6553 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6554
6555 return ResultType(iterator(result), isInsertedFlag);
6556}
6557
6558template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6559template <class... Args>
6560inline
6563 const_iterator hint,
6564 const KEY& key,
6566{
6567 bool isInsertedFlag = false;
6568 HashTableLink *result = d_impl.tryEmplace(
6569 &isInsertedFlag,
6570 hint.node(),
6571 key,
6572 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6573
6574 return iterator(result);
6575}
6576
6577template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6578template <class... Args>
6579inline
6582 const_iterator hint,
6583 BloombergLP::bslmf::MovableRef<KEY> key,
6585{
6586 bool isInsertedFlag = false;
6587 HashTableLink *result = d_impl.tryEmplace(
6588 &isInsertedFlag,
6589 hint.node(),
6591 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6592
6593 return iterator(result);
6594}
6595// }}} END GENERATED CODE
6596#endif
6597
6598template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6599template <class INPUT_ITERATOR, class SENTINEL>
6600inline
6601void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insertFromRange(
6602 INPUT_ITERATOR first,
6603 SENTINEL last)
6604{
6605 ///Implementation Notes
6606 ///--------------------
6607 // If we can calculate the number of elements, reserve space for them
6608 // upfront to reduce rehashing. The calculation is done once since
6609 // `IteratorUtil::insertDistance` may be expensive for non-random-access
6610 // iterators.
6611
6612 if BSLS_KEYWORD_CONSTEXPR_CPP17 (BloombergLP::bslstl::IteratorUtil
6613 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()) {
6614 this->reserve(this->size()
6615 + BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
6616 }
6617
6618 bool isInsertedFlag; // value is not used
6619
6620 while (first != last) {
6621 d_impl.insertIfMissing(&isInsertedFlag, *first);
6622 ++first;
6623 }
6624}
6625
6626#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
6627 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
6628
6629template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6630template <class INPUT_ITERATOR, class SENTINEL>
6631inline
6632void unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::insertFromRange(
6633 INPUT_ITERATOR first,
6634 SENTINEL last,
6635 size_t numElements)
6636{
6638 !BloombergLP::bslstl::IteratorUtil
6639 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
6640 || numElements == static_cast<size_t>(
6641 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
6642
6643 this->reserve(this->size() + numElements);
6644
6645 bool isInsertedFlag; // value is not used
6646
6647 while (first != last) {
6648 d_impl.insertIfMissing(&isInsertedFlag, *first);
6649 ++first;
6650 }
6651}
6652
6653#endif
6654
6655// ACCESSORS
6656template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6657typename add_lvalue_reference<const VALUE>::type
6658unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::at(
6659 const key_type& key) const
6660{
6661 HashTableLink *target = d_impl.find(key);
6662 if (!target ){
6663 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
6664 "unordered_map<...>::at(key_type): invalid key value");
6665 }
6666 return static_cast<HashTableNode *>(target)->value().second;
6667}
6668
6669template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6670inline
6671typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_iterator
6672unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::begin() const
6674{
6675 return const_iterator(d_impl.elementListRoot());
6676}
6677
6678template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6679inline
6680typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_iterator
6681unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::end() const
6683{
6684 return const_iterator();
6685}
6686
6687template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6688inline
6689typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_iterator
6690unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::cbegin() const
6692{
6693 return const_iterator(d_impl.elementListRoot());
6694}
6695
6696template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6697inline
6698typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_iterator
6699unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::cend() const
6701{
6702 return const_iterator();
6703}
6704
6705template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6706inline
6707typename
6708unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_local_iterator
6709unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::begin(size_type index) const
6710{
6711 BSLS_ASSERT_SAFE(index < this->bucket_count());
6712
6713 return const_local_iterator(&d_impl.bucketAtIndex(index));
6714}
6715
6716template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6717inline
6718typename
6719unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_local_iterator
6720unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::end(size_type index) const
6721{
6722 BSLS_ASSERT_SAFE(index < this->bucket_count());
6723
6724 return const_local_iterator(0, &d_impl.bucketAtIndex(index));
6725}
6726
6727template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6728inline
6729typename
6730unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_local_iterator
6731unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::cbegin(
6732 size_type index) const
6733{
6734 BSLS_ASSERT_SAFE(index < this->bucket_count());
6735
6736 return const_local_iterator(&d_impl.bucketAtIndex(index));
6737}
6738
6739template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6740inline
6741typename
6742unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_local_iterator
6743unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::cend(size_type index) const
6744{
6745 BSLS_ASSERT_SAFE(index < this->bucket_count());
6746
6747 return const_local_iterator(0, &d_impl.bucketAtIndex(index));
6748}
6749
6750template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6751inline
6752typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6753unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::bucket(
6754 const key_type& key) const
6755{
6756 return d_impl.bucketIndexForKey(key);
6757}
6758
6759template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6760inline
6761typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6762unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::bucket_count() const
6764{
6765 return d_impl.numBuckets();
6766}
6767
6768template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6769inline
6770typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6771unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::max_bucket_count() const
6773{
6774 return d_impl.maxNumBuckets();
6775}
6776
6777template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6778inline
6779typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6780unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::bucket_size(
6781 size_type index) const
6782{
6783 BSLS_ASSERT_SAFE(index < this->bucket_count());
6784
6785 return d_impl.countElementsInBucket(index);
6786}
6787
6788template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6789inline
6790typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6791unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::count(
6792 const key_type& key) const
6793{
6794 return d_impl.find(key) != 0;
6795}
6796
6797template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6798inline
6799bool
6800unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::empty() const
6802{
6803 return 0 == d_impl.size();
6804}
6805
6806template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6807bsl::pair<typename unordered_map<KEY,
6808 VALUE,
6809 HASH,
6810 EQUAL,
6811 ALLOCATOR>::const_iterator,
6812 typename unordered_map<KEY,
6813 VALUE,
6814 HASH,
6815 EQUAL,
6816 ALLOCATOR>::const_iterator>
6817unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::equal_range(
6818 const key_type& key) const
6819{
6821
6822 HashTableLink *first = d_impl.find(key);
6823 return first
6824 ? ResultType(const_iterator(first), const_iterator(first->nextLink()))
6825 : ResultType(const_iterator(0), const_iterator(0));
6826}
6827
6828template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6829inline
6830typename
6831 unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::const_iterator
6832unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::find(
6833 const key_type& key) const
6834{
6835 return const_iterator(d_impl.find(key));
6836}
6837
6838template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6839inline
6840ALLOCATOR
6841unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::get_allocator() const
6843{
6844 return d_impl.allocator();
6845}
6846
6847template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6848inline
6849HASH unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::hash_function() const
6850{
6851 return d_impl.hasher();
6852}
6853
6854template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6855inline
6856EQUAL unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::key_eq() const
6857{
6858 return d_impl.comparator();
6859}
6860
6861template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6862inline
6863float
6864unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::load_factor() const
6866{
6867 return d_impl.loadFactor();
6868}
6869
6870template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6871inline
6872float
6873unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::max_load_factor() const
6875{
6876 return d_impl.maxLoadFactor();
6877}
6878
6879template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6880inline
6881typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6882unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size() const
6884{
6885 return d_impl.size();
6886}
6887
6888template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6889inline
6890typename unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::size_type
6891unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>::max_size() const
6893{
6894 return d_impl.maxSize();
6895}
6896
6897} // close namespace bsl
6898
6899// FREE OPERATORS
6900template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6901inline
6902bool bsl::operator==(
6905{
6906 return lhs.d_impl == rhs.d_impl;
6907}
6908
6909#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
6910template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6911inline
6912bool bsl::operator!=(
6915{
6916 return !(lhs == rhs);
6917}
6918#endif
6919
6920// FREE FUNCTIONS
6921template <class KEY,
6922 class VALUE,
6923 class HASH,
6924 class EQUAL,
6925 class ALLOCATOR,
6926 class PREDICATE>
6927inline
6929bsl::erase_if(unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR>& m,
6930 PREDICATE predicate)
6931{
6932 return BloombergLP::bslstl::AlgorithmUtil::containerEraseIf(m, predicate);
6933}
6934
6935template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6936inline
6937void
6941{
6942 a.swap(b);
6943}
6944
6945// ============================================================================
6946// TYPE TRAITS
6947// ============================================================================
6948
6949// Type traits for STL *unordered* *associative* containers:
6950//: o An unordered associative container defines STL iterators.
6951//: o An unordered associative container is bit-wise movable if both functors
6952//: and the allocator are bit-wise movable.
6953//: o An unordered associative container uses 'bslma' allocators if the
6954//: (template parameter) type 'ALLOCATOR' is convertible from
6955//: 'bslma::Allocator *'.
6956
6957
6958namespace bslalg {
6959
6960template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6961struct HasStlIterators<bsl::unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR> >
6963{};
6964
6965} // close namespace bslalg
6966
6967namespace bslma {
6968
6969template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6970struct UsesBslmaAllocator<bsl::unordered_map<KEY,
6971 VALUE,
6972 HASH,
6973 EQUAL,
6974 ALLOCATOR> >
6975 : bsl::is_convertible<Allocator*, ALLOCATOR>::type
6976{};
6977
6978} // close namespace bslma
6979
6980namespace bslmf {
6981
6982template <class KEY, class VALUE, class HASH, class EQUAL, class ALLOCATOR>
6983struct IsBitwiseMoveable<
6984 bsl::unordered_map<KEY, VALUE, HASH, EQUAL, ALLOCATOR> >
6985 : ::BloombergLP::bslmf::IsBitwiseMoveable<BloombergLP::bslstl::HashTable<
6986 ::BloombergLP::bslstl::
6987 UnorderedMapKeyConfiguration<KEY, bsl::pair<const KEY, VALUE> >,
6988 HASH,
6989 EQUAL,
6990 ALLOCATOR> >::type
6991{};
6992
6993} // close namespace bslma
6994
6995
6996#else // if ! defined(DEFINED_BSLSTL_UNORDEREDMAP_H)
6997# error Not valid except when included from bslstl_unorderedmap.h
6998#endif // ! defined(COMPILING_BSLSTL_UNORDEREDMAP_H)
6999
7000#endif // ! defined(INCLUDED_BSLSTL_UNORDEREDMAP_CPP03)
7001
7002// ----------------------------------------------------------------------------
7003// Copyright 2013 Bloomberg Finance L.P.
7004//
7005// Licensed under the Apache License, Version 2.0 (the "License");
7006// you may not use this file except in compliance with the License.
7007// You may obtain a copy of the License at
7008//
7009// http://www.apache.org/licenses/LICENSE-2.0
7010//
7011// Unless required by applicable law or agreed to in writing, software
7012// distributed under the License is distributed on an "AS IS" BASIS,
7013// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7014// See the License for the specific language governing permissions and
7015// limitations under the License.
7016// ----------------------------- END-OF-FILE ----------------------------------
7017
7018/** @} */
7019/** @} */
7020/** @} */
Definition bslma_bslallocator.h:588
Definition bslstl_pair.h:1280
Definition bslstl_unorderedmap.h:1123
unordered_map &operator=(BloombergLP::bslmf::MovableRef< unordered_map > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits add_lvalue_reference< VALUE >::type operator[](const key_type &key)
Definition bslstl_unorderedmap.h:3341
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, iterator >::type find(const LOOKUP_KEY &key)
Definition bslstl_unorderedmap.h:1860
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3886
pair< iterator, bool > insert_or_assign(const KEY &key, BDE_OTHER_TYPE &&obj)
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this unordered map.
Definition bslstl_unorderedmap.h:4078
~unordered_map()
Destroy this object and each of its elements.
Definition bslstl_unorderedmap.h:3283
void insert_range(BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
Definition bslstl_unorderedmap.h:1778
AllocatorTraits::size_type size_type
Definition bslstl_unorderedmap.h:1227
float load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:4060
friend bool operator==(const unordered_map< KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2 > &, const unordered_map< KEY2, VALUE2, HASH2, EQUAL2, ALLOCATOR2 > &)
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3386
AllocatorTraits::pointer pointer
Definition bslstl_unorderedmap.h:1229
value_type & reference
Definition bslstl_unorderedmap.h:1224
EQUAL key_equal
Definition bslstl_unorderedmap.h:1221
AllocatorTraits::const_pointer const_pointer
Definition bslstl_unorderedmap.h:1230
ALLOCATOR allocator_type
Definition bslstl_unorderedmap.h:1222
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_unorderedmap.h:3442
size_type bucket(const key_type &key) const
Definition bslstl_unorderedmap.h:3949
void rehash(size_type numBuckets)
Definition bslstl_unorderedmap.h:3685
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, pair< iterator, iterator > >::type equal_range(const LOOKUP_KEY &key)
Definition bslstl_unorderedmap.h:2167
HASH hash_function() const
Definition bslstl_unorderedmap.h:4045
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:4037
HASH hasher
Definition bslstl_unorderedmap.h:1220
BloombergLP::bslstl::HashTableBucketIterator< value_type, difference_type > local_iterator
Definition bslstl_unorderedmap.h:1237
void reserve(size_type numElements)
Definition bslstl_unorderedmap.h:3694
pair< iterator, bool > insert(const value_type &value)
Definition bslstl_unorderedmap.h:3543
iterator erase(const_iterator position)
Definition bslstl_unorderedmap.h:3466
EQUAL key_eq() const
Definition bslstl_unorderedmap.h:4052
pair< iterator, bool > emplace(Args &&... args)
const value_type & const_reference
Definition bslstl_unorderedmap.h:1225
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:4087
BloombergLP::bslstl::HashTableBucketIterator< const value_type, difference_type > const_local_iterator
Definition bslstl_unorderedmap.h:1239
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3895
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3414
unordered_map()
Definition bslstl_unorderedmap.h:3123
float max_load_factor() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:4069
unordered_map & operator=(const unordered_map &rhs)
Definition bslstl_unorderedmap.h:3292
BloombergLP::bslstl::HashTableIterator< value_type, difference_type > iterator
Definition bslstl_unorderedmap.h:1233
AllocatorTraits::difference_type difference_type
Definition bslstl_unorderedmap.h:1228
bsl::pair< const KEY, VALUE > value_type
Definition bslstl_unorderedmap.h:1219
size_type max_bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3967
enable_if< BloombergLP::bslmf::IsTransparentPredicate< HASH, LOOKUP_KEY >::value &&BloombergLP::bslmf::IsTransparentPredicate< EQUAL, LOOKUP_KEY >::value, size_type >::type count(const LOOKUP_KEY &key) const
Definition bslstl_unorderedmap.h:2477
KEY key_type
Definition bslstl_unorderedmap.h:1217
add_lvalue_reference< VALUE >::type at(const key_type &key)
Definition bslstl_unorderedmap.h:3362
VALUE mapped_type
Definition bslstl_unorderedmap.h:1218
size_type bucket_count() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3958
void swap(unordered_map &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits pair< iterator, bool > try_emplace(const KEY &key, Args &&... args)
Definition bslstl_unorderedmap.h:2246
bool contains(const key_type &key) const
Definition bslstl_unorderedmap.h:3525
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3377
BloombergLP::bslstl::HashTableIterator< const value_type, difference_type > const_iterator
Definition bslstl_unorderedmap.h:1235
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedmap.h:3996
size_type bucket_size(size_type index) const
Definition bslstl_unorderedmap.h:3976
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
#define BSLS_KEYWORD_CONSTEXPR_CPP17
Definition bsls_keyword.h:639
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:674
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:676
#define BSLSTL_UNORDEREDMAP_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
Definition bslstl_unorderedmap.h:1083
void swap(OptionValue &a, OptionValue &b)
bsl::size_t size(const TYPE &array)
Return the number of elements in the specified array.
int reserve(TYPE *array, int numElements)
Definition bdlat_valuetypefunctions.h:939
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4424
T::iterator begin(T &container)
Definition bslstl_iterator.h:1593
const from_range_t from_range
bool operator==(const memory_resource &a, const memory_resource &b)
ALLOCATOR & lhs
Definition bslstl_string.h:3917
T::iterator end(T &container)
Definition bslstl_iterator.h:1621
deque< VALUE_TYPE, ALLOCATOR >::size_type erase_if(deque< VALUE_TYPE, ALLOCATOR > &deq, PREDICATE predicate)
Definition bslstl_deque.h:4433
bool operator!=(const memory_resource &a, const memory_resource &b)
Definition bdlc_flathashmap.h:2218
Definition baljsn_encoder_testtypes.h:76
Definition bdlbb_blob.h:579
Definition bdldfp_decimal.h:5549
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:131
Definition bslma_allocatortraits.h:1089
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR >::type const_pointer
Definition bslma_allocatortraits.h:1183
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR >::type size_type
Definition bslma_allocatortraits.h:1196
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR >::type pointer
Definition bslma_allocatortraits.h:1180
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR >::type difference_type
Definition bslma_allocatortraits.h:1193
Definition bslmf_enableif.h:530
Definition bslstl_equalto.h:316
Definition bslstl_ranges.h:301
Definition bslstl_hash.h:495
Definition bslmf_isconvertible.h:875