BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlc_flathashmap_cpp03.h
Go to the documentation of this file.
1/// @file bdlc_flathashmap_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bdlc_flathashmap_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BDLC_FLATHASHMAP_CPP03
12#define INCLUDED_BDLC_FLATHASHMAP_CPP03
13
14/// @defgroup bdlc_flathashmap_cpp03 bdlc_flathashmap_cpp03
15/// @brief Provide C++03 implementation for bdlc_flathashmap.h
16/// @addtogroup bdl
17/// @{
18/// @addtogroup bdlc
19/// @{
20/// @addtogroup bdlc_flathashmap_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bdlc_flathashmap_cpp03-purpose"> Purpose</a>
25/// * <a href="#bdlc_flathashmap_cpp03-classes"> Classes </a>
26/// * <a href="#bdlc_flathashmap_cpp03-description"> Description </a>
27///
28/// # Purpose {#bdlc_flathashmap_cpp03-purpose}
29/// Provide C++03 implementation for bdlc_flathashmap.h
30///
31/// # Classes {#bdlc_flathashmap_cpp03-classes}
32/// See bdlc_flathashmap.h for list of classes
33///
34/// @see bdlc_flathashmap
35///
36/// # Description {#bdlc_flathashmap_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 Sun Sep 1 06:02:14 2024
48/// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bdl
54 * @{
55 */
56/** @addtogroup bdlc
57 * @{
58 */
59/** @addtogroup bdlc_flathashmap_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BDLC_FLATHASHMAP_H
64
65#if defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
66#include <bsl_type_traits.h>
67
68 #ifndef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
69 #error Rvalue references curiously absent despite native 'type_traits'.
70 #endif
71
72#endif
73
74
75namespace bdlc {
76
77// FORWARD DECLARATIONS
78template <class KEY,
79 class VALUE,
81 class EQUAL = bsl::equal_to<KEY> >
82class FlatHashMap;
83
84template <class KEY, class VALUE, class HASH, class EQUAL>
85bool operator==(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
86 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
87
88template <class KEY, class VALUE, class HASH, class EQUAL>
89bool operator!=(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
90 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
91
92template <class KEY, class VALUE, class HASH, class EQUAL>
93void swap(FlatHashMap<KEY, VALUE, HASH, EQUAL>& a,
94 FlatHashMap<KEY, VALUE, HASH, EQUAL>& b);
95
96 // ============================
97 // struct FlatHashMap_EntryUtil
98 // ============================
99
100/// This templated utility provides methods to construct an `ENTRY` and a
101/// method to extract the key from an `ENTRY`.
102template <class KEY, class VALUE, class ENTRY>
103struct FlatHashMap_EntryUtil
104{
105 // CLASS METHODS
106#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
107// {{{ BEGIN GENERATED CODE
108// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
109#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
110#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
111#endif
112#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_A
113#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_A BDLC_FLATHASHMAP_VARIADIC_LIMIT
114#endif
115#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 0
116 static void construct(
117 ENTRY *entry,
118 bslma::Allocator *allocator);
119#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 0
120
121#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 1
122 template <class ARGS_01>
123 static void construct(
124 ENTRY *entry,
125 bslma::Allocator *allocator,
126 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
127#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 1
128
129#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 2
130 template <class ARGS_01,
131 class ARGS_02>
132 static void construct(
133 ENTRY *entry,
134 bslma::Allocator *allocator,
135 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
136 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
137#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 2
138
139#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 3
140 template <class ARGS_01,
141 class ARGS_02,
142 class ARGS_03>
143 static void construct(
144 ENTRY *entry,
145 bslma::Allocator *allocator,
146 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
147 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
148 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
149#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 3
150
151#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 4
152 template <class ARGS_01,
153 class ARGS_02,
154 class ARGS_03,
155 class ARGS_04>
156 static void construct(
157 ENTRY *entry,
158 bslma::Allocator *allocator,
159 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
160 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
161 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
162 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
163#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 4
164
165#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 5
166 template <class ARGS_01,
167 class ARGS_02,
168 class ARGS_03,
169 class ARGS_04,
170 class ARGS_05>
171 static void construct(
172 ENTRY *entry,
173 bslma::Allocator *allocator,
174 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
175 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
176 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
177 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
178 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
179#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 5
180
181#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 6
182 template <class ARGS_01,
183 class ARGS_02,
184 class ARGS_03,
185 class ARGS_04,
186 class ARGS_05,
187 class ARGS_06>
188 static void construct(
189 ENTRY *entry,
190 bslma::Allocator *allocator,
191 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
192 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
193 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
194 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
195 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
196 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
197#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 6
198
199#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 7
200 template <class ARGS_01,
201 class ARGS_02,
202 class ARGS_03,
203 class ARGS_04,
204 class ARGS_05,
205 class ARGS_06,
206 class ARGS_07>
207 static void construct(
208 ENTRY *entry,
209 bslma::Allocator *allocator,
210 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
211 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
212 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
213 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
214 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
215 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
216 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
217#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 7
218
219#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 8
220 template <class ARGS_01,
221 class ARGS_02,
222 class ARGS_03,
223 class ARGS_04,
224 class ARGS_05,
225 class ARGS_06,
226 class ARGS_07,
227 class ARGS_08>
228 static void construct(
229 ENTRY *entry,
230 bslma::Allocator *allocator,
231 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
232 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
233 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
234 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
235 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
236 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
237 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
238 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
239#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 8
240
241#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 9
242 template <class ARGS_01,
243 class ARGS_02,
244 class ARGS_03,
245 class ARGS_04,
246 class ARGS_05,
247 class ARGS_06,
248 class ARGS_07,
249 class ARGS_08,
250 class ARGS_09>
251 static void construct(
252 ENTRY *entry,
253 bslma::Allocator *allocator,
254 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
255 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
256 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
257 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
258 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
259 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
260 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
261 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
262 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
263#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 9
264
265#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 10
266 template <class ARGS_01,
267 class ARGS_02,
268 class ARGS_03,
269 class ARGS_04,
270 class ARGS_05,
271 class ARGS_06,
272 class ARGS_07,
273 class ARGS_08,
274 class ARGS_09,
275 class ARGS_10>
276 static void construct(
277 ENTRY *entry,
278 bslma::Allocator *allocator,
279 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
280 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
281 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
282 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
283 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
284 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
286 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
287 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
288 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
289#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_A >= 10
290
291#else
292// The generated code below is a workaround for the absence of perfect
293// forwarding in some compilers.
294 template <class... ARGS>
295 static void construct(
296 ENTRY *entry,
297 bslma::Allocator *allocator,
299// }}} END GENERATED CODE
300#endif
301
302 /// Load into the specified `entry` the `ENTRY` value comprised of the
303 /// specified `key` and a default constructed `VALUE`, using the
304 /// specified `allocator` to supply memory. `allocator` is ignored if
305 /// the (template parameter) type `ENTRY` is not allocator aware.
306 template <class KEY_TYPE>
307 static void constructFromKey(
308 ENTRY *entry,
309 bslma::Allocator *allocator,
311
312 /// Return the key of the specified `entry`.
313 static const KEY& key(const ENTRY& entry);
314};
315
316 // =================
317 // class FlatHashMap
318 // =================
319
320/// This class template implements a value-semantic container type holding
321/// an unordered map of `KEY-VALUE` pairs having unique keys that provides a
322/// mapping from keys of (template parameter) type `KEY` to their associated
323/// mapped values of (template parameter) type `VALUE`. The (template
324/// parameter) type `HASH` is a functor providing the hash value for `KEY`.
325/// The (template parameter) type `EQUAL` is a functor providing the
326/// equality function for two `KEY` values. See {Requirements on `KEY`,
327/// `HASH`, and `EQUAL`} for more information.
328///
329/// See @ref bdlc_flathashmap_cpp03
330template <class KEY, class VALUE, class HASH, class EQUAL>
331class FlatHashMap {
332
333 private:
334 // PRIVATE TYPES
335
336 /// This is the underlying implementation class.
337 typedef FlatHashTable<KEY,
339 FlatHashMap_EntryUtil<KEY,
340 VALUE,
342 HASH,
343 EQUAL> ImplType;
344
345 // FRIENDS
346 friend bool operator==<>(const FlatHashMap&, const FlatHashMap&);
347 friend bool operator!=<>(const FlatHashMap&, const FlatHashMap&);
348
349 // The following verbose declaration is required by the xlC 12.1 compiler.
350 template <class K, class V, class H, class E>
351 friend void swap(FlatHashMap<K, V, H, E>&, FlatHashMap<K, V, H, E>&);
352
353 public:
354 // PUBLIC TYPES
356
357 typedef KEY key_type;
358 typedef VALUE mapped_type;
359 typedef bsl::size_t size_type;
360 typedef bsl::ptrdiff_t difference_type;
361 typedef EQUAL key_compare;
362 typedef HASH hasher;
363 typedef value_type& reference;
364 typedef const value_type& const_reference;
365 typedef value_type* pointer;
366 typedef const value_type* const_pointer;
367 typedef typename ImplType::iterator iterator;
369
370 private:
371 // DATA
372 ImplType d_impl; // underlying flat hash table used by this flat hash map
373
374 public:
375 // CREATORS
376
377 FlatHashMap();
378 explicit FlatHashMap(bslma::Allocator *basicAllocator);
379 explicit FlatHashMap(bsl::size_t capacity);
380 FlatHashMap(bsl::size_t capacity, bslma::Allocator *basicAllocator);
381 FlatHashMap(bsl::size_t capacity,
382 const HASH& hash,
383 bslma::Allocator *basicAllocator = 0);
384 /// Create an empty `FlatHashMap` object. Optionally specify a
385 /// `capacity` indicating the minimum initial size of the underlying
386 /// array of entries of this container. If `capacity` is not supplied
387 /// or is 0, no memory is allocated. Optionally specify a `hash`
388 /// functor used to generate the hash values associated with the keys of
389 /// elements in this container. If `hash` is not supplied, a
390 /// default-constructed object of the (template parameter) type `HASH`
391 /// is used. Optionally specify an equality functor `equal` used to
392 /// determine whether the keys of two elements are equivalent. If
393 /// `equal` is not supplied, a default-constructed object of the
394 /// (template parameter) type `EQUAL` is used. Optionally specify a
395 /// `basicAllocator` used to supply memory. If `basicAllocator` is not
396 /// supplied or is 0, the currently installed default allocator is used.
397 FlatHashMap(bsl::size_t capacity,
398 const HASH& hash,
399 const EQUAL& equal,
400 bslma::Allocator *basicAllocator = 0);
401
402 /// Create a `FlatHashMap` object initialized by insertion of the values
403 /// from the input iterator range specified by `first` through `last`
404 /// (including `first`, excluding `last`). Optionally specify a
405 /// `capacity` indicating the minimum initial size of the underlying
406 /// array of entries of this container. If `capacity` is not supplied
407 /// or is 0, no memory is allocated. Optionally specify a `hash`
408 /// functor used to generate hash values associated with the keys of the
409 /// elements in this container. If `hash` is not supplied, a
410 /// default-constructed object of the (template parameter) type `HASH`
411 /// is used. Optionally specify an equality functor `equal` used to
412 /// determine whether the keys of two elements are equivalent. If
413 /// `equal` is not supplied, a default-constructed object of the
414 /// (template parameter) type `EQUAL` is used. Optionally specify a
415 /// `basicAllocator` used to supply memory. If `basicAllocator` is not
416 /// supplied or is 0, the currently installed default allocator is used.
417 /// The behavior is undefined unless `first` and `last` refer to a
418 /// sequence of valid values where `first` is at a position at or before
419 /// `last`. Note that if a member of the input sequence has an
420 /// equivalent key to an earlier member, the later member will not be
421 /// inserted.
422 template <class INPUT_ITERATOR>
423 FlatHashMap(INPUT_ITERATOR first,
424 INPUT_ITERATOR last,
425 bslma::Allocator *basicAllocator = 0);
426 template <class INPUT_ITERATOR>
427 FlatHashMap(INPUT_ITERATOR first,
428 INPUT_ITERATOR last,
429 bsl::size_t capacity,
430 bslma::Allocator *basicAllocator = 0);
431 template <class INPUT_ITERATOR>
432 FlatHashMap(INPUT_ITERATOR first,
433 INPUT_ITERATOR last,
434 bsl::size_t capacity,
435 const HASH& hash,
436 bslma::Allocator *basicAllocator = 0);
437 template <class INPUT_ITERATOR>
438 FlatHashMap(INPUT_ITERATOR first,
439 INPUT_ITERATOR last,
440 bsl::size_t capacity,
441 const HASH& hash,
442 const EQUAL& equal,
443 bslma::Allocator *basicAllocator = 0);
444
445#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
446 FlatHashMap(bsl::initializer_list<value_type> values,
447 bslma::Allocator *basicAllocator = 0);
448 FlatHashMap(bsl::initializer_list<value_type> values,
449 bsl::size_t capacity,
450 bslma::Allocator *basicAllocator = 0);
451 FlatHashMap(bsl::initializer_list<value_type> values,
452 bsl::size_t capacity,
453 const HASH& hash,
454 bslma::Allocator *basicAllocator = 0);
455 /// Create a `FlatHashMap` object initialized by insertion of the
456 /// specified `values`. Optionally specify a `capacity` indicating the
457 /// minimum initial size of the underlying array of entries of this
458 /// container. If `capacity` is not supplied or is 0, no memory is
459 /// allocated. Optionally specify a `hash` functor used to generate
460 /// hash values associated with the keys of elements in this container.
461 /// If `hash` is not supplied, a default-constructed object of the
462 /// (template parameter) type `HASH` is used. Optionally specify an
463 /// equality functor `equal` used to determine whether the keys of two
464 /// elements are equivalent. If `equal` is not supplied, a
465 /// default-constructed object of the (template parameter) type `EQUAL`
466 /// is used. Optionally specify a `basicAllocator` used to supply
467 /// memory. If `basicAllocator` is not supplied or is 0, the currently
468 /// installed default allocator is used. Note that if a member of
469 /// `values` has an equivalent key to an earlier member, the later
470 /// member will not be inserted.
471 FlatHashMap(bsl::initializer_list<value_type> values,
472 bsl::size_t capacity,
473 const HASH& hash,
474 const EQUAL& equal,
475 bslma::Allocator *basicAllocator = 0);
476#endif
477
478 /// Create a `FlatHashMap` object having the same value, hasher, and
479 /// equality comparator as the specified `original` object. Optionally
480 /// specify a `basicAllocator` used to supply memory. If
481 /// `basicAllocator` is not specified or is 0, the currently installed
482 /// default allocator is used.
483 FlatHashMap(const FlatHashMap& original,
484 bslma::Allocator *basicAllocator = 0);
485
486 /// Create a `FlatHashMap` object having the same value, hasher,
487 /// equality comparator, and allocator as the specified `original`
488 /// object. The contents of `original` are moved (in constant time) to
489 /// this object, `original` is left in a (valid) unspecified state, and
490 /// no exceptions will be thrown.
492
493 /// Create a `FlatHashMap` object having the same value, hasher, and
494 /// equality comparator as the specified `original` object, using the
495 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
496 /// 0, the currently installed default allocator is used. The allocator
497 /// of `original` remains unchanged. If `original` and the newly
498 /// created object have the same allocator then the contents of
499 /// `original` are moved (in constant time) to this object, `original`
500 /// is left in a (valid) unspecified state, and no exceptions will be
501 /// thrown; otherwise, `original` is unchanged (and an exception may be
502 /// thrown).
504 bslma::Allocator *basicAllocator);
505
506 /// Destroy this object and each of its elements.
507 ~FlatHashMap();
508
509 // MANIPULATORS
510
511 /// Assign to this object the value, hasher, and equality functor of the
512 /// specified `rhs` object, and return a reference providing modifiable
513 /// access to this object.
514 FlatHashMap& operator=(const FlatHashMap& rhs);
515
516 /// Assign to this object the value, hasher, and equality comparator of
517 /// the specified `rhs` object, and return a reference providing
518 /// modifiable access to this object. If this object and `rhs` use the
519 /// same allocator the contents of `rhs` are moved (in constant time) to
520 /// this object. `rhs` is left in a (valid) unspecified state.
522
523#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
524 /// Assign to this object the value resulting from first clearing this
525 /// map and then inserting each object in the specified `values`
526 /// initializer list, ignoring those objects having a value whose key is
527 /// equivalent to that which appears earlier in the list; return a
528 /// reference providing modifiable access to this object. This method
529 /// requires that the (template parameter) type `KEY` be
530 /// `copy-insertable` into this map (see {Requirements on `KEY`, `HASH`,
531 /// and `EQUAL`}).
532 FlatHashMap& operator=(bsl::initializer_list<value_type> values);
533#endif
534
535 /// Return a reference providing modifiable access to the mapped value
536 /// associated with the specified `key` in this map. If this map does
537 /// not already contain an element having `key`, insert an element with
538 /// the `key` and a default-constructed `VALUE`, and return a reference
539 /// to the newly mapped value. If `key` is movable, `key` is left in a
540 /// (valid) unspecified state.
541 template <class KEY_TYPE>
542 VALUE& operator[](BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) key);
543
544 /// Return a reference providing modifiable access to the mapped value
545 /// associated with the specified `key` in this map, if such an entry
546 /// exists; otherwise throw a `std::out_of_range` exception. Note that
547 /// this method is not exception-neutral.
548 VALUE& at(const KEY& key);
549
550 /// Remove all elements from this map. Note that this map will be empty
551 /// after calling this method, but allocated memory may be retained for
552 /// future use. See the `capacity` method.
553 void clear();
554
555 /// Return a pair of iterators defining the sequence of modifiable
556 /// elements in this map having the specified `key`, where the first
557 /// iterator is positioned at the start of the sequence and the second
558 /// iterator is positioned one past the end of the sequence. If this
559 /// map contains no elements having a key equivalent to `key`, then the
560 /// two returned iterators will have the same value. Note that since a
561 /// map maintains unique keys, the range will contain at most one
562 /// element.
564
565#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
566// {{{ BEGIN GENERATED CODE
567// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
568#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
569#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
570#endif
571#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_B
572#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_B BDLC_FLATHASHMAP_VARIADIC_LIMIT
573#endif
574#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 0
576 );
577#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 0
578
579#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 1
580 template <class ARGS_01>
582 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
583#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 1
584
585#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 2
586 template <class ARGS_01,
587 class ARGS_02>
589 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
590 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
591#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 2
592
593#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 3
594 template <class ARGS_01,
595 class ARGS_02,
596 class ARGS_03>
598 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
599 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
600 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
601#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 3
602
603#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 4
604 template <class ARGS_01,
605 class ARGS_02,
606 class ARGS_03,
607 class ARGS_04>
609 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
610 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
611 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
612 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
613#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 4
614
615#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 5
616 template <class ARGS_01,
617 class ARGS_02,
618 class ARGS_03,
619 class ARGS_04,
620 class ARGS_05>
622 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
623 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
624 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
625 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
626 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
627#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 5
628
629#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 6
630 template <class ARGS_01,
631 class ARGS_02,
632 class ARGS_03,
633 class ARGS_04,
634 class ARGS_05,
635 class ARGS_06>
637 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
638 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
639 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
640 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
641 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
642 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
643#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 6
644
645#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 7
646 template <class ARGS_01,
647 class ARGS_02,
648 class ARGS_03,
649 class ARGS_04,
650 class ARGS_05,
651 class ARGS_06,
652 class ARGS_07>
654 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
655 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
656 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
657 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
658 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
659 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
660 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
661#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 7
662
663#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 8
664 template <class ARGS_01,
665 class ARGS_02,
666 class ARGS_03,
667 class ARGS_04,
668 class ARGS_05,
669 class ARGS_06,
670 class ARGS_07,
671 class ARGS_08>
673 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
674 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
675 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
676 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
677 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
678 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
679 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
680 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
681#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 8
682
683#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 9
684 template <class ARGS_01,
685 class ARGS_02,
686 class ARGS_03,
687 class ARGS_04,
688 class ARGS_05,
689 class ARGS_06,
690 class ARGS_07,
691 class ARGS_08,
692 class ARGS_09>
694 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
695 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
696 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
697 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
698 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
699 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
700 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
701 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
702 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
703#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 9
704
705#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 10
706 template <class ARGS_01,
707 class ARGS_02,
708 class ARGS_03,
709 class ARGS_04,
710 class ARGS_05,
711 class ARGS_06,
712 class ARGS_07,
713 class ARGS_08,
714 class ARGS_09,
715 class ARGS_10>
717 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
718 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
719 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
720 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
721 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
722 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
723 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
724 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
725 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
726 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
727#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 10
728
729
730#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 0
732#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 0
733
734#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 1
735 template <class ARGS_01>
737 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
738#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 1
739
740#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 2
741 template <class ARGS_01,
742 class ARGS_02>
744 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
745 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
746#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 2
747
748#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 3
749 template <class ARGS_01,
750 class ARGS_02,
751 class ARGS_03>
753 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
754 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
755 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
756#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 3
757
758#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 4
759 template <class ARGS_01,
760 class ARGS_02,
761 class ARGS_03,
762 class ARGS_04>
764 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
765 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
766 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
767 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
768#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 4
769
770#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 5
771 template <class ARGS_01,
772 class ARGS_02,
773 class ARGS_03,
774 class ARGS_04,
775 class ARGS_05>
777 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
778 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
779 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
780 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
781 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
782#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 5
783
784#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 6
785 template <class ARGS_01,
786 class ARGS_02,
787 class ARGS_03,
788 class ARGS_04,
789 class ARGS_05,
790 class ARGS_06>
792 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
793 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
794 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
795 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
796 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
797 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
798#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 6
799
800#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 7
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>
809 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
810 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
811 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
812 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
813 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
814 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
815 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
816#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 7
817
818#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 8
819 template <class ARGS_01,
820 class ARGS_02,
821 class ARGS_03,
822 class ARGS_04,
823 class ARGS_05,
824 class ARGS_06,
825 class ARGS_07,
826 class ARGS_08>
828 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
829 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
830 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
831 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
832 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
833 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
834 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
835 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
836#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 8
837
838#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 9
839 template <class ARGS_01,
840 class ARGS_02,
841 class ARGS_03,
842 class ARGS_04,
843 class ARGS_05,
844 class ARGS_06,
845 class ARGS_07,
846 class ARGS_08,
847 class ARGS_09>
849 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
850 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
851 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
852 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
853 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
854 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
855 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
856 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
857 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
858#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 9
859
860#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 10
861 template <class ARGS_01,
862 class ARGS_02,
863 class ARGS_03,
864 class ARGS_04,
865 class ARGS_05,
866 class ARGS_06,
867 class ARGS_07,
868 class ARGS_08,
869 class ARGS_09,
870 class ARGS_10>
872 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
873 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
874 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
875 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
876 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
877 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
878 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
879 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
880 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
881 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
882#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_B >= 10
883
884#else
885// The generated code below is a workaround for the absence of perfect
886// forwarding in some compilers.
887 template <class... ARGS>
890
891 template <class... ARGS>
894// }}} END GENERATED CODE
895#endif
896
897 /// Remove from this map the element whose key is equal to the specified
898 /// `key`, if it exists, and return 1; otherwise (there is no element
899 /// having `key` in this map), return 0 with no other effect. This
900 /// method invalidates all iterators and references to the removed
901 /// element.
902 bsl::size_t erase(const KEY& key);
903
904 iterator erase(const_iterator position);
905 /// Remove from this map the element at the specified `position`, and
906 /// return an iterator referring to the modifiable element immediately
907 /// following the removed element, or to the past-the-end position if
908 /// the removed element was the last element in the sequence of elements
909 /// maintained by this map. This method invalidates all iterators and
910 /// references to the removed element. The behavior is undefined unless
911 /// `position` refers to an element in this map.
912 iterator erase(iterator position);
913
914 /// Remove from this map the elements starting at the specified `first`
915 /// position up to, but not including, the specified `last` position,
916 /// and return an iterator referencing the same element as `last`. This
917 /// method invalidates all iterators and references to the removed
918 /// elements. The behavior is undefined unless `first` and `last` are
919 /// valid iterators on this map, and the `first` position is at or
920 /// before the `last` position in the iteration sequence provided by
921 /// this container.
923
924 /// Return an iterator referring to the modifiable element in this map
925 /// having the specified `key`, or `end()` if no such entry exists in
926 /// this map.
927 iterator find(const KEY& key);
928
929#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
930 template <class VALUE_TYPE>
932#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
933 template <class VALUE_TYPE>
936#else
937 /// Insert the specified `value` into this map if the key of `value`
938 /// does not already exist in this map; otherwise, this method has no
939 /// effect. Return a `pair` whose `first` member is an iterator
940 /// referring to the (possibly newly inserted) modifiable element in
941 /// this map whose key is equivalent to that of the element to be
942 /// inserted, and whose `second` member is `true` if a new element was
943 /// inserted, and `false` if an element with an equivalent key was
944 /// already present.
945 template <class VALUE_TYPE>
946 typename bsl::enable_if<bsl::is_constructible<value_type,
947 VALUE_TYPE&&>::value,
949#endif
951 {
952 // Note that some compilers require functions declared with 'enable_if'
953 // to be defined inline.
954
955 return d_impl.insert(BSLS_COMPILERFEATURES_FORWARD(VALUE_TYPE, value));
956 }
957
958#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
959 template <class VALUE_TYPE>
961#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
962 template <class VALUE_TYPE>
964 iterator>::type
965#else
966 /// Insert the specified `value` into this map if the key of `value`
967 /// does not already exist in this map; otherwise, this method has no
968 /// effect. Return an iterator referring to the (possibly newly
969 /// inserted) modifiable element in this map whose key is equivalent to
970 /// that of the element to be inserted. The supplied `const_iterator`
971 /// is ignored.
972 template <class VALUE_TYPE>
973 typename bsl::enable_if<bsl::is_constructible<value_type,
974 VALUE_TYPE&&>::value,
975 iterator>::type
976#endif
978 BSLS_COMPILERFEATURES_FORWARD_REF(VALUE_TYPE) value)
979 {
980 // Note that some compilers require functions declared with 'enable_if'
981 // to be defined inline.
982
983 return d_impl.insert(BSLS_COMPILERFEATURES_FORWARD(VALUE_TYPE,
984 value)).first;
985 }
986
987 /// Insert into this map the value of each element in the input iterator
988 /// range specified by `first` through `last` (including `first`,
989 /// excluding `last`). The behavior is undefined unless `first` and
990 /// `last` refer to a sequence of valid values where `first` is at a
991 /// position at or before `last`. Note that if the key of a member of
992 /// the input sequence is equivalent to the key of an earlier member,
993 /// the later member will not be inserted.
994 template <class INPUT_ITERATOR>
995 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
996
997#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
998 /// Insert into this map an element having the value of each object in
999 /// the specified `values` initializer list if a value with an
1000 /// equivalent key is not already contained in this map. This method
1001 /// requires that the (template parameter) type `KEY` be copy-insertable
1002 /// (see {Requirements on `KEY`, `HASH`, and `EQUAL`}).
1003 void insert(bsl::initializer_list<value_type> values);
1004#endif
1005
1006 /// Change the capacity of this map to at least the specified
1007 /// `minimumCapacity`, and redistribute all the contained elements into
1008 /// a new sequence of entries according to their hash values. If
1009 /// `0 == minimumCapacity` and `0 == size()`, the map is returned to the
1010 /// default constructed state. After this call, `load_factor()` will be
1011 /// less than or equal to `max_load_factor()` and all iterators,
1012 /// pointers, and references to elements of this map are invalidated.
1013 void rehash(bsl::size_t minimumCapacity);
1014
1015 /// Change the capacity of this map to at least a capacity that can
1016 /// accommodate the specified `numEntries` (accounting for the load
1017 /// factor invariant), and redistribute all the contained elements into
1018 /// a new sequence of entries according to their hash values. If
1019 /// `0 == numEntries` and `0 == size()`, the map is returned to the
1020 /// default constructed state. After this call, `load_factor()` will be
1021 /// less than or equal to `max_load_factor()` and all iterators,
1022 /// pointers, and references to elements of this map are invalidated.
1023 /// Note that this method is effectively equivalent to:
1024 /// @code
1025 /// rehash(bsl::ceil(numEntries / max_load_factor()))
1026 /// @endcode
1027 void reserve(bsl::size_t numEntries);
1028
1029 /// Remove all elements from this map and release all memory from this
1030 /// map, returning the map to the default constructed state.
1031 void reset();
1032
1033#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1034// {{{ BEGIN GENERATED CODE
1035// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
1036#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
1037#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
1038#endif
1039#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_C
1040#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_C BDLC_FLATHASHMAP_VARIADIC_LIMIT
1041#endif
1042#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1043#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1044 bsl::pair<iterator, bool> try_emplace(const KEY& key);
1045#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1046
1047#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1048 template< class ARGS_01>
1049 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1050 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1051#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1052
1053#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1054 template< class ARGS_01,
1055 class ARGS_02>
1056 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1057 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1058 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1059#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1060
1061#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1062 template< class ARGS_01,
1063 class ARGS_02,
1064 class ARGS_03>
1065 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1066 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1067 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1068 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1069#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1070
1071#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1072 template< class ARGS_01,
1073 class ARGS_02,
1074 class ARGS_03,
1075 class ARGS_04>
1076 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1077 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1078 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1079 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1080 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1081#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1082
1083#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1084 template< class ARGS_01,
1085 class ARGS_02,
1086 class ARGS_03,
1087 class ARGS_04,
1088 class ARGS_05>
1089 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1090 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1091 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1092 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1093 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1094 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1095#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1096
1097#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1098 template< class ARGS_01,
1099 class ARGS_02,
1100 class ARGS_03,
1101 class ARGS_04,
1102 class ARGS_05,
1103 class ARGS_06>
1104 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1105 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1106 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1107 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1108 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1109 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1110 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1111#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1112
1113#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1114 template< class ARGS_01,
1115 class ARGS_02,
1116 class ARGS_03,
1117 class ARGS_04,
1118 class ARGS_05,
1119 class ARGS_06,
1120 class ARGS_07>
1121 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1122 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1123 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1124 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1125 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1126 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1127 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1128 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1129#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1130
1131#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1132 template< class ARGS_01,
1133 class ARGS_02,
1134 class ARGS_03,
1135 class ARGS_04,
1136 class ARGS_05,
1137 class ARGS_06,
1138 class ARGS_07,
1139 class ARGS_08>
1140 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1141 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1142 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1143 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1144 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1145 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1146 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1147 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1148 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1149#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1150
1151#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1152 template< class ARGS_01,
1153 class ARGS_02,
1154 class ARGS_03,
1155 class ARGS_04,
1156 class ARGS_05,
1157 class ARGS_06,
1158 class ARGS_07,
1159 class ARGS_08,
1160 class ARGS_09>
1161 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1162 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1163 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1164 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1165 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1166 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1167 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1168 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1170 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1171#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1172
1173#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1174 template< class ARGS_01,
1175 class ARGS_02,
1176 class ARGS_03,
1177 class ARGS_04,
1178 class ARGS_05,
1179 class ARGS_06,
1180 class ARGS_07,
1181 class ARGS_08,
1182 class ARGS_09,
1183 class ARGS_10>
1184 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1185 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1186 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1187 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1188 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1189 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1190 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1191 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1192 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1193 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1194 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1195#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1196
1197
1198#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1199 bsl::pair<iterator, bool> try_emplace(
1200 BloombergLP::bslmf::MovableRef<KEY> key);
1201#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1202
1203#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1204 template <class ARGS_01>
1205 bsl::pair<iterator, bool> try_emplace(
1206 BloombergLP::bslmf::MovableRef<KEY> key,
1207 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1208#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1209
1210#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1211 template <class ARGS_01,
1212 class ARGS_02>
1213 bsl::pair<iterator, bool> try_emplace(
1214 BloombergLP::bslmf::MovableRef<KEY> key,
1215 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1216 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1217#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1218
1219#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1220 template <class ARGS_01,
1221 class ARGS_02,
1222 class ARGS_03>
1223 bsl::pair<iterator, bool> try_emplace(
1224 BloombergLP::bslmf::MovableRef<KEY> key,
1225 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1226 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1227 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1228#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1229
1230#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1231 template <class ARGS_01,
1232 class ARGS_02,
1233 class ARGS_03,
1234 class ARGS_04>
1235 bsl::pair<iterator, bool> try_emplace(
1236 BloombergLP::bslmf::MovableRef<KEY> key,
1237 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1238 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1239 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1240 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1241#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1242
1243#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1244 template <class ARGS_01,
1245 class ARGS_02,
1246 class ARGS_03,
1247 class ARGS_04,
1248 class ARGS_05>
1249 bsl::pair<iterator, bool> try_emplace(
1250 BloombergLP::bslmf::MovableRef<KEY> key,
1251 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1252 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1253 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1254 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1255 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1256#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1257
1258#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1259 template <class ARGS_01,
1260 class ARGS_02,
1261 class ARGS_03,
1262 class ARGS_04,
1263 class ARGS_05,
1264 class ARGS_06>
1265 bsl::pair<iterator, bool> try_emplace(
1266 BloombergLP::bslmf::MovableRef<KEY> key,
1267 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1268 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1269 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1270 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1271 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1272 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1273#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1274
1275#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1276 template <class ARGS_01,
1277 class ARGS_02,
1278 class ARGS_03,
1279 class ARGS_04,
1280 class ARGS_05,
1281 class ARGS_06,
1282 class ARGS_07>
1283 bsl::pair<iterator, bool> try_emplace(
1284 BloombergLP::bslmf::MovableRef<KEY> key,
1285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1286 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1287 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1288 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1289 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1290 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1291 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1292#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1293
1294#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1295 template <class ARGS_01,
1296 class ARGS_02,
1297 class ARGS_03,
1298 class ARGS_04,
1299 class ARGS_05,
1300 class ARGS_06,
1301 class ARGS_07,
1302 class ARGS_08>
1303 bsl::pair<iterator, bool> try_emplace(
1304 BloombergLP::bslmf::MovableRef<KEY> key,
1305 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1306 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1307 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1308 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1309 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1310 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1311 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1312 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1313#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1314
1315#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1316 template <class ARGS_01,
1317 class ARGS_02,
1318 class ARGS_03,
1319 class ARGS_04,
1320 class ARGS_05,
1321 class ARGS_06,
1322 class ARGS_07,
1323 class ARGS_08,
1324 class ARGS_09>
1325 bsl::pair<iterator, bool> try_emplace(
1326 BloombergLP::bslmf::MovableRef<KEY> key,
1327 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1328 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1329 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1330 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1331 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1332 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1333 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1334 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1335 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1336#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1337
1338#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1339 template <class ARGS_01,
1340 class ARGS_02,
1341 class ARGS_03,
1342 class ARGS_04,
1343 class ARGS_05,
1344 class ARGS_06,
1345 class ARGS_07,
1346 class ARGS_08,
1347 class ARGS_09,
1348 class ARGS_10>
1349 bsl::pair<iterator, bool> try_emplace(
1350 BloombergLP::bslmf::MovableRef<KEY> key,
1351 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1352 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1353 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1354 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1355 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1356 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1357 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1358 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1359 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1360 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1361#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1362
1363
1364#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1365 iterator
1366 try_emplace(const_iterator, const KEY& key);
1367#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1368
1369#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1370 template<class ARGS_01>
1371 iterator
1372 try_emplace(const_iterator, const KEY& key,
1373 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1374#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1375
1376#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1377 template<class ARGS_01,
1378 class ARGS_02>
1379 iterator
1380 try_emplace(const_iterator, const KEY& key,
1381 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1382 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1383#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1384
1385#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1386 template<class ARGS_01,
1387 class ARGS_02,
1388 class ARGS_03>
1389 iterator
1390 try_emplace(const_iterator, const KEY& key,
1391 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1392 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1393 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1394#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1395
1396#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1397 template<class ARGS_01,
1398 class ARGS_02,
1399 class ARGS_03,
1400 class ARGS_04>
1401 iterator
1402 try_emplace(const_iterator, const KEY& key,
1403 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1404 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1405 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1406 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1407#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1408
1409#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1410 template<class ARGS_01,
1411 class ARGS_02,
1412 class ARGS_03,
1413 class ARGS_04,
1414 class ARGS_05>
1415 iterator
1416 try_emplace(const_iterator, const KEY& key,
1417 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1418 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1419 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1420 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1421 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1422#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1423
1424#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1425 template<class ARGS_01,
1426 class ARGS_02,
1427 class ARGS_03,
1428 class ARGS_04,
1429 class ARGS_05,
1430 class ARGS_06>
1431 iterator
1432 try_emplace(const_iterator, const KEY& key,
1433 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1434 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1435 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1436 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1437 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1438 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1439#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1440
1441#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1442 template<class ARGS_01,
1443 class ARGS_02,
1444 class ARGS_03,
1445 class ARGS_04,
1446 class ARGS_05,
1447 class ARGS_06,
1448 class ARGS_07>
1449 iterator
1450 try_emplace(const_iterator, const KEY& key,
1451 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1452 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1453 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1454 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1455 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1456 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1457 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1458#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1459
1460#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1461 template<class ARGS_01,
1462 class ARGS_02,
1463 class ARGS_03,
1464 class ARGS_04,
1465 class ARGS_05,
1466 class ARGS_06,
1467 class ARGS_07,
1468 class ARGS_08>
1469 iterator
1470 try_emplace(const_iterator, const KEY& key,
1471 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1472 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1473 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1474 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1475 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1476 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1477 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1478 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1479#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1480
1481#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1482 template<class ARGS_01,
1483 class ARGS_02,
1484 class ARGS_03,
1485 class ARGS_04,
1486 class ARGS_05,
1487 class ARGS_06,
1488 class ARGS_07,
1489 class ARGS_08,
1490 class ARGS_09>
1491 iterator
1492 try_emplace(const_iterator, const KEY& key,
1493 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1494 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1495 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1496 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1497 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1498 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1499 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1500 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1501 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1502#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1503
1504#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1505 template<class ARGS_01,
1506 class ARGS_02,
1507 class ARGS_03,
1508 class ARGS_04,
1509 class ARGS_05,
1510 class ARGS_06,
1511 class ARGS_07,
1512 class ARGS_08,
1513 class ARGS_09,
1514 class ARGS_10>
1515 iterator
1516 try_emplace(const_iterator, const KEY& key,
1517 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1518 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1519 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1520 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1521 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1522 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1523 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1524 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1525 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1526 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1527#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1528
1529
1530#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1531 iterator try_emplace(const_iterator,
1532 BloombergLP::bslmf::MovableRef<KEY> key);
1533#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
1534
1535#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1536 template <class ARGS_01>
1537 iterator try_emplace(const_iterator,
1538 BloombergLP::bslmf::MovableRef<KEY> key,
1539 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1540#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
1541
1542#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1543 template <class ARGS_01,
1544 class ARGS_02>
1545 iterator try_emplace(const_iterator,
1546 BloombergLP::bslmf::MovableRef<KEY> key,
1547 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1548 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1549#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
1550
1551#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1552 template <class ARGS_01,
1553 class ARGS_02,
1554 class ARGS_03>
1555 iterator try_emplace(const_iterator,
1556 BloombergLP::bslmf::MovableRef<KEY> key,
1557 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1558 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1559 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1560#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
1561
1562#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1563 template <class ARGS_01,
1564 class ARGS_02,
1565 class ARGS_03,
1566 class ARGS_04>
1567 iterator try_emplace(const_iterator,
1568 BloombergLP::bslmf::MovableRef<KEY> key,
1569 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1570 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1571 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1572 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1573#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
1574
1575#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1576 template <class ARGS_01,
1577 class ARGS_02,
1578 class ARGS_03,
1579 class ARGS_04,
1580 class ARGS_05>
1581 iterator try_emplace(const_iterator,
1582 BloombergLP::bslmf::MovableRef<KEY> key,
1583 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1584 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1585 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1586 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1587 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1588#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
1589
1590#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1591 template <class ARGS_01,
1592 class ARGS_02,
1593 class ARGS_03,
1594 class ARGS_04,
1595 class ARGS_05,
1596 class ARGS_06>
1597 iterator try_emplace(const_iterator,
1598 BloombergLP::bslmf::MovableRef<KEY> key,
1599 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1600 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1601 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1602 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1603 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1604 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1605#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
1606
1607#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1608 template <class ARGS_01,
1609 class ARGS_02,
1610 class ARGS_03,
1611 class ARGS_04,
1612 class ARGS_05,
1613 class ARGS_06,
1614 class ARGS_07>
1615 iterator try_emplace(const_iterator,
1616 BloombergLP::bslmf::MovableRef<KEY> key,
1617 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1618 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1619 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1620 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1621 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1622 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1623 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1624#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
1625
1626#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1627 template <class ARGS_01,
1628 class ARGS_02,
1629 class ARGS_03,
1630 class ARGS_04,
1631 class ARGS_05,
1632 class ARGS_06,
1633 class ARGS_07,
1634 class ARGS_08>
1635 iterator try_emplace(const_iterator,
1636 BloombergLP::bslmf::MovableRef<KEY> key,
1637 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1638 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1639 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1640 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1641 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1642 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1643 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1644 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1645#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
1646
1647#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1648 template <class ARGS_01,
1649 class ARGS_02,
1650 class ARGS_03,
1651 class ARGS_04,
1652 class ARGS_05,
1653 class ARGS_06,
1654 class ARGS_07,
1655 class ARGS_08,
1656 class ARGS_09>
1657 iterator try_emplace(const_iterator,
1658 BloombergLP::bslmf::MovableRef<KEY> key,
1659 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1660 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1661 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1662 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1663 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1664 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1665 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1666 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1667 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1668#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
1669
1670#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1671 template <class ARGS_01,
1672 class ARGS_02,
1673 class ARGS_03,
1674 class ARGS_04,
1675 class ARGS_05,
1676 class ARGS_06,
1677 class ARGS_07,
1678 class ARGS_08,
1679 class ARGS_09,
1680 class ARGS_10>
1681 iterator try_emplace(const_iterator,
1682 BloombergLP::bslmf::MovableRef<KEY> key,
1683 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1684 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1686 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1687 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1688 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1689 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1690 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1691 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1692 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1693#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
1694
1695#endif
1696#else
1697// The generated code below is a workaround for the absence of perfect
1698// forwarding in some compilers.
1699#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1700 template< class... ARGS>
1701 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1702 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
1703
1704 template <class... ARGS>
1705 bsl::pair<iterator, bool> try_emplace(
1706 BloombergLP::bslmf::MovableRef<KEY> key,
1707 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
1708
1709 template<class... ARGS>
1710 iterator
1711 try_emplace(const_iterator, const KEY& key,
1712 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
1713
1714 template <class... ARGS>
1715 iterator try_emplace(const_iterator,
1716 BloombergLP::bslmf::MovableRef<KEY> key,
1717 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
1718#endif
1719// }}} END GENERATED CODE
1720#endif
1721
1722 // Iterators
1723
1724 /// Return an iterator to the first element in the sequence of
1725 /// modifiable elements maintained by this map, or the `end` iterator if
1726 /// this map is empty.
1727 iterator begin();
1728
1729 /// Return an iterator to the past-the-end element in the sequence of
1730 /// modifiable elements maintained by this map.
1731 iterator end();
1732
1733 // Aspects
1734
1735 /// Exchange the value of this object as well as its hasher and equality
1736 /// functors with those of the specified `other` object. The behavior
1737 /// is undefined unless this object was created with the same allocator
1738 /// as `other`.
1739 void swap(FlatHashMap& other);
1740
1741 // ACCESSORS
1742
1743 /// Return a reference providing non-modifiable access to the mapped
1744 /// value associated with the specified `key` in this map, if such an
1745 /// entry exists; otherwise throw a `std::out_of_range` exception. Note
1746 /// that this method is not exception-neutral.
1747 const VALUE& at(const KEY& key) const;
1748
1749 /// Return the number of elements this map could hold if the load factor
1750 /// were 1.
1751 bsl::size_t capacity() const;
1752
1753 /// Return `true` if this map contains an element having the specified
1754 /// `key`, and `false` otherwise.
1755 bool contains(const KEY& key) const;
1756
1757 /// Return the number of elements in this map having the specified
1758 /// `key`. Note that since a flat hash map maintains unique keys, the
1759 /// returned value will be either 0 or 1.
1760 bsl::size_t count(const KEY& key) const;
1761
1762 /// Return `true` if this map contains no elements, and `false`
1763 /// otherwise.
1764 bool empty() const;
1765
1766 /// Return a pair of `const_iterator`s defining the sequence of elements
1767 /// in this map having the specified `key`, where the first iterator is
1768 /// positioned at the start of the sequence and the second iterator is
1769 /// positioned one past the end of the sequence. If this map contains
1770 /// no elements having a key equivalent to `key`, then the two returned
1771 /// iterators will have the same value. Note that since a map maintains
1772 /// unique keys, the range will contain at most one element.
1774 const KEY& key) const;
1775
1776 /// Return a `const_iterator` referring to the element in this map
1777 /// having the specified `key`, or `end()` if no such entry exists in
1778 /// this map.
1779 const_iterator find(const KEY& key) const;
1780
1781 /// Return (a copy of) the unary hash functor used by this map to
1782 /// generate a hash value (of type `bsl::size_t`) for a `KEY` object.
1783 HASH hash_function() const;
1784
1785 /// Return (a copy of) the binary key-equality functor that returns
1786 /// `true` if the value of two `KEY` objects are equivalent, and `false`
1787 /// otherwise.
1788 EQUAL key_eq() const;
1789
1790 /// Return the current ratio between the number of elements in this
1791 /// container and its capacity.
1792 float load_factor() const;
1793
1794 /// Return the maximum load factor allowed for this map. Note that if
1795 /// an insert operation would cause the load factor to exceed
1796 /// `max_load_factor()`, that same insert operation will increase the
1797 /// capacity and rehash the entries of the container (see {Load Factor
1798 /// and Resizing}). Also note that the value returned by
1799 /// `max_load_factor` is implementation defined and cannot be changed by
1800 /// the user.
1801 float max_load_factor() const;
1802
1803 /// Return the number of elements in this map.
1804 bsl::size_t size() const;
1805
1806 // Iterators
1807
1808 /// Return a `const_iterator` to the first element in the sequence of
1809 /// elements maintained by this map, or the `end` iterator if this map
1810 /// is empty.
1811 const_iterator begin() const;
1812
1813 /// Return a `const_iterator` to the first element in the sequence of
1814 /// elements maintained by this map, or the `end` iterator if this map
1815 /// is empty.
1816 const_iterator cbegin() const;
1817
1818 /// Return a `const_iterator` to the past-the-end element in the
1819 /// sequence of elements maintained by this map.
1820 const_iterator cend() const;
1821
1822 /// Return a `const_iterator` to the past-the-end element in the
1823 /// sequence of elements maintained by this map.
1824 const_iterator end() const;
1825
1826 // Aspects
1827
1828 /// Return the allocator used by this flat hash map to supply memory.
1829 bslma::Allocator *allocator() const;
1830
1831 /// Format this object to the specified output `stream` at the (absolute
1832 /// value of) the optionally specified indentation `level`, and return a
1833 /// reference to the modifiable `stream`. If `level` is specified,
1834 /// optionally specify `spacesPerLevel`, the number of spaces per
1835 /// indentation level for this and all of its nested objects. If
1836 /// `level` is negative, suppress indentation of the first line. If
1837 /// `spacesPerLevel` is negative, format the entire output on one line,
1838 /// suppressing all but the initial indentation (as governed by
1839 /// `level`). If `stream` is not valid on entry, this operation has no
1840 /// effect.
1841 bsl::ostream& print(bsl::ostream& stream,
1842 int level = 0,
1843 int spacesPerLevel = 4) const;
1844};
1845
1846// FREE OPERATORS
1847
1848/// Return `true` if the specified `lhs` and `rhs` objects have the same
1849/// value, and `false` otherwise. Two `FlatHashMap` objects have the same
1850/// value if their sizes are the same and each element contained in one is
1851/// equal to an element of the other. The hash and equality functors are
1852/// not involved in the comparison.
1853template <class KEY, class VALUE, class HASH, class EQUAL>
1854bool operator==(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
1855 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
1856
1857/// Return `true` if the specified `lhs` and `rhs` objects do not have the
1858/// same value, and `false` otherwise. Two `FlatHashMap` objects do not
1859/// have the same value if their sizes are different or one contains an
1860/// element equal to no element of the other. The hash and equality
1861/// functors are not involved in the comparison.
1862template <class KEY, class VALUE, class HASH, class EQUAL>
1863bool operator!=(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
1864 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
1865
1866/// Write the value of the specified `map` to the specified output `stream`
1867/// in a single-line format, and return a reference providing modifiable
1868/// access to `stream`. If `stream` is not valid on entry, this operation
1869/// has no effect. Note that this human-readable format is not fully
1870/// specified and can change without notice.
1871template <class KEY, class VALUE, class HASH, class EQUAL>
1872bsl::ostream& operator<<(bsl::ostream& stream,
1873 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& map);
1874
1875// FREE FUNCTIONS
1876
1877/// Exchange the value, the hasher, and the key-equality functor of the
1878/// specified `a` and `b` objects. This function provides the no-throw
1879/// exception-safety guarantee if the two objects were created with the same
1880/// allocator and the basic guarantee otherwise.
1881template <class KEY, class VALUE, class HASH, class EQUAL>
1882void swap(FlatHashMap<KEY, VALUE, HASH, EQUAL>& a,
1883 FlatHashMap<KEY, VALUE, HASH, EQUAL>& b);
1884
1885// ============================================================================
1886// TEMPLATE AND INLINE FUNCTION DEFINITIONS
1887// ============================================================================
1888
1889 // ----------------------------
1890 // struct FlatHashMap_EntryUtil
1891 // ----------------------------
1892
1893// CLASS METHODS
1894#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1895// {{{ BEGIN GENERATED CODE
1896// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
1897#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
1898#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
1899#endif
1900#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_D
1901#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_D BDLC_FLATHASHMAP_VARIADIC_LIMIT
1902#endif
1903#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 0
1904template <class KEY, class VALUE, class ENTRY>
1905inline
1907 ENTRY *entry,
1908 bslma::Allocator *allocator)
1909{
1910 BSLS_ASSERT_SAFE(entry);
1912 entry,
1913 allocator);
1914}
1915#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 0
1916
1917#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 1
1918template <class KEY, class VALUE, class ENTRY>
1919template <class ARGS_01>
1920inline
1922 ENTRY *entry,
1923 bslma::Allocator *allocator,
1924 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
1925{
1926 BSLS_ASSERT_SAFE(entry);
1928 entry,
1929 allocator,
1930 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01));
1931}
1932#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 1
1933
1934#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 2
1935template <class KEY, class VALUE, class ENTRY>
1936template <class ARGS_01,
1937 class ARGS_02>
1938inline
1940 ENTRY *entry,
1941 bslma::Allocator *allocator,
1942 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1943 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
1944{
1945 BSLS_ASSERT_SAFE(entry);
1947 entry,
1948 allocator,
1949 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1950 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02));
1951}
1952#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 2
1953
1954#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 3
1955template <class KEY, class VALUE, class ENTRY>
1956template <class ARGS_01,
1957 class ARGS_02,
1958 class ARGS_03>
1959inline
1961 ENTRY *entry,
1962 bslma::Allocator *allocator,
1963 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1964 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1965 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
1966{
1967 BSLS_ASSERT_SAFE(entry);
1969 entry,
1970 allocator,
1971 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1972 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1973 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03));
1974}
1975#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 3
1976
1977#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 4
1978template <class KEY, class VALUE, class ENTRY>
1979template <class ARGS_01,
1980 class ARGS_02,
1981 class ARGS_03,
1982 class ARGS_04>
1983inline
1985 ENTRY *entry,
1986 bslma::Allocator *allocator,
1987 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1988 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1989 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1990 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
1991{
1992 BSLS_ASSERT_SAFE(entry);
1994 entry,
1995 allocator,
1996 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1997 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1998 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1999 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04));
2000}
2001#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 4
2002
2003#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 5
2004template <class KEY, class VALUE, class ENTRY>
2005template <class ARGS_01,
2006 class ARGS_02,
2007 class ARGS_03,
2008 class ARGS_04,
2009 class ARGS_05>
2010inline
2012 ENTRY *entry,
2013 bslma::Allocator *allocator,
2014 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2015 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2016 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2017 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2018 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
2019{
2020 BSLS_ASSERT_SAFE(entry);
2022 entry,
2023 allocator,
2024 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2025 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2026 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2027 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2028 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05));
2029}
2030#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 5
2031
2032#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 6
2033template <class KEY, class VALUE, class ENTRY>
2034template <class ARGS_01,
2035 class ARGS_02,
2036 class ARGS_03,
2037 class ARGS_04,
2038 class ARGS_05,
2039 class ARGS_06>
2040inline
2042 ENTRY *entry,
2043 bslma::Allocator *allocator,
2044 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2045 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2046 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2047 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2048 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2049 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
2050{
2051 BSLS_ASSERT_SAFE(entry);
2053 entry,
2054 allocator,
2055 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2056 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2057 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2058 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2059 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2060 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06));
2061}
2062#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 6
2063
2064#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 7
2065template <class KEY, class VALUE, class ENTRY>
2066template <class ARGS_01,
2067 class ARGS_02,
2068 class ARGS_03,
2069 class ARGS_04,
2070 class ARGS_05,
2071 class ARGS_06,
2072 class ARGS_07>
2073inline
2075 ENTRY *entry,
2076 bslma::Allocator *allocator,
2077 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2078 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2079 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2080 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2081 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2082 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2083 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
2084{
2085 BSLS_ASSERT_SAFE(entry);
2087 entry,
2088 allocator,
2089 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2090 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2091 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2092 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2093 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2094 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2095 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07));
2096}
2097#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 7
2098
2099#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 8
2100template <class KEY, class VALUE, class ENTRY>
2101template <class ARGS_01,
2102 class ARGS_02,
2103 class ARGS_03,
2104 class ARGS_04,
2105 class ARGS_05,
2106 class ARGS_06,
2107 class ARGS_07,
2108 class ARGS_08>
2109inline
2111 ENTRY *entry,
2112 bslma::Allocator *allocator,
2113 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2114 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2115 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2116 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2117 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2118 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2119 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2120 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
2121{
2122 BSLS_ASSERT_SAFE(entry);
2124 entry,
2125 allocator,
2126 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2127 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2128 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2129 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2130 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2131 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2132 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2133 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08));
2134}
2135#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 8
2136
2137#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 9
2138template <class KEY, class VALUE, class ENTRY>
2139template <class ARGS_01,
2140 class ARGS_02,
2141 class ARGS_03,
2142 class ARGS_04,
2143 class ARGS_05,
2144 class ARGS_06,
2145 class ARGS_07,
2146 class ARGS_08,
2147 class ARGS_09>
2148inline
2150 ENTRY *entry,
2151 bslma::Allocator *allocator,
2152 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2153 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2154 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2155 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2156 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2157 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2158 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2159 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2160 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
2161{
2162 BSLS_ASSERT_SAFE(entry);
2164 entry,
2165 allocator,
2166 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2167 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2168 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2169 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2170 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2171 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2172 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2173 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2174 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09));
2175}
2176#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 9
2177
2178#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 10
2179template <class KEY, class VALUE, class ENTRY>
2180template <class ARGS_01,
2181 class ARGS_02,
2182 class ARGS_03,
2183 class ARGS_04,
2184 class ARGS_05,
2185 class ARGS_06,
2186 class ARGS_07,
2187 class ARGS_08,
2188 class ARGS_09,
2189 class ARGS_10>
2190inline
2192 ENTRY *entry,
2193 bslma::Allocator *allocator,
2194 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2195 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2196 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2197 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2198 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2199 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2200 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2201 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2202 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
2203 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
2204{
2205 BSLS_ASSERT_SAFE(entry);
2207 entry,
2208 allocator,
2209 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2210 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2211 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2212 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2213 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2214 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2215 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2216 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2217 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
2218 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10));
2219}
2220#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_D >= 10
2221
2222#else
2223// The generated code below is a workaround for the absence of perfect
2224// forwarding in some compilers.
2225template <class KEY, class VALUE, class ENTRY>
2226template <class... ARGS>
2227inline
2229 ENTRY *entry,
2230 bslma::Allocator *allocator,
2232{
2233 BSLS_ASSERT_SAFE(entry);
2235 entry,
2236 allocator,
2237 BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...);
2238}
2239// }}} END GENERATED CODE
2240#endif
2241
2242template <class KEY, class VALUE, class ENTRY>
2243template <class KEY_TYPE>
2244inline
2246 ENTRY *entry,
2247 bslma::Allocator *allocator,
2249{
2250 BSLS_ASSERT_SAFE(entry);
2251
2253
2254 bslma::ConstructionUtil::construct(value.address(), allocator);
2256
2258 entry,
2259 allocator,
2260 BSLS_COMPILERFEATURES_FORWARD(KEY_TYPE, key),
2262}
2263
2264template <class KEY, class VALUE, class ENTRY>
2265inline
2266const KEY& FlatHashMap_EntryUtil<KEY, VALUE, ENTRY>::key(const ENTRY& entry)
2267{
2268 return entry.first;
2269}
2270
2271 // -----------------
2272 // class FlatHashMap
2273 // -----------------
2274
2275// CREATORS
2276template <class KEY, class VALUE, class HASH, class EQUAL>
2277inline
2279: d_impl(0, HASH(), EQUAL())
2280{
2281}
2282
2283template <class KEY, class VALUE, class HASH, class EQUAL>
2284inline
2285FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2286 bslma::Allocator *basicAllocator)
2287: d_impl(0, HASH(), EQUAL(), basicAllocator)
2288{
2289}
2290
2291template <class KEY, class VALUE, class HASH, class EQUAL>
2292inline
2293FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(bsl::size_t capacity)
2294: d_impl(capacity, HASH(), EQUAL())
2295{
2296}
2297
2298template <class KEY, class VALUE, class HASH, class EQUAL>
2299inline
2300FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2301 bsl::size_t capacity,
2302 bslma::Allocator *basicAllocator)
2303: d_impl(capacity, HASH(), EQUAL(), basicAllocator)
2304{
2305}
2306
2307template <class KEY, class VALUE, class HASH, class EQUAL>
2308inline
2309FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2310 bsl::size_t capacity,
2311 const HASH& hash,
2312 bslma::Allocator *basicAllocator)
2313: d_impl(capacity, hash, EQUAL(), basicAllocator)
2314{
2315}
2316
2317template <class KEY, class VALUE, class HASH, class EQUAL>
2318inline
2319FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2320 bsl::size_t capacity,
2321 const HASH& hash,
2322 const EQUAL& equal,
2323 bslma::Allocator *basicAllocator)
2324: d_impl(capacity, hash, equal, basicAllocator)
2325{
2326}
2327
2328template <class KEY, class VALUE, class HASH, class EQUAL>
2329template <class INPUT_ITERATOR>
2330inline
2331FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2332 INPUT_ITERATOR first,
2333 INPUT_ITERATOR last,
2334 bslma::Allocator *basicAllocator)
2335: d_impl(0, HASH(), EQUAL(), basicAllocator)
2336{
2337 insert(first, last);
2338}
2339
2340template <class KEY, class VALUE, class HASH, class EQUAL>
2341template <class INPUT_ITERATOR>
2342inline
2343FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2344 INPUT_ITERATOR first,
2345 INPUT_ITERATOR last,
2346 bsl::size_t capacity,
2347 bslma::Allocator *basicAllocator)
2348: d_impl(capacity, HASH(), EQUAL(), basicAllocator)
2349{
2350 insert(first, last);
2351}
2352
2353template <class KEY, class VALUE, class HASH, class EQUAL>
2354template <class INPUT_ITERATOR>
2355inline
2356FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2357 INPUT_ITERATOR first,
2358 INPUT_ITERATOR last,
2359 bsl::size_t capacity,
2360 const HASH& hash,
2361 bslma::Allocator *basicAllocator)
2362: d_impl(capacity, hash, EQUAL(), basicAllocator)
2363{
2364 insert(first, last);
2365}
2366
2367template <class KEY, class VALUE, class HASH, class EQUAL>
2368template <class INPUT_ITERATOR>
2369inline
2370FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2371 INPUT_ITERATOR first,
2372 INPUT_ITERATOR last,
2373 bsl::size_t capacity,
2374 const HASH& hash,
2375 const EQUAL& equal,
2376 bslma::Allocator *basicAllocator)
2377: d_impl(capacity, hash, equal, basicAllocator)
2378{
2379 insert(first, last);
2380}
2381
2382#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2383template <class KEY, class VALUE, class HASH, class EQUAL>
2384inline
2385FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2386 bsl::initializer_list<value_type> values,
2387 bslma::Allocator *basicAllocator)
2388: FlatHashMap(values.begin(),
2389 values.end(),
2390 0,
2391 HASH(),
2392 EQUAL(),
2393 basicAllocator)
2394{
2395}
2396
2397template <class KEY, class VALUE, class HASH, class EQUAL>
2398inline
2399FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2400 bsl::initializer_list<value_type> values,
2401 bsl::size_t capacity,
2402 bslma::Allocator *basicAllocator)
2403: FlatHashMap(values.begin(),
2404 values.end(),
2405 capacity,
2406 HASH(),
2407 EQUAL(),
2408 basicAllocator)
2409{
2410}
2411
2412template <class KEY, class VALUE, class HASH, class EQUAL>
2413inline
2414FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2415 bsl::initializer_list<value_type> values,
2416 bsl::size_t capacity,
2417 const HASH& hash,
2418 bslma::Allocator *basicAllocator)
2419: FlatHashMap(values.begin(),
2420 values.end(),
2421 capacity,
2422 hash,
2423 EQUAL(),
2424 basicAllocator)
2425{
2426}
2427
2428template <class KEY, class VALUE, class HASH, class EQUAL>
2429inline
2430FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2431 bsl::initializer_list<value_type> values,
2432 bsl::size_t capacity,
2433 const HASH& hash,
2434 const EQUAL& equal,
2435 bslma::Allocator *basicAllocator)
2436: FlatHashMap(values.begin(),
2437 values.end(),
2438 capacity,
2439 hash,
2440 equal,
2441 basicAllocator)
2442{
2443}
2444#endif
2445
2446template <class KEY, class VALUE, class HASH, class EQUAL>
2447inline
2448FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2449 const FlatHashMap& original,
2450 bslma::Allocator *basicAllocator)
2451: d_impl(original.d_impl, basicAllocator)
2452{
2453}
2454
2455template <class KEY, class VALUE, class HASH, class EQUAL>
2456inline
2457FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2459: d_impl(bslmf::MovableRefUtil::move(
2460 bslmf::MovableRefUtil::access(original).d_impl))
2461{
2462}
2463
2464template <class KEY, class VALUE, class HASH, class EQUAL>
2465inline
2466FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
2468 bslma::Allocator *basicAllocator)
2469: d_impl(bslmf::MovableRefUtil::move(
2470 bslmf::MovableRefUtil::access(original).d_impl),
2471 basicAllocator)
2472{
2473}
2474
2475template <class KEY, class VALUE, class HASH, class EQUAL>
2476inline
2477FlatHashMap<KEY, VALUE, HASH, EQUAL>::~FlatHashMap()
2478{
2479}
2480
2481// MANIPULATORS
2482template <class KEY, class VALUE, class HASH, class EQUAL>
2483inline
2484FlatHashMap<KEY, VALUE, HASH, EQUAL>&
2485FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(const FlatHashMap& rhs)
2486{
2487 d_impl = rhs.d_impl;
2488
2489 return *this;
2490}
2491
2492template <class KEY, class VALUE, class HASH, class EQUAL>
2493inline
2494FlatHashMap<KEY, VALUE, HASH, EQUAL>&
2495FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(
2497{
2498 FlatHashMap& lvalue = rhs;
2499
2500 d_impl = bslmf::MovableRefUtil::move(lvalue.d_impl);
2501
2502 return *this;
2503}
2504
2505#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2506template <class KEY, class VALUE, class HASH, class EQUAL>
2507inline
2508FlatHashMap<KEY, VALUE, HASH, EQUAL>&
2509FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(
2510 bsl::initializer_list<value_type> values)
2511{
2512 FlatHashMap tmp(values.begin(),
2513 values.end(),
2514 0,
2515 d_impl.hash_function(),
2516 d_impl.key_eq(),
2517 d_impl.allocator());
2518
2519 this->swap(tmp);
2520
2521 return *this;
2522}
2523#endif
2524
2525template <class KEY, class VALUE, class HASH, class EQUAL>
2526template <class KEY_TYPE>
2527inline
2528VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator[](
2530{
2531 return d_impl[BSLS_COMPILERFEATURES_FORWARD(KEY_TYPE, key)].second;
2532}
2533
2534template <class KEY, class VALUE, class HASH, class EQUAL>
2535inline
2536VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::at(const KEY& key)
2537{
2538 iterator node = d_impl.find(key);
2539
2540 if (node == d_impl.end()) {
2541 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
2542 "FlatHashMap<...>::at(key_type): invalid key value");
2543 }
2544
2545 return node->second;
2546}
2547
2548template <class KEY, class VALUE, class HASH, class EQUAL>
2549inline
2550void
2551FlatHashMap<KEY, VALUE, HASH, EQUAL>::clear()
2552{
2553 d_impl.clear();
2554}
2555
2556template <class KEY, class VALUE, class HASH, class EQUAL>
2558 typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator>
2559FlatHashMap<KEY, VALUE, HASH, EQUAL>::equal_range(const KEY& key)
2560{
2561 return d_impl.equal_range(key);
2562}
2563
2564#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2565// {{{ BEGIN GENERATED CODE
2566// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
2567#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
2568#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
2569#endif
2570#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_E
2571#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_E BDLC_FLATHASHMAP_VARIADIC_LIMIT
2572#endif
2573#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 0
2574template <class KEY, class VALUE, class HASH, class EQUAL>
2575inline
2577FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2578 )
2579{
2580 return d_impl.emplace();
2581}
2582#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 0
2583
2584#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 1
2585template <class KEY, class VALUE, class HASH, class EQUAL>
2586template <class ARGS_01>
2587inline
2589FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2590 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
2591{
2592 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01));
2593}
2594#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 1
2595
2596#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 2
2597template <class KEY, class VALUE, class HASH, class EQUAL>
2598template <class ARGS_01,
2599 class ARGS_02>
2600inline
2602FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2603 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2604 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
2605{
2606 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2607 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02));
2608}
2609#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 2
2610
2611#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 3
2612template <class KEY, class VALUE, class HASH, class EQUAL>
2613template <class ARGS_01,
2614 class ARGS_02,
2615 class ARGS_03>
2616inline
2618FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2619 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2620 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2621 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
2622{
2623 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2624 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2625 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03));
2626}
2627#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 3
2628
2629#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 4
2630template <class KEY, class VALUE, class HASH, class EQUAL>
2631template <class ARGS_01,
2632 class ARGS_02,
2633 class ARGS_03,
2634 class ARGS_04>
2635inline
2637FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2638 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2639 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2640 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2641 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
2642{
2643 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2644 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2645 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2646 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04));
2647}
2648#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 4
2649
2650#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 5
2651template <class KEY, class VALUE, class HASH, class EQUAL>
2652template <class ARGS_01,
2653 class ARGS_02,
2654 class ARGS_03,
2655 class ARGS_04,
2656 class ARGS_05>
2657inline
2659FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2660 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2661 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2662 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2663 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2664 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
2665{
2666 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2667 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2668 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2669 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2670 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05));
2671}
2672#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 5
2673
2674#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 6
2675template <class KEY, class VALUE, class HASH, class EQUAL>
2676template <class ARGS_01,
2677 class ARGS_02,
2678 class ARGS_03,
2679 class ARGS_04,
2680 class ARGS_05,
2681 class ARGS_06>
2682inline
2684FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2686 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2687 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2688 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2689 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2690 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
2691{
2692 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2693 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2694 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2695 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2696 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2697 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06));
2698}
2699#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 6
2700
2701#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 7
2702template <class KEY, class VALUE, class HASH, class EQUAL>
2703template <class ARGS_01,
2704 class ARGS_02,
2705 class ARGS_03,
2706 class ARGS_04,
2707 class ARGS_05,
2708 class ARGS_06,
2709 class ARGS_07>
2710inline
2712FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2713 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2714 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2715 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2716 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2717 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2718 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2719 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
2720{
2721 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2722 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2723 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2724 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2725 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2726 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2727 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07));
2728}
2729#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 7
2730
2731#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 8
2732template <class KEY, class VALUE, class HASH, class EQUAL>
2733template <class ARGS_01,
2734 class ARGS_02,
2735 class ARGS_03,
2736 class ARGS_04,
2737 class ARGS_05,
2738 class ARGS_06,
2739 class ARGS_07,
2740 class ARGS_08>
2741inline
2743FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2744 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2745 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2746 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2747 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2748 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2749 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2750 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2751 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
2752{
2753 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2754 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2755 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2756 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2757 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2758 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2759 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2760 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08));
2761}
2762#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 8
2763
2764#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 9
2765template <class KEY, class VALUE, class HASH, class EQUAL>
2766template <class ARGS_01,
2767 class ARGS_02,
2768 class ARGS_03,
2769 class ARGS_04,
2770 class ARGS_05,
2771 class ARGS_06,
2772 class ARGS_07,
2773 class ARGS_08,
2774 class ARGS_09>
2775inline
2777FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2778 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2779 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2780 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2781 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2782 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2783 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2784 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2785 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2786 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
2787{
2788 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2789 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2790 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2791 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2792 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2793 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2794 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2795 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2796 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09));
2797}
2798#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 9
2799
2800#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 10
2801template <class KEY, class VALUE, class HASH, class EQUAL>
2802template <class ARGS_01,
2803 class ARGS_02,
2804 class ARGS_03,
2805 class ARGS_04,
2806 class ARGS_05,
2807 class ARGS_06,
2808 class ARGS_07,
2809 class ARGS_08,
2810 class ARGS_09,
2811 class ARGS_10>
2812inline
2814FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
2815 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2816 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2817 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2818 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2819 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2820 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2821 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2822 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2823 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
2824 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
2825{
2826 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2827 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2828 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2829 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2830 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2831 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2832 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2833 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2834 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
2835 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10));
2836}
2837#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 10
2838
2839
2840#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 0
2841template <class KEY, class VALUE, class HASH, class EQUAL>
2842inline
2843typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2844FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator)
2845{
2846 return emplace().first;
2847}
2848#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 0
2849
2850#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 1
2851template <class KEY, class VALUE, class HASH, class EQUAL>
2852template <class ARGS_01>
2853inline
2854typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2855FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2856 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
2857{
2858 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)).first;
2859}
2860#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 1
2861
2862#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 2
2863template <class KEY, class VALUE, class HASH, class EQUAL>
2864template <class ARGS_01,
2865 class ARGS_02>
2866inline
2867typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2868FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2869 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2870 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
2871{
2872 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2873 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)).first;
2874}
2875#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 2
2876
2877#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 3
2878template <class KEY, class VALUE, class HASH, class EQUAL>
2879template <class ARGS_01,
2880 class ARGS_02,
2881 class ARGS_03>
2882inline
2883typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2884FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2885 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2886 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2887 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
2888{
2889 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2890 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2891 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)).first;
2892}
2893#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 3
2894
2895#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 4
2896template <class KEY, class VALUE, class HASH, class EQUAL>
2897template <class ARGS_01,
2898 class ARGS_02,
2899 class ARGS_03,
2900 class ARGS_04>
2901inline
2902typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2903FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2904 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2905 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2906 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2907 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
2908{
2909 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2910 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2911 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2912 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)).first;
2913}
2914#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 4
2915
2916#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 5
2917template <class KEY, class VALUE, class HASH, class EQUAL>
2918template <class ARGS_01,
2919 class ARGS_02,
2920 class ARGS_03,
2921 class ARGS_04,
2922 class ARGS_05>
2923inline
2924typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2925FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2926 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2927 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2928 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2929 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2930 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
2931{
2932 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2933 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2934 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2935 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2936 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)).first;
2937}
2938#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 5
2939
2940#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 6
2941template <class KEY, class VALUE, class HASH, class EQUAL>
2942template <class ARGS_01,
2943 class ARGS_02,
2944 class ARGS_03,
2945 class ARGS_04,
2946 class ARGS_05,
2947 class ARGS_06>
2948inline
2949typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2950FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2951 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2952 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2953 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2954 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2955 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2956 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
2957{
2958 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2959 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2960 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2961 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2962 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2963 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)).first;
2964}
2965#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 6
2966
2967#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 7
2968template <class KEY, class VALUE, class HASH, class EQUAL>
2969template <class ARGS_01,
2970 class ARGS_02,
2971 class ARGS_03,
2972 class ARGS_04,
2973 class ARGS_05,
2974 class ARGS_06,
2975 class ARGS_07>
2976inline
2977typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
2978FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
2979 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2980 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2981 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2982 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2983 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2984 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2985 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
2986{
2987 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2988 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2989 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2990 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2991 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2992 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2993 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)).first;
2994}
2995#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 7
2996
2997#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 8
2998template <class KEY, class VALUE, class HASH, class EQUAL>
2999template <class ARGS_01,
3000 class ARGS_02,
3001 class ARGS_03,
3002 class ARGS_04,
3003 class ARGS_05,
3004 class ARGS_06,
3005 class ARGS_07,
3006 class ARGS_08>
3007inline
3008typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3009FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3010 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3011 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3012 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3013 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3014 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3015 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3016 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3017 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
3018{
3019 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3020 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3021 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3022 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3023 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3024 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3025 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3026 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)).first;
3027}
3028#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 8
3029
3030#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 9
3031template <class KEY, class VALUE, class HASH, class EQUAL>
3032template <class ARGS_01,
3033 class ARGS_02,
3034 class ARGS_03,
3035 class ARGS_04,
3036 class ARGS_05,
3037 class ARGS_06,
3038 class ARGS_07,
3039 class ARGS_08,
3040 class ARGS_09>
3041inline
3042typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3043FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3044 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3045 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3046 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3047 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3048 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3049 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3050 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3051 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3052 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
3053{
3054 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3055 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3056 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3057 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3058 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3059 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3060 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3061 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3062 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)).first;
3063}
3064#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 9
3065
3066#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 10
3067template <class KEY, class VALUE, class HASH, class EQUAL>
3068template <class ARGS_01,
3069 class ARGS_02,
3070 class ARGS_03,
3071 class ARGS_04,
3072 class ARGS_05,
3073 class ARGS_06,
3074 class ARGS_07,
3075 class ARGS_08,
3076 class ARGS_09,
3077 class ARGS_10>
3078inline
3079typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3080FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3081 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3082 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3083 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3084 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3085 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3086 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3087 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3088 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3089 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
3090 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
3091{
3092 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3093 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3094 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3095 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3096 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3097 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3098 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3099 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3100 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
3101 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)).first;
3102}
3103#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_E >= 10
3104
3105#else
3106// The generated code below is a workaround for the absence of perfect
3107// forwarding in some compilers.
3108template <class KEY, class VALUE, class HASH, class EQUAL>
3109template <class... ARGS>
3110inline
3112FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3114{
3115 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...);
3116}
3117
3118template <class KEY, class VALUE, class HASH, class EQUAL>
3119template <class... ARGS>
3120inline
3121typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3122FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3124{
3125 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...).first;
3126}
3127// }}} END GENERATED CODE
3128#endif
3129
3130
3131template <class KEY, class VALUE, class HASH, class EQUAL>
3132bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const KEY& key)
3133{
3134 return d_impl.erase(key);
3135}
3136
3137template <class KEY, class VALUE, class HASH, class EQUAL>
3138inline
3139typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3140FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const_iterator position)
3141{
3142 BSLS_ASSERT_SAFE(position != end());
3143
3144 return d_impl.erase(position);
3145}
3146
3147template <class KEY, class VALUE, class HASH, class EQUAL>
3148inline
3149typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3150FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(iterator position)
3151{
3152 // Note that this overload is necessary to avoid ambiguity when the key is
3153 // an iterator.
3154
3155 BSLS_ASSERT_SAFE(position != end());
3156
3157 return d_impl.erase(position);
3158}
3159
3160template <class KEY, class VALUE, class HASH, class EQUAL>
3161typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3162FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const_iterator first,
3163 const_iterator last)
3164{
3165 return d_impl.erase(first, last);
3166}
3167
3168template <class KEY, class VALUE, class HASH, class EQUAL>
3169inline
3170typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3171FlatHashMap<KEY, VALUE, HASH, EQUAL>::find(const KEY& key)
3172{
3173 return d_impl.find(key);
3174}
3175
3176template <class KEY, class VALUE, class HASH, class EQUAL>
3177template <class INPUT_ITERATOR>
3178void FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert(INPUT_ITERATOR first,
3179 INPUT_ITERATOR last)
3180{
3181 d_impl.insert(first, last);
3182}
3183
3184#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3185template <class KEY, class VALUE, class HASH, class EQUAL>
3186void FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert(
3187 bsl::initializer_list<value_type> values)
3188{
3189 insert(values.begin(), values.end());
3190}
3191#endif
3192
3193template <class KEY, class VALUE, class HASH, class EQUAL>
3194inline
3195void FlatHashMap<KEY, VALUE, HASH, EQUAL>::rehash(bsl::size_t minimumCapacity)
3196{
3197 d_impl.rehash(minimumCapacity);
3198}
3199
3200template <class KEY, class VALUE, class HASH, class EQUAL>
3201inline
3202void FlatHashMap<KEY, VALUE, HASH, EQUAL>::reserve(bsl::size_t numEntries)
3203{
3204 d_impl.reserve(numEntries);
3205}
3206
3207template <class KEY, class VALUE, class HASH, class EQUAL>
3208inline
3209void FlatHashMap<KEY, VALUE, HASH, EQUAL>::reset()
3210{
3211 d_impl.reset();
3212}
3213
3214#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3215// {{{ BEGIN GENERATED CODE
3216// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
3217#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
3218#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
3219#endif
3220#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_F
3221#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_F BDLC_FLATHASHMAP_VARIADIC_LIMIT
3222#endif
3223#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
3224#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3225template <class KEY, class VALUE, class HASH, class EQUAL>
3226inline
3228FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key)
3229{
3230 return d_impl.try_emplace(
3231 key,
3232 std::piecewise_construct,
3233 std::forward_as_tuple(key),
3234 std::forward_as_tuple());
3235}
3236#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3237
3238#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3239template <class KEY, class VALUE, class HASH, class EQUAL>
3240template< class ARGS_01>
3241inline
3243FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3244 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
3245{
3246 return d_impl.try_emplace(
3247 key,
3248 std::piecewise_construct,
3249 std::forward_as_tuple(key),
3250 std::forward_as_tuple(
3251 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)));
3252}
3253#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3254
3255#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3256template <class KEY, class VALUE, class HASH, class EQUAL>
3257template< class ARGS_01,
3258 class ARGS_02>
3259inline
3261FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3262 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3263 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
3264{
3265 return d_impl.try_emplace(
3266 key,
3267 std::piecewise_construct,
3268 std::forward_as_tuple(key),
3269 std::forward_as_tuple(
3270 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3271 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)));
3272}
3273#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3274
3275#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3276template <class KEY, class VALUE, class HASH, class EQUAL>
3277template< class ARGS_01,
3278 class ARGS_02,
3279 class ARGS_03>
3280inline
3282FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3283 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3284 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
3286{
3287 return d_impl.try_emplace(
3288 key,
3289 std::piecewise_construct,
3290 std::forward_as_tuple(key),
3291 std::forward_as_tuple(
3292 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3293 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3294 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)));
3295}
3296#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3297
3298#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3299template <class KEY, class VALUE, class HASH, class EQUAL>
3300template< class ARGS_01,
3301 class ARGS_02,
3302 class ARGS_03,
3303 class ARGS_04>
3304inline
3306FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3307 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3308 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3309 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3310 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3311{
3312 return d_impl.try_emplace(
3313 key,
3314 std::piecewise_construct,
3315 std::forward_as_tuple(key),
3316 std::forward_as_tuple(
3317 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3318 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3319 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3320 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)));
3321}
3322#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3323
3324#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3325template <class KEY, class VALUE, class HASH, class EQUAL>
3326template< class ARGS_01,
3327 class ARGS_02,
3328 class ARGS_03,
3329 class ARGS_04,
3330 class ARGS_05>
3331inline
3333FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3334 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3335 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3336 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3337 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3338 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3339{
3340 return d_impl.try_emplace(
3341 key,
3342 std::piecewise_construct,
3343 std::forward_as_tuple(key),
3344 std::forward_as_tuple(
3345 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3346 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3347 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3348 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3349 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)));
3350}
3351#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3352
3353#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
3354template <class KEY, class VALUE, class HASH, class EQUAL>
3355template< class ARGS_01,
3356 class ARGS_02,
3357 class ARGS_03,
3358 class ARGS_04,
3359 class ARGS_05,
3360 class ARGS_06>
3361inline
3363FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3364 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3365 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3366 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3367 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3368 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3369 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
3370{
3371 return d_impl.try_emplace(
3372 key,
3373 std::piecewise_construct,
3374 std::forward_as_tuple(key),
3375 std::forward_as_tuple(
3376 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3377 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3378 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3379 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3380 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3381 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)));
3382}
3383#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
3384
3385#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
3386template <class KEY, class VALUE, class HASH, class EQUAL>
3387template< class ARGS_01,
3388 class ARGS_02,
3389 class ARGS_03,
3390 class ARGS_04,
3391 class ARGS_05,
3392 class ARGS_06,
3393 class ARGS_07>
3394inline
3396FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3397 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3398 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3399 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3400 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3401 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3402 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3403 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
3404{
3405 return d_impl.try_emplace(
3406 key,
3407 std::piecewise_construct,
3408 std::forward_as_tuple(key),
3409 std::forward_as_tuple(
3410 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3411 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3412 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3413 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3414 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3415 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3416 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)));
3417}
3418#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
3419
3420#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
3421template <class KEY, class VALUE, class HASH, class EQUAL>
3422template< class ARGS_01,
3423 class ARGS_02,
3424 class ARGS_03,
3425 class ARGS_04,
3426 class ARGS_05,
3427 class ARGS_06,
3428 class ARGS_07,
3429 class ARGS_08>
3430inline
3432FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3433 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3434 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3435 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3436 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3437 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3438 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3439 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3440 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
3441{
3442 return d_impl.try_emplace(
3443 key,
3444 std::piecewise_construct,
3445 std::forward_as_tuple(key),
3446 std::forward_as_tuple(
3447 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3448 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3449 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3450 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3451 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3452 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3453 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3454 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)));
3455}
3456#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
3457
3458#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
3459template <class KEY, class VALUE, class HASH, class EQUAL>
3460template< class ARGS_01,
3461 class ARGS_02,
3462 class ARGS_03,
3463 class ARGS_04,
3464 class ARGS_05,
3465 class ARGS_06,
3466 class ARGS_07,
3467 class ARGS_08,
3468 class ARGS_09>
3469inline
3471FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3472 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3473 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3474 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3475 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3476 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3477 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3478 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3479 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3480 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
3481{
3482 return d_impl.try_emplace(
3483 key,
3484 std::piecewise_construct,
3485 std::forward_as_tuple(key),
3486 std::forward_as_tuple(
3487 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3488 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3489 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3490 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3491 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3492 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3493 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3494 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3495 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)));
3496}
3497#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
3498
3499#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
3500template <class KEY, class VALUE, class HASH, class EQUAL>
3501template< class ARGS_01,
3502 class ARGS_02,
3503 class ARGS_03,
3504 class ARGS_04,
3505 class ARGS_05,
3506 class ARGS_06,
3507 class ARGS_07,
3508 class ARGS_08,
3509 class ARGS_09,
3510 class ARGS_10>
3511inline
3513FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
3514 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3515 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3516 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3517 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3518 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3519 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3520 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3521 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3522 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
3523 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
3524{
3525 return d_impl.try_emplace(
3526 key,
3527 std::piecewise_construct,
3528 std::forward_as_tuple(key),
3529 std::forward_as_tuple(
3530 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3531 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3532 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3533 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3534 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3535 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3536 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3537 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3538 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
3539 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)));
3540}
3541#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
3542
3543
3544#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3545template <class KEY, class VALUE, class HASH, class EQUAL>
3547FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3548 BloombergLP::bslmf::MovableRef<KEY> key)
3549{
3550 return d_impl.try_emplace(
3552 std::piecewise_construct,
3553 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3554 std::forward_as_tuple());
3555}
3556#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3557
3558#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3559template <class KEY, class VALUE, class HASH, class EQUAL>
3560template <class ARGS_01>
3562FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3563 BloombergLP::bslmf::MovableRef<KEY> key,
3564 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
3565{
3566 return d_impl.try_emplace(
3568 std::piecewise_construct,
3569 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3570 std::forward_as_tuple(
3571 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)));
3572}
3573#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3574
3575#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3576template <class KEY, class VALUE, class HASH, class EQUAL>
3577template <class ARGS_01,
3578 class ARGS_02>
3580FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3581 BloombergLP::bslmf::MovableRef<KEY> key,
3582 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3583 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
3584{
3585 return d_impl.try_emplace(
3587 std::piecewise_construct,
3588 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3589 std::forward_as_tuple(
3590 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3591 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)));
3592}
3593#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3594
3595#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3596template <class KEY, class VALUE, class HASH, class EQUAL>
3597template <class ARGS_01,
3598 class ARGS_02,
3599 class ARGS_03>
3601FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3602 BloombergLP::bslmf::MovableRef<KEY> key,
3603 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3604 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3605 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
3606{
3607 return d_impl.try_emplace(
3609 std::piecewise_construct,
3610 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3611 std::forward_as_tuple(
3612 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3613 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3614 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)));
3615}
3616#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3617
3618#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3619template <class KEY, class VALUE, class HASH, class EQUAL>
3620template <class ARGS_01,
3621 class ARGS_02,
3622 class ARGS_03,
3623 class ARGS_04>
3625FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3626 BloombergLP::bslmf::MovableRef<KEY> key,
3627 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3628 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3629 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3630 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3631{
3632 return d_impl.try_emplace(
3634 std::piecewise_construct,
3635 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3636 std::forward_as_tuple(
3637 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3638 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3639 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3640 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)));
3641}
3642#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3643
3644#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3645template <class KEY, class VALUE, class HASH, class EQUAL>
3646template <class ARGS_01,
3647 class ARGS_02,
3648 class ARGS_03,
3649 class ARGS_04,
3650 class ARGS_05>
3652FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3653 BloombergLP::bslmf::MovableRef<KEY> key,
3654 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3655 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3656 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3657 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3658 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3659{
3660 return d_impl.try_emplace(
3662 std::piecewise_construct,
3663 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3664 std::forward_as_tuple(
3665 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3666 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3667 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3668 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3669 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)));
3670}
3671#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3672
3673#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
3674template <class KEY, class VALUE, class HASH, class EQUAL>
3675template <class ARGS_01,
3676 class ARGS_02,
3677 class ARGS_03,
3678 class ARGS_04,
3679 class ARGS_05,
3680 class ARGS_06>
3682FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3683 BloombergLP::bslmf::MovableRef<KEY> key,
3684 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3686 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3687 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3688 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3689 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
3690{
3691 return d_impl.try_emplace(
3693 std::piecewise_construct,
3694 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3695 std::forward_as_tuple(
3696 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3697 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3698 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3699 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3700 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3701 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)));
3702}
3703#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
3704
3705#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
3706template <class KEY, class VALUE, class HASH, class EQUAL>
3707template <class ARGS_01,
3708 class ARGS_02,
3709 class ARGS_03,
3710 class ARGS_04,
3711 class ARGS_05,
3712 class ARGS_06,
3713 class ARGS_07>
3715FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3716 BloombergLP::bslmf::MovableRef<KEY> key,
3717 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3718 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3719 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3720 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3721 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3722 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3723 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
3724{
3725 return d_impl.try_emplace(
3727 std::piecewise_construct,
3728 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3729 std::forward_as_tuple(
3730 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3731 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3732 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3733 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3734 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3735 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3736 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)));
3737}
3738#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
3739
3740#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
3741template <class KEY, class VALUE, class HASH, class EQUAL>
3742template <class ARGS_01,
3743 class ARGS_02,
3744 class ARGS_03,
3745 class ARGS_04,
3746 class ARGS_05,
3747 class ARGS_06,
3748 class ARGS_07,
3749 class ARGS_08>
3751FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3752 BloombergLP::bslmf::MovableRef<KEY> key,
3753 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3754 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3755 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3756 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3757 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3758 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3759 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3760 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
3761{
3762 return d_impl.try_emplace(
3764 std::piecewise_construct,
3765 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3766 std::forward_as_tuple(
3767 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3768 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3769 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3770 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3771 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3772 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3773 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3774 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)));
3775}
3776#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
3777
3778#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
3779template <class KEY, class VALUE, class HASH, class EQUAL>
3780template <class ARGS_01,
3781 class ARGS_02,
3782 class ARGS_03,
3783 class ARGS_04,
3784 class ARGS_05,
3785 class ARGS_06,
3786 class ARGS_07,
3787 class ARGS_08,
3788 class ARGS_09>
3790FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3791 BloombergLP::bslmf::MovableRef<KEY> key,
3792 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3793 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3794 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3795 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3796 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3797 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3798 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3799 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3800 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
3801{
3802 return d_impl.try_emplace(
3804 std::piecewise_construct,
3805 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3806 std::forward_as_tuple(
3807 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3808 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3809 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3810 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3811 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3812 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3813 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3814 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3815 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)));
3816}
3817#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
3818
3819#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
3820template <class KEY, class VALUE, class HASH, class EQUAL>
3821template <class ARGS_01,
3822 class ARGS_02,
3823 class ARGS_03,
3824 class ARGS_04,
3825 class ARGS_05,
3826 class ARGS_06,
3827 class ARGS_07,
3828 class ARGS_08,
3829 class ARGS_09,
3830 class ARGS_10>
3832FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
3833 BloombergLP::bslmf::MovableRef<KEY> key,
3834 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3835 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3836 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3837 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3838 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3839 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3841 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3842 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
3843 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
3844{
3845 return d_impl.try_emplace(
3847 std::piecewise_construct,
3848 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
3849 std::forward_as_tuple(
3850 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3851 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3852 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3853 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3854 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3855 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3856 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3857 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3858 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
3859 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)));
3860}
3861#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
3862
3863
3864#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3865template <class KEY, class VALUE, class HASH, class EQUAL>
3866typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3867FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3868 const KEY& key)
3869{
3870 return d_impl.try_emplace(
3871 key,
3872 std::piecewise_construct,
3873 std::forward_as_tuple(key),
3874 std::forward_as_tuple())
3875 .first;
3876}
3877#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
3878
3879#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3880template <class KEY, class VALUE, class HASH, class EQUAL>
3881template<class ARGS_01>
3882typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3883FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3884 const KEY& key,
3885 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
3886{
3887 return d_impl.try_emplace(
3888 key,
3889 std::piecewise_construct,
3890 std::forward_as_tuple(key),
3891 std::forward_as_tuple(
3892 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)))
3893 .first;
3894}
3895#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
3896
3897#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3898template <class KEY, class VALUE, class HASH, class EQUAL>
3899template<class ARGS_01,
3900 class ARGS_02>
3901typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3902FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3903 const KEY& key,
3904 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3905 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
3906{
3907 return d_impl.try_emplace(
3908 key,
3909 std::piecewise_construct,
3910 std::forward_as_tuple(key),
3911 std::forward_as_tuple(
3912 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3913 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)))
3914 .first;
3915}
3916#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
3917
3918#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3919template <class KEY, class VALUE, class HASH, class EQUAL>
3920template<class ARGS_01,
3921 class ARGS_02,
3922 class ARGS_03>
3923typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3924FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3925 const KEY& key,
3926 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3927 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3928 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
3929{
3930 return d_impl.try_emplace(
3931 key,
3932 std::piecewise_construct,
3933 std::forward_as_tuple(key),
3934 std::forward_as_tuple(
3935 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3936 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3937 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)))
3938 .first;
3939}
3940#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
3941
3942#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3943template <class KEY, class VALUE, class HASH, class EQUAL>
3944template<class ARGS_01,
3945 class ARGS_02,
3946 class ARGS_03,
3947 class ARGS_04>
3948typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3949FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3950 const KEY& key,
3951 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3952 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3953 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3954 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3955{
3956 return d_impl.try_emplace(
3957 key,
3958 std::piecewise_construct,
3959 std::forward_as_tuple(key),
3960 std::forward_as_tuple(
3961 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3962 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3963 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3964 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)))
3965 .first;
3966}
3967#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
3968
3969#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3970template <class KEY, class VALUE, class HASH, class EQUAL>
3971template<class ARGS_01,
3972 class ARGS_02,
3973 class ARGS_03,
3974 class ARGS_04,
3975 class ARGS_05>
3976typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3977FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
3978 const KEY& key,
3979 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3980 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3981 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3982 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3983 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3984{
3985 return d_impl.try_emplace(
3986 key,
3987 std::piecewise_construct,
3988 std::forward_as_tuple(key),
3989 std::forward_as_tuple(
3990 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3991 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3992 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3993 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3994 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)))
3995 .first;
3996}
3997#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
3998
3999#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
4000template <class KEY, class VALUE, class HASH, class EQUAL>
4001template<class ARGS_01,
4002 class ARGS_02,
4003 class ARGS_03,
4004 class ARGS_04,
4005 class ARGS_05,
4006 class ARGS_06>
4007typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4008FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4009 const KEY& key,
4010 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4011 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4012 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4013 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4014 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4015 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
4016{
4017 return d_impl.try_emplace(
4018 key,
4019 std::piecewise_construct,
4020 std::forward_as_tuple(key),
4021 std::forward_as_tuple(
4022 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4023 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4024 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4025 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4026 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4027 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)))
4028 .first;
4029}
4030#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
4031
4032#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
4033template <class KEY, class VALUE, class HASH, class EQUAL>
4034template<class ARGS_01,
4035 class ARGS_02,
4036 class ARGS_03,
4037 class ARGS_04,
4038 class ARGS_05,
4039 class ARGS_06,
4040 class ARGS_07>
4041typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4042FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4043 const KEY& key,
4044 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4045 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4046 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4047 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4048 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4049 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4050 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
4051{
4052 return d_impl.try_emplace(
4053 key,
4054 std::piecewise_construct,
4055 std::forward_as_tuple(key),
4056 std::forward_as_tuple(
4057 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4058 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4059 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4060 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4061 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4062 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4063 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)))
4064 .first;
4065}
4066#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
4067
4068#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
4069template <class KEY, class VALUE, class HASH, class EQUAL>
4070template<class ARGS_01,
4071 class ARGS_02,
4072 class ARGS_03,
4073 class ARGS_04,
4074 class ARGS_05,
4075 class ARGS_06,
4076 class ARGS_07,
4077 class ARGS_08>
4078typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4079FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4080 const KEY& key,
4081 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4082 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4083 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4084 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4085 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4086 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4087 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4088 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
4089{
4090 return d_impl.try_emplace(
4091 key,
4092 std::piecewise_construct,
4093 std::forward_as_tuple(key),
4094 std::forward_as_tuple(
4095 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4096 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4097 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4098 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4099 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4100 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4101 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4102 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)))
4103 .first;
4104}
4105#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
4106
4107#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
4108template <class KEY, class VALUE, class HASH, class EQUAL>
4109template<class ARGS_01,
4110 class ARGS_02,
4111 class ARGS_03,
4112 class ARGS_04,
4113 class ARGS_05,
4114 class ARGS_06,
4115 class ARGS_07,
4116 class ARGS_08,
4117 class ARGS_09>
4118typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4119FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4120 const KEY& key,
4121 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4122 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4123 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4124 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4125 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4126 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4127 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4128 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4129 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
4130{
4131 return d_impl.try_emplace(
4132 key,
4133 std::piecewise_construct,
4134 std::forward_as_tuple(key),
4135 std::forward_as_tuple(
4136 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4137 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4138 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4139 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4140 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4141 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4142 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4143 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4144 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)))
4145 .first;
4146}
4147#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
4148
4149#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
4150template <class KEY, class VALUE, class HASH, class EQUAL>
4151template<class ARGS_01,
4152 class ARGS_02,
4153 class ARGS_03,
4154 class ARGS_04,
4155 class ARGS_05,
4156 class ARGS_06,
4157 class ARGS_07,
4158 class ARGS_08,
4159 class ARGS_09,
4160 class ARGS_10>
4161typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4162FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4163 const KEY& key,
4164 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4165 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4166 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4167 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4168 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4170 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4171 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4172 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
4173 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
4174{
4175 return d_impl.try_emplace(
4176 key,
4177 std::piecewise_construct,
4178 std::forward_as_tuple(key),
4179 std::forward_as_tuple(
4180 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4181 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4182 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4183 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4184 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4185 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4186 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4187 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4188 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
4189 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)))
4190 .first;
4191}
4192#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
4193
4194
4195#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
4196template <class KEY, class VALUE, class HASH, class EQUAL>
4197typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4198FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4199 BloombergLP::bslmf::MovableRef<KEY> key)
4200{
4201 return d_impl.try_emplace(
4203 std::piecewise_construct,
4204 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4205 std::forward_as_tuple())
4206 .first;
4207}
4208#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
4209
4210#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
4211template <class KEY, class VALUE, class HASH, class EQUAL>
4212template <class ARGS_01>
4213typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4214FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4215 BloombergLP::bslmf::MovableRef<KEY> key,
4216 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
4217{
4218 return d_impl.try_emplace(
4220 std::piecewise_construct,
4221 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4222 std::forward_as_tuple(
4223 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)))
4224 .first;
4225}
4226#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
4227
4228#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
4229template <class KEY, class VALUE, class HASH, class EQUAL>
4230template <class ARGS_01,
4231 class ARGS_02>
4232typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4233FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4234 BloombergLP::bslmf::MovableRef<KEY> key,
4235 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4236 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
4237{
4238 return d_impl.try_emplace(
4240 std::piecewise_construct,
4241 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4242 std::forward_as_tuple(
4243 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4244 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)))
4245 .first;
4246}
4247#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
4248
4249#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
4250template <class KEY, class VALUE, class HASH, class EQUAL>
4251template <class ARGS_01,
4252 class ARGS_02,
4253 class ARGS_03>
4254typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4255FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4256 BloombergLP::bslmf::MovableRef<KEY> key,
4257 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4258 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4259 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
4260{
4261 return d_impl.try_emplace(
4263 std::piecewise_construct,
4264 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4265 std::forward_as_tuple(
4266 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4267 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4268 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)))
4269 .first;
4270}
4271#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
4272
4273#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
4274template <class KEY, class VALUE, class HASH, class EQUAL>
4275template <class ARGS_01,
4276 class ARGS_02,
4277 class ARGS_03,
4278 class ARGS_04>
4279typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4280FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4281 BloombergLP::bslmf::MovableRef<KEY> key,
4282 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4283 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4284 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
4286{
4287 return d_impl.try_emplace(
4289 std::piecewise_construct,
4290 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4291 std::forward_as_tuple(
4292 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4293 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4294 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4295 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)))
4296 .first;
4297}
4298#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
4299
4300#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
4301template <class KEY, class VALUE, class HASH, class EQUAL>
4302template <class ARGS_01,
4303 class ARGS_02,
4304 class ARGS_03,
4305 class ARGS_04,
4306 class ARGS_05>
4307typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4308FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4309 BloombergLP::bslmf::MovableRef<KEY> key,
4310 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4311 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4312 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4313 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4314 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
4315{
4316 return d_impl.try_emplace(
4318 std::piecewise_construct,
4319 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4320 std::forward_as_tuple(
4321 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4322 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4323 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4324 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4325 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)))
4326 .first;
4327}
4328#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
4329
4330#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
4331template <class KEY, class VALUE, class HASH, class EQUAL>
4332template <class ARGS_01,
4333 class ARGS_02,
4334 class ARGS_03,
4335 class ARGS_04,
4336 class ARGS_05,
4337 class ARGS_06>
4338typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4339FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4340 BloombergLP::bslmf::MovableRef<KEY> key,
4341 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4342 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4343 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4344 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4345 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4346 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
4347{
4348 return d_impl.try_emplace(
4350 std::piecewise_construct,
4351 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4352 std::forward_as_tuple(
4353 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4354 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4355 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4356 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4357 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4358 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)))
4359 .first;
4360}
4361#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
4362
4363#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
4364template <class KEY, class VALUE, class HASH, class EQUAL>
4365template <class ARGS_01,
4366 class ARGS_02,
4367 class ARGS_03,
4368 class ARGS_04,
4369 class ARGS_05,
4370 class ARGS_06,
4371 class ARGS_07>
4372typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4373FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4374 BloombergLP::bslmf::MovableRef<KEY> key,
4375 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4376 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4377 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4378 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4379 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4380 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4381 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
4382{
4383 return d_impl.try_emplace(
4385 std::piecewise_construct,
4386 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4387 std::forward_as_tuple(
4388 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4389 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4390 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4391 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4392 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4393 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4394 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)))
4395 .first;
4396}
4397#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
4398
4399#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
4400template <class KEY, class VALUE, class HASH, class EQUAL>
4401template <class ARGS_01,
4402 class ARGS_02,
4403 class ARGS_03,
4404 class ARGS_04,
4405 class ARGS_05,
4406 class ARGS_06,
4407 class ARGS_07,
4408 class ARGS_08>
4409typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4410FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4411 BloombergLP::bslmf::MovableRef<KEY> key,
4412 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4413 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4414 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4415 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4416 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4417 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4418 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4419 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
4420{
4421 return d_impl.try_emplace(
4423 std::piecewise_construct,
4424 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4425 std::forward_as_tuple(
4426 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4427 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4428 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4429 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4430 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4431 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4432 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4433 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)))
4434 .first;
4435}
4436#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
4437
4438#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
4439template <class KEY, class VALUE, class HASH, class EQUAL>
4440template <class ARGS_01,
4441 class ARGS_02,
4442 class ARGS_03,
4443 class ARGS_04,
4444 class ARGS_05,
4445 class ARGS_06,
4446 class ARGS_07,
4447 class ARGS_08,
4448 class ARGS_09>
4449typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4450FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4451 BloombergLP::bslmf::MovableRef<KEY> key,
4452 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4453 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4454 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4455 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4456 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4457 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4458 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4459 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4460 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
4461{
4462 return d_impl.try_emplace(
4464 std::piecewise_construct,
4465 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4466 std::forward_as_tuple(
4467 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4468 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4469 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4470 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4471 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4472 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4473 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4474 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4475 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)))
4476 .first;
4477}
4478#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
4479
4480#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
4481template <class KEY, class VALUE, class HASH, class EQUAL>
4482template <class ARGS_01,
4483 class ARGS_02,
4484 class ARGS_03,
4485 class ARGS_04,
4486 class ARGS_05,
4487 class ARGS_06,
4488 class ARGS_07,
4489 class ARGS_08,
4490 class ARGS_09,
4491 class ARGS_10>
4492typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4493FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4494 BloombergLP::bslmf::MovableRef<KEY> key,
4495 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4496 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4497 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4498 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4499 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4500 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4501 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4502 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4503 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
4504 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
4505{
4506 return d_impl.try_emplace(
4508 std::piecewise_construct,
4509 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4510 std::forward_as_tuple(
4511 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4512 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4513 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4514 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4515 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4516 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4517 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4518 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4519 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
4520 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)))
4521 .first;
4522}
4523#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
4524
4525#endif
4526#else
4527// The generated code below is a workaround for the absence of perfect
4528// forwarding in some compilers.
4529#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
4530template <class KEY, class VALUE, class HASH, class EQUAL>
4531template< class... ARGS>
4532inline
4534FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4536{
4537 return d_impl.try_emplace(
4538 key,
4539 std::piecewise_construct,
4540 std::forward_as_tuple(key),
4541 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...));
4542}
4543
4544template <class KEY, class VALUE, class HASH, class EQUAL>
4545template <class... ARGS>
4547FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4548 BloombergLP::bslmf::MovableRef<KEY> key,
4550{
4551 return d_impl.try_emplace(
4553 std::piecewise_construct,
4554 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4555 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...));
4556}
4557
4558template <class KEY, class VALUE, class HASH, class EQUAL>
4559template<class... ARGS>
4560typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4561FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4562 const KEY& key,
4564{
4565 return d_impl.try_emplace(
4566 key,
4567 std::piecewise_construct,
4568 std::forward_as_tuple(key),
4569 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...))
4570 .first;
4571}
4572
4573template <class KEY, class VALUE, class HASH, class EQUAL>
4574template <class... ARGS>
4575typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4576FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4577 BloombergLP::bslmf::MovableRef<KEY> key,
4579{
4580 return d_impl.try_emplace(
4582 std::piecewise_construct,
4583 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4584 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...))
4585 .first;
4586}
4587#endif
4588// }}} END GENERATED CODE
4589#endif
4590
4591 // Iterators
4592
4593template <class KEY, class VALUE, class HASH, class EQUAL>
4594inline
4595typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4596 FlatHashMap<KEY, VALUE, HASH, EQUAL>::begin()
4597{
4598 return d_impl.begin();
4599}
4600
4601template <class KEY, class VALUE, class HASH, class EQUAL>
4602inline
4603typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4604 FlatHashMap<KEY, VALUE, HASH, EQUAL>::end()
4605{
4606 return d_impl.end();
4607}
4608
4609 // Aspects
4610
4611template <class KEY, class VALUE, class HASH, class EQUAL>
4612inline
4613void FlatHashMap<KEY, VALUE, HASH, EQUAL>::swap(FlatHashMap& other)
4614{
4615 BSLS_ASSERT_SAFE(allocator() == other.allocator());
4616
4617 d_impl.swap(other.d_impl);
4618}
4619
4620// ACCESSORS
4621template <class KEY, class VALUE, class HASH, class EQUAL>
4622inline
4623const VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::at(const KEY& key) const
4624{
4625 const_iterator node = d_impl.find(key);
4626
4627 if (node == d_impl.end()) {
4628 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
4629 "FlatHashMap<...>::at(key_type) const: invalid key value");
4630 }
4631
4632 return node->second;
4633}
4634
4635template <class KEY, class VALUE, class HASH, class EQUAL>
4636inline
4637bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::capacity() const
4638{
4639 return d_impl.capacity();
4640}
4641
4642template <class KEY, class VALUE, class HASH, class EQUAL>
4643inline
4644bool FlatHashMap<KEY, VALUE, HASH, EQUAL>::contains(const KEY& key) const
4645{
4646 return d_impl.contains(key);
4647}
4648
4649template <class KEY, class VALUE, class HASH, class EQUAL>
4650inline
4651bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::count(const KEY& key) const
4652{
4653 return d_impl.count(key);
4654}
4655
4656template <class KEY, class VALUE, class HASH, class EQUAL>
4657inline
4658bool FlatHashMap<KEY, VALUE, HASH, EQUAL>::empty() const
4659{
4660 return d_impl.empty();
4661}
4662
4663template <class KEY, class VALUE, class HASH, class EQUAL>
4665 typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator>
4666FlatHashMap<KEY, VALUE, HASH, EQUAL>::equal_range(const KEY& key) const
4667{
4668 return d_impl.equal_range(key);
4669}
4670
4671template <class KEY, class VALUE, class HASH, class EQUAL>
4672inline
4673typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
4674FlatHashMap<KEY, VALUE, HASH, EQUAL>::find(const KEY& key) const
4675{
4676 return d_impl.find(key);
4677}
4678
4679template <class KEY, class VALUE, class HASH, class EQUAL>
4680inline
4681HASH FlatHashMap<KEY, VALUE, HASH, EQUAL>::hash_function() const
4682{
4683 return d_impl.hash_function();
4684}
4685
4686template <class KEY, class VALUE, class HASH, class EQUAL>
4687inline
4688EQUAL FlatHashMap<KEY, VALUE, HASH, EQUAL>::key_eq() const
4689{
4690 return d_impl.key_eq();
4691}
4692
4693template <class KEY, class VALUE, class HASH, class EQUAL>
4694inline
4695float FlatHashMap<KEY, VALUE, HASH, EQUAL>::load_factor() const
4696{
4697 return d_impl.load_factor();
4698}
4699
4700template <class KEY, class VALUE, class HASH, class EQUAL>
4701inline
4702float FlatHashMap<KEY, VALUE, HASH, EQUAL>::max_load_factor() const
4703{
4704 return d_impl.max_load_factor();
4705}
4706
4707template <class KEY, class VALUE, class HASH, class EQUAL>
4708inline
4709bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::size() const
4710{
4711 return d_impl.size();
4712}
4713
4714 // Iterators
4715
4716template <class KEY, class VALUE, class HASH, class EQUAL>
4717inline
4718typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
4719 FlatHashMap<KEY, VALUE, HASH, EQUAL>::begin() const
4720{
4721 return d_impl.begin();
4722}
4723template <class KEY, class VALUE, class HASH, class EQUAL>
4724inline
4725typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
4726 FlatHashMap<KEY, VALUE, HASH, EQUAL>::cbegin() const
4727{
4728 return d_impl.cbegin();
4729}
4730
4731template <class KEY, class VALUE, class HASH, class EQUAL>
4732inline
4733typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
4734 FlatHashMap<KEY, VALUE, HASH, EQUAL>::cend() const
4735{
4736 return d_impl.cend();
4737}
4738
4739template <class KEY, class VALUE, class HASH, class EQUAL>
4740inline
4741typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
4742 FlatHashMap<KEY, VALUE, HASH, EQUAL>::end() const
4743{
4744 return d_impl.end();
4745}
4746
4747 // Aspects
4748
4749template <class KEY, class VALUE, class HASH, class EQUAL>
4750inline
4751bslma::Allocator *FlatHashMap<KEY, VALUE, HASH, EQUAL>::allocator() const
4752{
4753 return d_impl.allocator();
4754}
4755
4756template <class KEY, class VALUE, class HASH, class EQUAL>
4757bsl::ostream& FlatHashMap<KEY, VALUE, HASH, EQUAL>::print(
4758 bsl::ostream& stream,
4759 int level,
4760 int spacesPerLevel) const
4761{
4762 if (stream.bad()) {
4763 return stream; // RETURN
4764 }
4765
4766 bslim::Printer printer(&stream, level, spacesPerLevel);
4767
4768 printer.start();
4769
4770 const_iterator iter = begin();
4771 while (iter != end()) {
4772 printer.printValue(*iter);
4773 ++iter;
4774 }
4775
4776 printer.end();
4777
4778 return stream;
4779}
4780
4781} // close package namespace
4782
4783// FREE OPERATORS
4784template <class KEY, class VALUE, class HASH, class EQUAL>
4785inline
4786bool bdlc::operator==(const FlatHashMap<KEY, VALUE, HASH, EQUAL>& lhs,
4787 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& rhs)
4788{
4789 return lhs.d_impl == rhs.d_impl;
4790}
4791
4792template <class KEY, class VALUE, class HASH, class EQUAL>
4793inline
4794bool bdlc::operator!=(const FlatHashMap<KEY, VALUE, HASH, EQUAL>& lhs,
4795 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& rhs)
4796{
4797 return lhs.d_impl != rhs.d_impl;
4798}
4799
4800template <class KEY, class VALUE, class HASH, class EQUAL>
4801inline
4802bsl::ostream& bdlc::operator<<(
4803 bsl::ostream& stream,
4804 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& map)
4805{
4806 return map.print(stream, 0, -1);
4807}
4808
4809// FREE FUNCTIONS
4810template <class KEY, class VALUE, class HASH, class EQUAL>
4811inline
4812void bdlc::swap(FlatHashMap<KEY, VALUE, HASH, EQUAL>& a,
4813 FlatHashMap<KEY, VALUE, HASH, EQUAL>& b)
4814{
4815 bslalg::SwapUtil::swap(&a.d_impl, &b.d_impl);
4816}
4817
4818// ============================================================================
4819// TYPE TRAITS
4820// ============================================================================
4821
4822namespace bslalg {
4823
4824template <class KEY, class VALUE, class HASH, class EQUAL>
4825struct HasStlIterators<bdlc::FlatHashMap<KEY, VALUE, HASH, EQUAL> >
4827};
4828
4829} // close namespace bslalg
4830
4831namespace bslma {
4832
4833template <class KEY, class VALUE, class HASH, class EQUAL>
4834struct UsesBslmaAllocator<bdlc::FlatHashMap<KEY, VALUE, HASH, EQUAL> >
4836};
4837
4838} // close namespace bslma
4839
4840
4841#else // if ! defined(DEFINED_BDLC_FLATHASHMAP_H)
4842# error Not valid except when included from bdlc_flathashmap.h
4843#endif // ! defined(COMPILING_BDLC_FLATHASHMAP_H)
4844
4845#endif // ! defined(INCLUDED_BDLC_FLATHASHMAP_CPP03)
4846
4847// ----------------------------------------------------------------------------
4848// Copyright 2020 Bloomberg Finance L.P.
4849//
4850// Licensed under the Apache License, Version 2.0 (the "License");
4851// you may not use this file except in compliance with the License.
4852// You may obtain a copy of the License at
4853//
4854// http://www.apache.org/licenses/LICENSE-2.0
4855//
4856// Unless required by applicable law or agreed to in writing, software
4857// distributed under the License is distributed on an "AS IS" BASIS,
4858// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4859// See the License for the specific language governing permissions and
4860// limitations under the License.
4861// ----------------------------- END-OF-FILE ----------------------------------
4862
4863/** @} */
4864/** @} */
4865/** @} */
HASH hasher
Definition bdlc_flathashmap.h:464
const value_type * const_pointer
Definition bdlc_flathashmap.h:468
value_type * pointer
Definition bdlc_flathashmap.h:467
bsl::ptrdiff_t difference_type
Definition bdlc_flathashmap.h:462
friend void swap(FlatHashMap< K, V, H, E > &, FlatHashMap< K, V, H, E > &)
const value_type & const_reference
Definition bdlc_flathashmap.h:466
void clear()
Definition bdlc_flathashmap.h:1394
VALUE & at(const KEY &key)
Definition bdlc_flathashmap.h:1379
EQUAL key_eq() const
Definition bdlc_flathashmap.h:1671
iterator find(const KEY &key)
Definition bdlc_flathashmap.h:1469
bool contains(const KEY &key) const
Definition bdlc_flathashmap.h:1627
ImplType::const_iterator const_iterator
Definition bdlc_flathashmap.h:470
bool empty() const
Definition bdlc_flathashmap.h:1641
const_iterator cbegin() const
Definition bdlc_flathashmap.h:1709
bsl::size_t size() const
Return the number of elements in this map.
Definition bdlc_flathashmap.h:1692
bsl::enable_if< bsl::is_convertible< VALUE_TYPE, value_type >::value, bsl::pair< iterator, bool > >::type insert(BSLS_COMPILERFEATURES_FORWARD_REF(VALUE_TYPE) value)
Definition bdlc_flathashmap.h:758
void rehash(bsl::size_t minimumCapacity)
Definition bdlc_flathashmap.h:1493
bslma::Allocator * allocator() const
Return the allocator used by this flat hash map to supply memory.
Definition bdlc_flathashmap.h:1734
bsl::pair< iterator, bool > emplace(ARGS &&... args)
bsl::pair< iterator, iterator > equal_range(const KEY &key)
Definition bdlc_flathashmap.h:1402
VALUE & operator[](BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) key)
Definition bdlc_flathashmap.h:1371
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition bdlc_flathashmap.h:1740
const_iterator cend() const
Definition bdlc_flathashmap.h:1717
void reserve(bsl::size_t numEntries)
Definition bdlc_flathashmap.h:1500
float load_factor() const
Definition bdlc_flathashmap.h:1678
HASH hash_function() const
Definition bdlc_flathashmap.h:1664
~FlatHashMap()
Destroy this object and each of its elements.
Definition bdlc_flathashmap.h:1320
bsl::size_t erase(const KEY &key)
Definition bdlc_flathashmap.h:1430
iterator begin()
Definition bdlc_flathashmap.h:1579
FlatHashMap & operator=(const FlatHashMap &rhs)
Definition bdlc_flathashmap.h:1328
EQUAL key_compare
Definition bdlc_flathashmap.h:463
KEY key_type
Definition bdlc_flathashmap.h:459
FlatHashMap()
Definition bdlc_flathashmap.h:1121
ImplType::iterator iterator
Definition bdlc_flathashmap.h:469
float max_load_factor() const
Definition bdlc_flathashmap.h:1685
value_type & reference
Definition bdlc_flathashmap.h:465
void reset()
Definition bdlc_flathashmap.h:1507
bsl::size_t capacity() const
Definition bdlc_flathashmap.h:1620
iterator emplace_hint(const_iterator hint, ARGS &&... args)
Definition bdlc_flathashmap.h:1421
bsl::size_t count(const KEY &key) const
Definition bdlc_flathashmap.h:1634
VALUE mapped_type
Definition bdlc_flathashmap.h:460
bsl::pair< typename bsl::add_const< KEY >::type, VALUE > value_type
Definition bdlc_flathashmap.h:457
iterator end()
Definition bdlc_flathashmap.h:1587
bsl::size_t size_type
Definition bdlc_flathashmap.h:461
bslstl::ForwardIterator< const bsl::pair< KEY, VALUE >, IteratorImp > const_iterator
Definition bdlc_flathashtable.h:334
bslstl::ForwardIterator< bsl::pair< KEY, VALUE >, IteratorImp > iterator
Definition bdlc_flathashtable.h:332
Definition bslstl_pair.h:1210
static void swap(T *a, T *b)
Definition bslalg_swaputil.h:194
Definition bslh_fibonaccibadhashwrapper.h:165
Definition bslim_printer.h:601
Definition bslma_allocator.h:457
Definition bslma_destructorguard.h:132
Definition bslmf_movableref.h:751
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
Definition bdlc_bitarray.h:503
void swap(BitArray &a, BitArray &b)
bool operator==(const BitArray &lhs, const BitArray &rhs)
bool operator!=(const BitArray &lhs, const BitArray &rhs)
BitArray operator<<(const BitArray &array, bsl::size_t numBits)
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
static void constructFromKey(ENTRY *entry, bslma::Allocator *allocator, BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) key)
Definition bdlc_flathashmap.h:1088
static const KEY & key(const ENTRY &entry)
Return the key of the specified entry.
Definition bdlc_flathashmap.h:1109
static void construct(ENTRY *entry, bslma::Allocator *allocator, ARGS &&... args)
Definition bdlc_flathashmap.h:1072
TYPE first
Definition bslstl_pair.h:605
Definition bslmf_enableif.h:525
Definition bslstl_equalto.h:311
static void construct(TARGET_TYPE *address, const ALLOCATOR &allocator)
Definition bslma_constructionutil.h:1243
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1060
Definition bsls_objectbuffer.h:276
TYPE * address()
Definition bsls_objectbuffer.h:334
TYPE & object()
Definition bsls_objectbuffer.h:351