BDE 4.39.x 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 Thu Mar 5 22:51:43 2026
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 /// Create an empty `FlatHashMap` object. Optionally specify a
378 /// `capacity` indicating the minimum initial size of the underlying
379 /// array of entries of this container. If `capacity` is not supplied
380 /// or is 0, no memory is allocated. Optionally specify a `hash`
381 /// functor used to generate the hash values associated with the keys of
382 /// elements in this container. If `hash` is not supplied, a
383 /// default-constructed object of the (template parameter) type `HASH`
384 /// is used. Optionally specify an equality functor `equal` used to
385 /// determine whether the keys of two elements are equivalent. If
386 /// `equal` is not supplied, a default-constructed object of the
387 /// (template parameter) type `EQUAL` is used. Optionally specify a
388 /// `basicAllocator` used to supply memory. If `basicAllocator` is not
389 /// supplied or is 0, the currently installed default allocator is used.
390 FlatHashMap();
391 explicit FlatHashMap(bslma::Allocator *basicAllocator);
392 explicit FlatHashMap(bsl::size_t capacity);
393 FlatHashMap(bsl::size_t capacity, bslma::Allocator *basicAllocator);
394 FlatHashMap(bsl::size_t capacity,
395 const HASH& hash,
396 bslma::Allocator *basicAllocator = 0);
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 ///
418 /// \pre The behavior is undefined unless `first` and `last` refer to a
419 /// sequence of valid values where `first` is at a position at or before `last`.
420 ///
421 /// \note Note that if a member of the input sequence has an
422 /// equivalent key to an earlier member, the later member will not be
423 /// inserted.
424 template <class INPUT_ITERATOR>
425 FlatHashMap(INPUT_ITERATOR first,
426 INPUT_ITERATOR last,
427 bslma::Allocator *basicAllocator = 0);
428 template <class INPUT_ITERATOR>
429 FlatHashMap(INPUT_ITERATOR first,
430 INPUT_ITERATOR last,
431 bsl::size_t capacity,
432 bslma::Allocator *basicAllocator = 0);
433 template <class INPUT_ITERATOR>
434 FlatHashMap(INPUT_ITERATOR first,
435 INPUT_ITERATOR last,
436 bsl::size_t capacity,
437 const HASH& hash,
438 bslma::Allocator *basicAllocator = 0);
439 template <class INPUT_ITERATOR>
440 FlatHashMap(INPUT_ITERATOR first,
441 INPUT_ITERATOR last,
442 bsl::size_t capacity,
443 const HASH& hash,
444 const EQUAL& equal,
445 bslma::Allocator *basicAllocator = 0);
446
447#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
448 /// Create a `FlatHashMap` object initialized by insertion of the
449 /// specified `values`. Optionally specify a `capacity` indicating the
450 /// minimum initial size of the underlying array of entries of this
451 /// container. If `capacity` is not supplied or is 0, no memory is
452 /// allocated. Optionally specify a `hash` functor used to generate
453 /// hash values associated with the keys of elements in this container.
454 /// If `hash` is not supplied, a default-constructed object of the
455 /// (template parameter) type `HASH` is used. Optionally specify an
456 /// equality functor `equal` used to determine whether the keys of two
457 /// elements are equivalent. If `equal` is not supplied, a
458 /// default-constructed object of the (template parameter) type `EQUAL`
459 /// is used. Optionally specify a `basicAllocator` used to supply
460 /// memory. If `basicAllocator` is not supplied or is 0, the currently installed default allocator is used.
461 ///
462 /// \note Note that if a member of
463 /// `values` has an equivalent key to an earlier member, the later
464 /// member will not be inserted.
465 FlatHashMap(bsl::initializer_list<value_type> values,
466 bslma::Allocator *basicAllocator = 0);
467 FlatHashMap(bsl::initializer_list<value_type> values,
468 bsl::size_t capacity,
469 bslma::Allocator *basicAllocator = 0);
470 FlatHashMap(bsl::initializer_list<value_type> values,
471 bsl::size_t capacity,
472 const HASH& hash,
473 bslma::Allocator *basicAllocator = 0);
474 FlatHashMap(bsl::initializer_list<value_type> values,
475 bsl::size_t capacity,
476 const HASH& hash,
477 const EQUAL& equal,
478 bslma::Allocator *basicAllocator = 0);
479#endif
480
481 /// Create a `FlatHashMap` object having the same value, hasher, and
482 /// equality comparator as the specified `original` object. Optionally
483 /// specify a `basicAllocator` used to supply memory. If
484 /// `basicAllocator` is not specified or is 0, the currently installed
485 /// default allocator is used.
486 FlatHashMap(const FlatHashMap& original,
487 bslma::Allocator *basicAllocator = 0);
488
489 /// Create a `FlatHashMap` object having the same value, hasher,
490 /// equality comparator, and allocator as the specified `original`
491 /// object. The contents of `original` are moved (in constant time) to
492 /// this object, `original` is left in a (valid) unspecified state, and
493 /// no exceptions will be thrown.
495
496 /// Create a `FlatHashMap` object having the same value, hasher, and
497 /// equality comparator as the specified `original` object, using the
498 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
499 /// 0, the currently installed default allocator is used. The allocator
500 /// of `original` remains unchanged. If `original` and the newly
501 /// created object have the same allocator then the contents of
502 /// `original` are moved (in constant time) to this object, `original`
503 /// is left in a (valid) unspecified state, and no exceptions will be
504 /// thrown; otherwise, `original` is unchanged (and an exception may be
505 /// thrown).
507 bslma::Allocator *basicAllocator);
508
509 /// Destroy this object and each of its elements.
510 ~FlatHashMap();
511
512 // MANIPULATORS
513
514 /// Assign to this object the value, hasher, and equality functor of the
515 /// specified `rhs` object, and return a reference providing modifiable
516 /// access to this object.
517 FlatHashMap& operator=(const FlatHashMap& rhs);
518
519 /// Assign to this object the value, hasher, and equality comparator of
520 /// the specified `rhs` object, and return a reference providing
521 /// modifiable access to this object. If this object and `rhs` use the
522 /// same allocator the contents of `rhs` are moved (in constant time) to
523 /// this object. `rhs` is left in a (valid) unspecified state.
525
526#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
527 /// Assign to this object the value resulting from first clearing this
528 /// map and then inserting each object in the specified `values`
529 /// initializer list, ignoring those objects having a value whose key is
530 /// equivalent to that which appears earlier in the list; return a
531 /// reference providing modifiable access to this object. This method
532 /// requires that the (template parameter) type `KEY` be
533 /// `copy-insertable` into this map (see {Requirements on `KEY`, `HASH`,
534 /// and `EQUAL`}).
535 FlatHashMap& operator=(bsl::initializer_list<value_type> values);
536#endif
537
538 /// Return a reference providing modifiable access to the mapped value
539 /// associated with the specified `key` in this map. If this map does
540 /// not already contain an element having `key`, insert an element with
541 /// the `key` and a default-constructed `VALUE`, and return a reference
542 /// to the newly mapped value. If `key` is movable, `key` is left in a
543 /// (valid) unspecified state.
544 VALUE& operator[](const KEY& key);
545
546 /// Return a reference providing modifiable access to the mapped value
547 /// associated with the specified `key` in this map. If this map does
548 /// not already contain an element having `key`, insert an element with
549 /// the `key` and a default-constructed `VALUE`, and return a reference
550 /// to the newly mapped value. If `key` is movable, `key` is left in a
551 /// (valid) unspecified state.
553
554// {{{ BEGIN GENERATED CODE
555// The generated code below is a workaround for the absence of perfect
556// forwarding in some compilers.
557#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
558 template <class LOOKUP_KEY>
559 typename bsl::enable_if<
560 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
561 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
562 , VALUE&>::type
564 {
565 return try_emplace(
566 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)).first->second;
567 }
568#endif
569// }}} END GENERATED CODE
570
571 /// Return a reference providing modifiable access to the mapped value
572 /// associated with the specified `key` in this map, if such an entry
573 /// exists; otherwise throw a `std::out_of_range` exception.
574 ///
575 /// \note Note that this method is not exception-neutral.
576 VALUE& at(const KEY& key);
577
578 /// Return a reference providing modifiable access to the mapped value
579 /// associated with a key that is equivalent to the specified `key` in this
580 /// map, if such an entry exists; otherwise throw a `std::out_of_range` exception.
581 ///
582 /// \note Note that this method is not exception-neutral.
583 template <class LOOKUP_KEY>
584 typename bsl::enable_if<
585 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
586 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
587 , VALUE&>::type
588 at(const LOOKUP_KEY& key)
589 {
590 // Note: implemented inline due to Sun CC compilation error.
591
592 iterator iter = find(key);
593 if (iter == end()) {
594 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
595 "FlatHashMap::at(LOOKUP_KEY): invalid key_value");
596 }
597 return iter->second;
598 }
599
600 /// Remove all elements from this map.
601 /// \note Note that this map will be empty
602 /// after calling this method, but allocated memory may be retained for
603 /// future use. See the `capacity` method.
604 void clear();
605
606 /// Return a pair of iterators defining the sequence of modifiable
607 /// elements in this map having the specified `key`, where the first
608 /// iterator is positioned at the start of the sequence and the second
609 /// iterator is positioned one past the end of the sequence. If this
610 /// map contains no elements having a key equivalent to `key`, then the two returned iterators will have the same value.
611 ///
612 /// \note Note that since a
613 /// map maintains unique keys, the range will contain at most one
614 /// element.
616
617 /// Return a pair of iterators defining the sequence of modifiable
618 /// elements in this map having a key equivalent to the specified `key`,
619 /// where the first iterator is positioned at the start of the sequence and
620 /// the second iterator is positioned one past the end of the sequence. If
621 /// this map contains no elements having a key equivalent to `key`, then the two returned iterators will have the same value.
622 ///
623 /// \note Note that since a
624 /// map maintains unique keys, the range will contain at most one
625 /// element.
626 template <class LOOKUP_KEY>
627 typename bsl::enable_if<
628 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
629 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
631 equal_range(const LOOKUP_KEY& key)
632 {
633 // Note: implemented inline due to Sun CC compilation error.
634
635 return d_impl.equal_range(key);
636 }
637
638#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
639// {{{ BEGIN GENERATED CODE
640// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
641#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
642#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
643#endif
644#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_C
645#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_C BDLC_FLATHASHMAP_VARIADIC_LIMIT
646#endif
647#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
649 );
650#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
651
652#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
653 template <class ARGS_01>
655 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
656#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
657
658#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
659 template <class ARGS_01,
660 class ARGS_02>
662 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
663 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
664#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
665
666#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
667 template <class ARGS_01,
668 class ARGS_02,
669 class ARGS_03>
671 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
672 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
673 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
674#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
675
676#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
677 template <class ARGS_01,
678 class ARGS_02,
679 class ARGS_03,
680 class ARGS_04>
682 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
683 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
684 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
686#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
687
688#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
689 template <class ARGS_01,
690 class ARGS_02,
691 class ARGS_03,
692 class ARGS_04,
693 class ARGS_05>
695 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
696 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
697 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
698 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
699 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
700#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
701
702#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
703 template <class ARGS_01,
704 class ARGS_02,
705 class ARGS_03,
706 class ARGS_04,
707 class ARGS_05,
708 class ARGS_06>
710 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
711 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
712 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
713 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
714 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
715 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
716#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
717
718#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
719 template <class ARGS_01,
720 class ARGS_02,
721 class ARGS_03,
722 class ARGS_04,
723 class ARGS_05,
724 class ARGS_06,
725 class ARGS_07>
727 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
728 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
729 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
730 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
731 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
732 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
733 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
734#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
735
736#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
737 template <class ARGS_01,
738 class ARGS_02,
739 class ARGS_03,
740 class ARGS_04,
741 class ARGS_05,
742 class ARGS_06,
743 class ARGS_07,
744 class ARGS_08>
746 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
747 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
748 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
749 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
750 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
751 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
752 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
753 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
754#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
755
756#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
757 template <class ARGS_01,
758 class ARGS_02,
759 class ARGS_03,
760 class ARGS_04,
761 class ARGS_05,
762 class ARGS_06,
763 class ARGS_07,
764 class ARGS_08,
765 class ARGS_09>
767 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
768 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
769 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
770 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
771 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
772 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
773 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
774 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
775 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
776#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
777
778#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
779 template <class ARGS_01,
780 class ARGS_02,
781 class ARGS_03,
782 class ARGS_04,
783 class ARGS_05,
784 class ARGS_06,
785 class ARGS_07,
786 class ARGS_08,
787 class ARGS_09,
788 class ARGS_10>
790 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
791 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
792 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
793 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
794 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
795 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
796 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
797 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
798 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
799 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
800#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
801
802
803#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
805#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 0
806
807#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
808 template <class ARGS_01>
810 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
811#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 1
812
813#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
814 template <class ARGS_01,
815 class ARGS_02>
817 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
818 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
819#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 2
820
821#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
822 template <class ARGS_01,
823 class ARGS_02,
824 class ARGS_03>
826 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
827 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
828 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
829#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 3
830
831#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
832 template <class ARGS_01,
833 class ARGS_02,
834 class ARGS_03,
835 class ARGS_04>
837 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
838 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
839 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
841#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 4
842
843#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
844 template <class ARGS_01,
845 class ARGS_02,
846 class ARGS_03,
847 class ARGS_04,
848 class ARGS_05>
850 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
851 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
852 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
853 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
854 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
855#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 5
856
857#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
858 template <class ARGS_01,
859 class ARGS_02,
860 class ARGS_03,
861 class ARGS_04,
862 class ARGS_05,
863 class ARGS_06>
865 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
866 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
867 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
868 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
869 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
870 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
871#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 6
872
873#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
874 template <class ARGS_01,
875 class ARGS_02,
876 class ARGS_03,
877 class ARGS_04,
878 class ARGS_05,
879 class ARGS_06,
880 class ARGS_07>
882 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
883 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
884 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
885 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
886 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
887 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
888 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
889#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 7
890
891#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
892 template <class ARGS_01,
893 class ARGS_02,
894 class ARGS_03,
895 class ARGS_04,
896 class ARGS_05,
897 class ARGS_06,
898 class ARGS_07,
899 class ARGS_08>
901 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
902 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
903 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
904 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
905 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
906 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
907 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
908 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
909#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 8
910
911#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
912 template <class ARGS_01,
913 class ARGS_02,
914 class ARGS_03,
915 class ARGS_04,
916 class ARGS_05,
917 class ARGS_06,
918 class ARGS_07,
919 class ARGS_08,
920 class ARGS_09>
922 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
923 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
924 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
925 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
926 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
927 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
928 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
929 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
930 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
931#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 9
932
933#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
934 template <class ARGS_01,
935 class ARGS_02,
936 class ARGS_03,
937 class ARGS_04,
938 class ARGS_05,
939 class ARGS_06,
940 class ARGS_07,
941 class ARGS_08,
942 class ARGS_09,
943 class ARGS_10>
945 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
946 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
947 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
948 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
949 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
950 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
951 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
952 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
953 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
954 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
955#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_C >= 10
956
957#else
958// The generated code below is a workaround for the absence of perfect
959// forwarding in some compilers.
960 template <class... ARGS>
963
964 template <class... ARGS>
967// }}} END GENERATED CODE
968#endif
969
970 /// Remove from this map the element whose key is equal to the specified
971 /// `key`, if it exists, and return 1; otherwise (there is no element
972 /// having `key` in this map), return 0 with no other effect. This
973 /// method invalidates all iterators and references to the removed
974 /// element.
975 bsl::size_t erase(const KEY& key);
976
977// {{{ BEGIN GENERATED CODE
978// The generated code below is a workaround for the absence of perfect
979// forwarding in some compilers.
980 template <class LOOKUP_KEY>
981 typename bsl::enable_if<
982 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
983 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
984 , bsl::size_t>::type
986 {
987 return d_impl.erase(key);
988 }
989// }}} END GENERATED CODE
990
991 /// Remove from this map the element at the specified `position`, and
992 /// return an iterator referring to the modifiable element immediately
993 /// following the removed element, or to the past-the-end position if
994 /// the removed element was the last element in the sequence of elements
995 /// maintained by this map. This method invalidates all iterators and references to the removed element.
996 ///
997 /// \pre The behavior is undefined unless
998 /// `position` refers to an element in this map.
999 iterator erase(const_iterator position);
1000 iterator erase(iterator position);
1001
1002 /// Remove from this map the elements starting at the specified `first`
1003 /// position up to, but not including, the specified `last` position,
1004 /// and return an iterator referencing the same element as `last`. This
1005 /// method invalidates all iterators and references to the removed elements.
1006 ///
1007 /// \pre The behavior is undefined unless `first` and `last` are
1008 /// valid iterators on this map, and the `first` position is at or
1009 /// before the `last` position in the iteration sequence provided by
1010 /// this container.
1012
1013 /// Return an iterator referring to the modifiable element in this map
1014 /// having the specified `key`, or `end()` if no such entry exists in
1015 /// this map.
1016 iterator find(const KEY& key);
1017
1018 /// Return an `iterator` referring to the modifiable element in this map
1019 /// having the key equivalent to the specified `key`, or `end()` if no such
1020 /// entry exists in this map.
1021 template <class LOOKUP_KEY>
1022 typename bsl::enable_if<
1023 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1024 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1025 , iterator>::type
1026 find(const LOOKUP_KEY& key)
1027 {
1028 // Note: implemented inline due to Sun CC compilation error.
1029
1030 return iterator(d_impl.find(key));
1031 }
1032
1033#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1034 template <class VALUE_TYPE>
1036#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1037 template <class VALUE_TYPE>
1040#else
1041 /// Insert the specified `value` into this map if the key of `value`
1042 /// does not already exist in this map; otherwise, this method has no
1043 /// effect. Return a `pair` whose `first` member is an iterator
1044 /// referring to the (possibly newly inserted) modifiable element in
1045 /// this map whose key is equivalent to that of the element to be
1046 /// inserted, and whose `second` member is `true` if a new element was
1047 /// inserted, and `false` if an element with an equivalent key was
1048 /// already present.
1049 template <class VALUE_TYPE>
1050 typename bsl::enable_if<bsl::is_constructible<value_type,
1051 VALUE_TYPE&&>::value,
1053#endif
1054 insert(BSLS_COMPILERFEATURES_FORWARD_REF(VALUE_TYPE) value)
1055 {
1056 // Note that some compilers require functions declared with 'enable_if'
1057 // to be defined inline.
1058
1059 return d_impl.insert(BSLS_COMPILERFEATURES_FORWARD(VALUE_TYPE, value));
1060 }
1061
1062#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1063 template <class VALUE_TYPE>
1064 iterator
1065#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1066 template <class VALUE_TYPE>
1068 iterator>::type
1069#else
1070 /// Insert the specified `value` into this map if the key of `value`
1071 /// does not already exist in this map; otherwise, this method has no
1072 /// effect. Return an iterator referring to the (possibly newly
1073 /// inserted) modifiable element in this map whose key is equivalent to
1074 /// that of the element to be inserted. The supplied `const_iterator`
1075 /// is ignored.
1076 template <class VALUE_TYPE>
1077 typename bsl::enable_if<bsl::is_constructible<value_type,
1078 VALUE_TYPE&&>::value,
1079 iterator>::type
1080#endif
1082 BSLS_COMPILERFEATURES_FORWARD_REF(VALUE_TYPE) value)
1083 {
1084 // Note that some compilers require functions declared with 'enable_if'
1085 // to be defined inline.
1086
1087 return d_impl.insert(BSLS_COMPILERFEATURES_FORWARD(VALUE_TYPE,
1088 value)).first;
1089 }
1090
1091 /// Insert into this map the value of each element in the input iterator
1092 /// range specified by `first` through `last` (including `first`, excluding `last`).
1093 ///
1094 /// \pre The behavior is undefined unless `first` and
1095 /// `last` refer to a sequence of valid values where `first` is at a position at or before `last`.
1096 ///
1097 /// \note Note that if the key of a member of
1098 /// the input sequence is equivalent to the key of an earlier member,
1099 /// the later member will not be inserted.
1100 template <class INPUT_ITERATOR>
1101 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
1102
1103#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1104 /// Insert into this map an element having the value of each object in
1105 /// the specified `values` initializer list if a value with an
1106 /// equivalent key is not already contained in this map. This method
1107 /// requires that the (template parameter) type `KEY` be copy-insertable
1108 /// (see {Requirements on `KEY`, `HASH`, and `EQUAL`}).
1109 void insert(bsl::initializer_list<value_type> values);
1110#endif
1111
1112// {{{ BEGIN GENERATED CODE
1113// The generated code below is a workaround for the absence of perfect
1114// forwarding in some compilers.
1115
1116 template<class M>
1119
1120 template<class M>
1122 BloombergLP::bslmf::MovableRef<KEY> key,
1124
1125 template <class LOOKUP_KEY, class M>
1126 typename bsl::enable_if<
1127 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1128 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1132 {
1133 iterator iter = find(key);
1134 if (iter != end()) {
1135 iter->second = BSLS_COMPILERFEATURES_FORWARD(M, obj);
1136 return make_pair(iter, false);
1137 }
1138 return emplace(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1140 }
1141
1142 template <class MAPPED>
1145
1146 template <class MAPPED>
1148 BloombergLP::bslmf::MovableRef<KEY> key,
1150
1151 template <class LOOKUP_KEY, class MAPPED>
1152 typename bsl::enable_if<
1153 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1154 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1155 , iterator>::type
1157 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1159 {
1160 return insert_or_assign(
1161 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1162 BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj)).first;
1163 }
1164// }}} END GENERATED CODE
1165
1166
1167 /// Change the capacity of this map to at least the specified
1168 /// `minimumCapacity`, and redistribute all the contained elements into
1169 /// a new sequence of entries according to their hash values. If
1170 /// `0 == minimumCapacity` and `0 == size()`, the map is returned to the
1171 /// default constructed state. After this call, `load_factor()` will be
1172 /// less than or equal to `max_load_factor()` and all iterators,
1173 /// pointers, and references to elements of this map are invalidated.
1174 void rehash(bsl::size_t minimumCapacity);
1175
1176 /// Change the capacity of this map to at least a capacity that can
1177 /// accommodate the specified `numEntries` (accounting for the load
1178 /// factor invariant), and redistribute all the contained elements into
1179 /// a new sequence of entries according to their hash values. If
1180 /// `0 == numEntries` and `0 == size()`, the map is returned to the
1181 /// default constructed state. After this call, `load_factor()` will be
1182 /// less than or equal to `max_load_factor()` and all iterators,
1183 /// pointers, and references to elements of this map are invalidated.
1184 ///
1185 /// \note Note that this method is effectively equivalent to:
1186 /// @code
1187 /// rehash(bsl::ceil(numEntries / max_load_factor()))
1188 /// @endcode
1189 void reserve(bsl::size_t numEntries);
1190
1191 /// Remove all elements from this map and release all memory from this
1192 /// map, returning the map to the default constructed state.
1193 void reset();
1194
1195#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1196// {{{ BEGIN GENERATED CODE
1197// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
1198#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
1199#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
1200#endif
1201#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_F
1202#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_F BDLC_FLATHASHMAP_VARIADIC_LIMIT
1203#endif
1204#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1205#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1206 bsl::pair<iterator, bool> try_emplace(const KEY& key);
1207#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1208
1209#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1210 template< class ARGS_01>
1211 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1212 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1213#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1214
1215#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1216 template< class ARGS_01,
1217 class ARGS_02>
1218 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1219 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1220 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1221#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1222
1223#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1224 template< class ARGS_01,
1225 class ARGS_02,
1226 class ARGS_03>
1227 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1228 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1229 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1230 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1231#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1232
1233#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1234 template< class ARGS_01,
1235 class ARGS_02,
1236 class ARGS_03,
1237 class ARGS_04>
1238 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1239 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1240 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1241 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1242 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1243#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1244
1245#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1246 template< class ARGS_01,
1247 class ARGS_02,
1248 class ARGS_03,
1249 class ARGS_04,
1250 class ARGS_05>
1251 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1252 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1253 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1254 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1255 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1256 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1257#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1258
1259#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1260 template< class ARGS_01,
1261 class ARGS_02,
1262 class ARGS_03,
1263 class ARGS_04,
1264 class ARGS_05,
1265 class ARGS_06>
1266 bsl::pair<iterator, bool> try_emplace(const 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_F >= 6
1274
1275#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 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(const KEY& key,
1284 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1285 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1286 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1287 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1288 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1289 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1290 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1291#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1292
1293#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1294 template< class ARGS_01,
1295 class ARGS_02,
1296 class ARGS_03,
1297 class ARGS_04,
1298 class ARGS_05,
1299 class ARGS_06,
1300 class ARGS_07,
1301 class ARGS_08>
1302 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1303 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1304 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1305 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1306 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1307 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1308 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1309 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1310 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1311#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1312
1313#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1314 template< class ARGS_01,
1315 class ARGS_02,
1316 class ARGS_03,
1317 class ARGS_04,
1318 class ARGS_05,
1319 class ARGS_06,
1320 class ARGS_07,
1321 class ARGS_08,
1322 class ARGS_09>
1323 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1324 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1325 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1326 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1327 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1328 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1329 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1330 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1331 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1332 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1333#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1334
1335#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1336 template< class ARGS_01,
1337 class ARGS_02,
1338 class ARGS_03,
1339 class ARGS_04,
1340 class ARGS_05,
1341 class ARGS_06,
1342 class ARGS_07,
1343 class ARGS_08,
1344 class ARGS_09,
1345 class ARGS_10>
1346 bsl::pair<iterator, bool> try_emplace(const KEY& key,
1347 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1348 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1349 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1350 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1351 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1352 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1353 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1354 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1355 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1356 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1357#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1358
1359
1360#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1361 bsl::pair<iterator, bool> try_emplace(
1362 BloombergLP::bslmf::MovableRef<KEY> key);
1363#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1364
1365#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1366 template <class ARGS_01>
1367 bsl::pair<iterator, bool> try_emplace(
1368 BloombergLP::bslmf::MovableRef<KEY> key,
1369 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1370#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1371
1372#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1373 template <class ARGS_01,
1374 class ARGS_02>
1375 bsl::pair<iterator, bool> try_emplace(
1376 BloombergLP::bslmf::MovableRef<KEY> key,
1377 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1378 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1379#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1380
1381#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1382 template <class ARGS_01,
1383 class ARGS_02,
1384 class ARGS_03>
1385 bsl::pair<iterator, bool> try_emplace(
1386 BloombergLP::bslmf::MovableRef<KEY> key,
1387 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1388 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1389 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1390#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1391
1392#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1393 template <class ARGS_01,
1394 class ARGS_02,
1395 class ARGS_03,
1396 class ARGS_04>
1397 bsl::pair<iterator, bool> try_emplace(
1398 BloombergLP::bslmf::MovableRef<KEY> key,
1399 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1400 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1401 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1402 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1403#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1404
1405#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1406 template <class ARGS_01,
1407 class ARGS_02,
1408 class ARGS_03,
1409 class ARGS_04,
1410 class ARGS_05>
1411 bsl::pair<iterator, bool> try_emplace(
1412 BloombergLP::bslmf::MovableRef<KEY> key,
1413 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1414 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1415 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1416 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1417 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1418#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1419
1420#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1421 template <class ARGS_01,
1422 class ARGS_02,
1423 class ARGS_03,
1424 class ARGS_04,
1425 class ARGS_05,
1426 class ARGS_06>
1427 bsl::pair<iterator, bool> try_emplace(
1428 BloombergLP::bslmf::MovableRef<KEY> key,
1429 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1430 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1431 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1432 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1433 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1434 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1435#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1436
1437#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1438 template <class ARGS_01,
1439 class ARGS_02,
1440 class ARGS_03,
1441 class ARGS_04,
1442 class ARGS_05,
1443 class ARGS_06,
1444 class ARGS_07>
1445 bsl::pair<iterator, bool> try_emplace(
1446 BloombergLP::bslmf::MovableRef<KEY> key,
1447 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1448 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1449 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1450 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1451 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1452 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1453 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1454#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1455
1456#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1457 template <class ARGS_01,
1458 class ARGS_02,
1459 class ARGS_03,
1460 class ARGS_04,
1461 class ARGS_05,
1462 class ARGS_06,
1463 class ARGS_07,
1464 class ARGS_08>
1465 bsl::pair<iterator, bool> try_emplace(
1466 BloombergLP::bslmf::MovableRef<KEY> key,
1467 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1468 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1469 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1470 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1471 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1472 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1473 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1474 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1475#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1476
1477#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1478 template <class ARGS_01,
1479 class ARGS_02,
1480 class ARGS_03,
1481 class ARGS_04,
1482 class ARGS_05,
1483 class ARGS_06,
1484 class ARGS_07,
1485 class ARGS_08,
1486 class ARGS_09>
1487 bsl::pair<iterator, bool> try_emplace(
1488 BloombergLP::bslmf::MovableRef<KEY> key,
1489 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1490 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1491 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1492 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1493 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1494 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1495 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1496 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1497 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
1498#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1499
1500#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1501 template <class ARGS_01,
1502 class ARGS_02,
1503 class ARGS_03,
1504 class ARGS_04,
1505 class ARGS_05,
1506 class ARGS_06,
1507 class ARGS_07,
1508 class ARGS_08,
1509 class ARGS_09,
1510 class ARGS_10>
1511 bsl::pair<iterator, bool> try_emplace(
1512 BloombergLP::bslmf::MovableRef<KEY> key,
1513 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1514 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1515 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1516 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1517 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1518 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1519 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1520 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1521 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1522 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
1523#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1524
1525
1526#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1527 template <class LOOKUP_KEY>
1528 typename bsl::enable_if<
1529 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1530 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1532 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key)
1533 {
1534
1535 return d_impl.try_emplace(
1536 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1537 std::piecewise_construct,
1538 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1539 std::forward_as_tuple());
1540 }
1541#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1542
1543#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1544 template <class LOOKUP_KEY, class ARGS_01>
1545 typename bsl::enable_if<
1546 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1547 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1549 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1550 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
1551 {
1552
1553 return d_impl.try_emplace(
1554 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1555 std::piecewise_construct,
1556 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1557 std::forward_as_tuple(
1558 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)));
1559 }
1560#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1561
1562#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1563 template <class LOOKUP_KEY, class ARGS_01,
1564 class ARGS_02>
1565 typename bsl::enable_if<
1566 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1567 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1569 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1570 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1571 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
1572 {
1573
1574 return d_impl.try_emplace(
1575 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1576 std::piecewise_construct,
1577 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1578 std::forward_as_tuple(
1579 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1580 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)));
1581 }
1582#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1583
1584#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1585 template <class LOOKUP_KEY, class ARGS_01,
1586 class ARGS_02,
1587 class ARGS_03>
1588 typename bsl::enable_if<
1589 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1590 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1592 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1593 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1594 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1595 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
1596 {
1597
1598 return d_impl.try_emplace(
1599 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1600 std::piecewise_construct,
1601 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1602 std::forward_as_tuple(
1603 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1604 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1605 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)));
1606 }
1607#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1608
1609#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1610 template <class LOOKUP_KEY, class ARGS_01,
1611 class ARGS_02,
1612 class ARGS_03,
1613 class ARGS_04>
1614 typename bsl::enable_if<
1615 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1616 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1618 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1619 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1620 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1621 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1622 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
1623 {
1624
1625 return d_impl.try_emplace(
1626 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1627 std::piecewise_construct,
1628 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1629 std::forward_as_tuple(
1630 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1631 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1632 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1633 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)));
1634 }
1635#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1636
1637#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1638 template <class LOOKUP_KEY, class ARGS_01,
1639 class ARGS_02,
1640 class ARGS_03,
1641 class ARGS_04,
1642 class ARGS_05>
1643 typename bsl::enable_if<
1644 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1645 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1647 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1648 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1649 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1650 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1651 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1652 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
1653 {
1654
1655 return d_impl.try_emplace(
1656 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1657 std::piecewise_construct,
1658 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1659 std::forward_as_tuple(
1660 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1661 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1662 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1663 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1664 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)));
1665 }
1666#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1667
1668#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1669 template <class LOOKUP_KEY, class ARGS_01,
1670 class ARGS_02,
1671 class ARGS_03,
1672 class ARGS_04,
1673 class ARGS_05,
1674 class ARGS_06>
1675 typename bsl::enable_if<
1676 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1677 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1679 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1680 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1681 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1682 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1683 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1684 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
1686 {
1687
1688 return d_impl.try_emplace(
1689 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1690 std::piecewise_construct,
1691 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1692 std::forward_as_tuple(
1693 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1694 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1695 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1696 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1697 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
1698 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)));
1699 }
1700#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1701
1702#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1703 template <class LOOKUP_KEY, class ARGS_01,
1704 class ARGS_02,
1705 class ARGS_03,
1706 class ARGS_04,
1707 class ARGS_05,
1708 class ARGS_06,
1709 class ARGS_07>
1710 typename bsl::enable_if<
1711 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1712 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1714 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1715 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1716 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1717 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1718 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1719 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1720 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1721 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
1722 {
1723
1724 return d_impl.try_emplace(
1725 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1726 std::piecewise_construct,
1727 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1728 std::forward_as_tuple(
1729 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1730 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1731 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1732 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1733 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
1734 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
1735 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)));
1736 }
1737#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1738
1739#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1740 template <class LOOKUP_KEY, class ARGS_01,
1741 class ARGS_02,
1742 class ARGS_03,
1743 class ARGS_04,
1744 class ARGS_05,
1745 class ARGS_06,
1746 class ARGS_07,
1747 class ARGS_08>
1748 typename bsl::enable_if<
1749 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1750 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1752 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1753 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1754 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1755 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1756 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1757 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1758 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1759 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1760 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
1761 {
1762
1763 return d_impl.try_emplace(
1764 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1765 std::piecewise_construct,
1766 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1767 std::forward_as_tuple(
1768 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1769 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1770 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1771 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1772 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
1773 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
1774 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
1775 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)));
1776 }
1777#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1778
1779#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1780 template <class LOOKUP_KEY, class ARGS_01,
1781 class ARGS_02,
1782 class ARGS_03,
1783 class ARGS_04,
1784 class ARGS_05,
1785 class ARGS_06,
1786 class ARGS_07,
1787 class ARGS_08,
1788 class ARGS_09>
1789 typename bsl::enable_if<
1790 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1791 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1793 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1794 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1795 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1796 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1797 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1798 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1799 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1800 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1801 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1802 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
1803 {
1804
1805 return d_impl.try_emplace(
1806 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1807 std::piecewise_construct,
1808 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1809 std::forward_as_tuple(
1810 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1811 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1812 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1813 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1814 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
1815 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
1816 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
1817 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
1818 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)));
1819 }
1820#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1821
1822#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1823 template <class LOOKUP_KEY, class ARGS_01,
1824 class ARGS_02,
1825 class ARGS_03,
1826 class ARGS_04,
1827 class ARGS_05,
1828 class ARGS_06,
1829 class ARGS_07,
1830 class ARGS_08,
1831 class ARGS_09,
1832 class ARGS_10>
1833 typename bsl::enable_if<
1834 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
1835 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
1837 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
1838 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1839 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1841 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1842 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1843 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1844 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1845 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
1846 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
1847 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
1848 {
1849
1850 return d_impl.try_emplace(
1851 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1852 std::piecewise_construct,
1853 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
1854 std::forward_as_tuple(
1855 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
1856 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
1857 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
1858 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
1859 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
1860 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
1861 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
1862 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
1863 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
1864 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)));
1865 }
1866#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
1867
1868
1869#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1870 iterator
1871 try_emplace(const_iterator, const KEY& key);
1872#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
1873
1874#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1875 template<class ARGS_01>
1876 iterator
1877 try_emplace(const_iterator, const KEY& key,
1878 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
1879#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
1880
1881#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1882 template<class ARGS_01,
1883 class ARGS_02>
1884 iterator
1885 try_emplace(const_iterator, const KEY& key,
1886 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1887 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
1888#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
1889
1890#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1891 template<class ARGS_01,
1892 class ARGS_02,
1893 class ARGS_03>
1894 iterator
1895 try_emplace(const_iterator, const KEY& key,
1896 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1897 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1898 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
1899#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
1900
1901#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1902 template<class ARGS_01,
1903 class ARGS_02,
1904 class ARGS_03,
1905 class ARGS_04>
1906 iterator
1907 try_emplace(const_iterator, const KEY& key,
1908 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1909 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1910 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1911 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
1912#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
1913
1914#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1915 template<class ARGS_01,
1916 class ARGS_02,
1917 class ARGS_03,
1918 class ARGS_04,
1919 class ARGS_05>
1920 iterator
1921 try_emplace(const_iterator, const KEY& key,
1922 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1923 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1924 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1925 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1926 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
1927#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
1928
1929#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1930 template<class ARGS_01,
1931 class ARGS_02,
1932 class ARGS_03,
1933 class ARGS_04,
1934 class ARGS_05,
1935 class ARGS_06>
1936 iterator
1937 try_emplace(const_iterator, const KEY& key,
1938 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1939 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1940 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1941 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1942 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1943 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
1944#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
1945
1946#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1947 template<class ARGS_01,
1948 class ARGS_02,
1949 class ARGS_03,
1950 class ARGS_04,
1951 class ARGS_05,
1952 class ARGS_06,
1953 class ARGS_07>
1954 iterator
1955 try_emplace(const_iterator, const KEY& key,
1956 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1957 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1958 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1959 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1960 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1961 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1962 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
1963#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
1964
1965#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1966 template<class ARGS_01,
1967 class ARGS_02,
1968 class ARGS_03,
1969 class ARGS_04,
1970 class ARGS_05,
1971 class ARGS_06,
1972 class ARGS_07,
1973 class ARGS_08>
1974 iterator
1975 try_emplace(const_iterator, const KEY& key,
1976 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1977 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
1978 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
1979 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
1980 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
1981 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
1982 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
1983 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
1984#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
1985
1986#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
1987 template<class ARGS_01,
1988 class ARGS_02,
1989 class ARGS_03,
1990 class ARGS_04,
1991 class ARGS_05,
1992 class ARGS_06,
1993 class ARGS_07,
1994 class ARGS_08,
1995 class ARGS_09>
1996 iterator
1997 try_emplace(const_iterator, const KEY& key,
1998 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
1999 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2000 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2001 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2002 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2003 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2004 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2005 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2006 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
2007#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
2008
2009#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2010 template<class ARGS_01,
2011 class ARGS_02,
2012 class ARGS_03,
2013 class ARGS_04,
2014 class ARGS_05,
2015 class ARGS_06,
2016 class ARGS_07,
2017 class ARGS_08,
2018 class ARGS_09,
2019 class ARGS_10>
2020 iterator
2021 try_emplace(const_iterator, const KEY& key,
2022 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2023 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2024 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2025 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2026 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2027 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2028 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2029 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2030 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
2031 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
2032#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2033
2034
2035#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
2036 iterator try_emplace(const_iterator,
2037 BloombergLP::bslmf::MovableRef<KEY> key);
2038#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
2039
2040#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
2041 template <class ARGS_01>
2042 iterator try_emplace(const_iterator,
2043 BloombergLP::bslmf::MovableRef<KEY> key,
2044 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01);
2045#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
2046
2047#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
2048 template <class ARGS_01,
2049 class ARGS_02>
2050 iterator try_emplace(const_iterator,
2051 BloombergLP::bslmf::MovableRef<KEY> key,
2052 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2053 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02);
2054#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
2055
2056#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
2057 template <class ARGS_01,
2058 class ARGS_02,
2059 class ARGS_03>
2060 iterator try_emplace(const_iterator,
2061 BloombergLP::bslmf::MovableRef<KEY> key,
2062 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2063 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2064 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03);
2065#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
2066
2067#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
2068 template <class ARGS_01,
2069 class ARGS_02,
2070 class ARGS_03,
2071 class ARGS_04>
2072 iterator try_emplace(const_iterator,
2073 BloombergLP::bslmf::MovableRef<KEY> key,
2074 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2075 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2076 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2077 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04);
2078#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
2079
2080#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
2081 template <class ARGS_01,
2082 class ARGS_02,
2083 class ARGS_03,
2084 class ARGS_04,
2085 class ARGS_05>
2086 iterator try_emplace(const_iterator,
2087 BloombergLP::bslmf::MovableRef<KEY> key,
2088 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2089 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2090 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2091 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2092 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05);
2093#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
2094
2095#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
2096 template <class ARGS_01,
2097 class ARGS_02,
2098 class ARGS_03,
2099 class ARGS_04,
2100 class ARGS_05,
2101 class ARGS_06>
2102 iterator try_emplace(const_iterator,
2103 BloombergLP::bslmf::MovableRef<KEY> key,
2104 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2105 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2106 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2107 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2108 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2109 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06);
2110#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
2111
2112#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
2113 template <class ARGS_01,
2114 class ARGS_02,
2115 class ARGS_03,
2116 class ARGS_04,
2117 class ARGS_05,
2118 class ARGS_06,
2119 class ARGS_07>
2120 iterator try_emplace(const_iterator,
2121 BloombergLP::bslmf::MovableRef<KEY> key,
2122 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2123 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2124 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2125 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2126 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2127 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2128 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07);
2129#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
2130
2131#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
2132 template <class ARGS_01,
2133 class ARGS_02,
2134 class ARGS_03,
2135 class ARGS_04,
2136 class ARGS_05,
2137 class ARGS_06,
2138 class ARGS_07,
2139 class ARGS_08>
2140 iterator try_emplace(const_iterator,
2141 BloombergLP::bslmf::MovableRef<KEY> key,
2142 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2143 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2144 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2145 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2146 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2147 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2148 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2149 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08);
2150#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
2151
2152#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
2153 template <class ARGS_01,
2154 class ARGS_02,
2155 class ARGS_03,
2156 class ARGS_04,
2157 class ARGS_05,
2158 class ARGS_06,
2159 class ARGS_07,
2160 class ARGS_08,
2161 class ARGS_09>
2162 iterator try_emplace(const_iterator,
2163 BloombergLP::bslmf::MovableRef<KEY> key,
2164 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2165 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2166 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2167 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2168 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2170 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2171 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2172 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09);
2173#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
2174
2175#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2176 template <class ARGS_01,
2177 class ARGS_02,
2178 class ARGS_03,
2179 class ARGS_04,
2180 class ARGS_05,
2181 class ARGS_06,
2182 class ARGS_07,
2183 class ARGS_08,
2184 class ARGS_09,
2185 class ARGS_10>
2186 iterator try_emplace(const_iterator,
2187 BloombergLP::bslmf::MovableRef<KEY> key,
2188 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2189 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2190 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2191 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2192 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2193 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2194 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2195 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2196 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
2197 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10);
2198#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2199
2200
2201#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
2202 template <class LOOKUP_KEY>
2203 typename bsl::enable_if<
2204 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2205 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2206 , iterator>::type
2207 try_emplace(const_iterator,
2208 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key)
2209 {
2210
2211 return d_impl.try_emplace(
2212 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2213 std::piecewise_construct,
2214 std::forward_as_tuple(
2215 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2216 std::forward_as_tuple(
2217 )
2218 ).first;
2219 }
2220#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 0
2221
2222#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
2223 template <class LOOKUP_KEY, class ARGS_01>
2224 typename bsl::enable_if<
2225 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2226 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2227 , iterator>::type
2228 try_emplace(const_iterator,
2229 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2230 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
2231 {
2232
2233 return d_impl.try_emplace(
2234 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2235 std::piecewise_construct,
2236 std::forward_as_tuple(
2237 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2238 std::forward_as_tuple(
2239 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01))
2240 ).first;
2241 }
2242#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 1
2243
2244#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
2245 template <class LOOKUP_KEY, class ARGS_01,
2246 class ARGS_02>
2247 typename bsl::enable_if<
2248 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2249 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2250 , iterator>::type
2251 try_emplace(const_iterator,
2252 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2253 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2254 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
2255 {
2256
2257 return d_impl.try_emplace(
2258 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2259 std::piecewise_construct,
2260 std::forward_as_tuple(
2261 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2262 std::forward_as_tuple(
2263 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2264 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02))
2265 ).first;
2266 }
2267#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 2
2268
2269#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
2270 template <class LOOKUP_KEY, class ARGS_01,
2271 class ARGS_02,
2272 class ARGS_03>
2273 typename bsl::enable_if<
2274 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2275 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2276 , iterator>::type
2277 try_emplace(const_iterator,
2278 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2279 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2280 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2281 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
2282 {
2283
2284 return d_impl.try_emplace(
2285 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2286 std::piecewise_construct,
2287 std::forward_as_tuple(
2288 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2289 std::forward_as_tuple(
2290 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2291 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2292 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03))
2293 ).first;
2294 }
2295#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 3
2296
2297#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
2298 template <class LOOKUP_KEY, class ARGS_01,
2299 class ARGS_02,
2300 class ARGS_03,
2301 class ARGS_04>
2302 typename bsl::enable_if<
2303 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2304 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2305 , iterator>::type
2306 try_emplace(const_iterator,
2307 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2308 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2309 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2310 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2311 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
2312 {
2313
2314 return d_impl.try_emplace(
2315 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2316 std::piecewise_construct,
2317 std::forward_as_tuple(
2318 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2319 std::forward_as_tuple(
2320 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2321 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2322 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2323 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04))
2324 ).first;
2325 }
2326#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 4
2327
2328#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
2329 template <class LOOKUP_KEY, class ARGS_01,
2330 class ARGS_02,
2331 class ARGS_03,
2332 class ARGS_04,
2333 class ARGS_05>
2334 typename bsl::enable_if<
2335 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2336 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2337 , iterator>::type
2338 try_emplace(const_iterator,
2339 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2340 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2341 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2342 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2343 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2344 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
2345 {
2346
2347 return d_impl.try_emplace(
2348 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2349 std::piecewise_construct,
2350 std::forward_as_tuple(
2351 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2352 std::forward_as_tuple(
2353 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2354 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2355 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2356 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2357 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05))
2358 ).first;
2359 }
2360#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 5
2361
2362#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
2363 template <class LOOKUP_KEY, class ARGS_01,
2364 class ARGS_02,
2365 class ARGS_03,
2366 class ARGS_04,
2367 class ARGS_05,
2368 class ARGS_06>
2369 typename bsl::enable_if<
2370 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2371 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2372 , iterator>::type
2373 try_emplace(const_iterator,
2374 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2375 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2376 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2377 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2378 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2379 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2380 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
2381 {
2382
2383 return d_impl.try_emplace(
2384 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2385 std::piecewise_construct,
2386 std::forward_as_tuple(
2387 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2388 std::forward_as_tuple(
2389 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2390 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2391 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2392 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2393 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2394 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06))
2395 ).first;
2396 }
2397#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 6
2398
2399#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
2400 template <class LOOKUP_KEY, class ARGS_01,
2401 class ARGS_02,
2402 class ARGS_03,
2403 class ARGS_04,
2404 class ARGS_05,
2405 class ARGS_06,
2406 class ARGS_07>
2407 typename bsl::enable_if<
2408 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2409 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2410 , iterator>::type
2411 try_emplace(const_iterator,
2412 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2413 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2414 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2415 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2416 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2417 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2418 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2419 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
2420 {
2421
2422 return d_impl.try_emplace(
2423 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2424 std::piecewise_construct,
2425 std::forward_as_tuple(
2426 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2427 std::forward_as_tuple(
2428 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2429 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2430 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2431 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2432 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2433 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2434 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07))
2435 ).first;
2436 }
2437#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 7
2438
2439#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
2440 template <class LOOKUP_KEY, class ARGS_01,
2441 class ARGS_02,
2442 class ARGS_03,
2443 class ARGS_04,
2444 class ARGS_05,
2445 class ARGS_06,
2446 class ARGS_07,
2447 class ARGS_08>
2448 typename bsl::enable_if<
2449 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2450 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2451 , iterator>::type
2452 try_emplace(const_iterator,
2453 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2454 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2455 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2456 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2457 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2458 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2459 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2460 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2461 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
2462 {
2463
2464 return d_impl.try_emplace(
2465 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2466 std::piecewise_construct,
2467 std::forward_as_tuple(
2468 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2469 std::forward_as_tuple(
2470 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2471 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2472 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2473 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2474 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2475 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2476 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2477 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08))
2478 ).first;
2479 }
2480#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 8
2481
2482#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
2483 template <class LOOKUP_KEY, class ARGS_01,
2484 class ARGS_02,
2485 class ARGS_03,
2486 class ARGS_04,
2487 class ARGS_05,
2488 class ARGS_06,
2489 class ARGS_07,
2490 class ARGS_08,
2491 class ARGS_09>
2492 typename bsl::enable_if<
2493 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2494 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2495 , iterator>::type
2496 try_emplace(const_iterator,
2497 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2498 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2499 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2500 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2501 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2502 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2503 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2504 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2505 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2506 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
2507 {
2508
2509 return d_impl.try_emplace(
2510 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2511 std::piecewise_construct,
2512 std::forward_as_tuple(
2513 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2514 std::forward_as_tuple(
2515 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2516 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2517 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2518 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2519 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2520 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2521 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2522 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2523 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09))
2524 ).first;
2525 }
2526#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 9
2527
2528#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2529 template <class LOOKUP_KEY, class ARGS_01,
2530 class ARGS_02,
2531 class ARGS_03,
2532 class ARGS_04,
2533 class ARGS_05,
2534 class ARGS_06,
2535 class ARGS_07,
2536 class ARGS_08,
2537 class ARGS_09,
2538 class ARGS_10>
2539 typename bsl::enable_if<
2540 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2541 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2542 , iterator>::type
2543 try_emplace(const_iterator,
2544 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2545 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2546 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2547 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
2548 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
2549 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
2550 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
2551 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
2552 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
2553 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
2554 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
2555 {
2556
2557 return d_impl.try_emplace(
2558 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2559 std::piecewise_construct,
2560 std::forward_as_tuple(
2561 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2562 std::forward_as_tuple(
2563 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2564 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2565 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
2566 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
2567 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
2568 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
2569 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
2570 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
2571 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
2572 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10))
2573 ).first;
2574 }
2575#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_F >= 10
2576
2577
2578#endif
2579#else
2580// The generated code below is a workaround for the absence of perfect
2581// forwarding in some compilers.
2582#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
2583 template< class... ARGS>
2584 bsl::pair<iterator, bool> try_emplace(const KEY& key,
2585 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
2586
2587 template <class... ARGS>
2588 bsl::pair<iterator, bool> try_emplace(
2589 BloombergLP::bslmf::MovableRef<KEY> key,
2590 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
2591
2592 template <class LOOKUP_KEY, class... ARGS>
2593 typename bsl::enable_if<
2594 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2595 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2597 try_emplace(BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2599 {
2600
2601 return d_impl.try_emplace(
2602 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2603 std::piecewise_construct,
2604 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2605 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...));
2606 }
2607
2608 template<class... ARGS>
2609 iterator
2610 try_emplace(const_iterator, const KEY& key,
2611 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
2612
2613 template <class... ARGS>
2614 iterator try_emplace(const_iterator,
2615 BloombergLP::bslmf::MovableRef<KEY> key,
2616 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args);
2617
2618 template <class LOOKUP_KEY, class... ARGS>
2619 typename bsl::enable_if<
2620 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2621 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2622 , iterator>::type
2623 try_emplace(const_iterator,
2624 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2626 {
2627
2628 return d_impl.try_emplace(
2629 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2630 std::piecewise_construct,
2631 std::forward_as_tuple(
2632 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key)),
2633 std::forward_as_tuple(
2634 BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...)
2635 ).first;
2636 }
2637
2638#endif
2639// }}} END GENERATED CODE
2640#endif
2641
2642 // Iterators
2643
2644 /// Return an iterator to the first element in the sequence of
2645 /// modifiable elements maintained by this map, or the `end` iterator if
2646 /// this map is empty.
2647 iterator begin();
2648
2649 /// Return an iterator to the past-the-end element in the sequence of
2650 /// modifiable elements maintained by this map.
2651 iterator end();
2652
2653 // Aspects
2654
2655 /// Exchange the value of this object as well as its hasher and equality
2656 /// functors with those of the specified `other` object.
2657 ///
2658 /// \pre The behavior is undefined unless this object was created with the same allocator
2659 /// as `other`.
2660 void swap(FlatHashMap& other);
2661
2662 // ACCESSORS
2663
2664 /// Return a reference providing non-modifiable access to the mapped
2665 /// value associated with the specified `key` in this map, if such an
2666 /// entry exists; otherwise throw a `std::out_of_range` exception.
2667 ///
2668 /// \note Note that this method is not exception-neutral.
2669 const VALUE& at(const KEY& key) const;
2670
2671 /// Return a reference providing non-modifiable access to the mapped
2672 /// value associated with a key that is equivalent to the specified `key`
2673 /// in this map, if such an entry exists; otherwise throw a `std::out_of_range` exception.
2674 ///
2675 /// \note Note that this method is not
2676 /// exception-neutral.
2677 template <class LOOKUP_KEY>
2678 typename bsl::enable_if<
2679 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2680 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2681 , const VALUE&>::type
2682 at(const LOOKUP_KEY& key) const
2683 {
2684 // Note: implemented inline due to Sun CC compilation error.
2685
2686 const_iterator iter = find(key);
2687 if (iter == end()) {
2688 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
2689 "FlatHashMap::at(LOOKUP_KEY) const: invalid key_value");
2690 }
2691 return iter->second;
2692 }
2693
2694 /// Return the number of elements this map could hold if the load factor
2695 /// were 1.
2696 bsl::size_t capacity() const;
2697
2698 /// Return `true` if this map contains an element having the specified
2699 /// `key`, and `false` otherwise.
2700 bool contains(const KEY& key) const;
2701
2702 /// Return `true` if this map contains an element whose key is equivalent
2703 /// to the specified `key`.
2704 template <class LOOKUP_KEY>
2705 typename bsl::enable_if<
2706 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2707 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2708 , bool>::type
2709 contains(const LOOKUP_KEY& key) const
2710 {
2711 // Note: implemented inline due to Sun CC compilation error.
2712
2713 return find(key) != end();
2714 }
2715
2716 /// Return the number of elements in this map having the specified `key`.
2717 ///
2718 /// \note Note that since a flat hash map maintains unique keys, the
2719 /// returned value will be either 0 or 1.
2720 bsl::size_t count(const KEY& key) const;
2721
2722 /// Return the number of elements in this map having a key equivalent to the specified `key`.
2723 ///
2724 /// \note Note that since a flat hash map maintains unique
2725 /// keys, the returned value will be either 0 or 1.
2726 template <class LOOKUP_KEY>
2727 typename bsl::enable_if<
2728 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2729 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2730 , bsl::size_t >::type
2731 count(const LOOKUP_KEY& key) const
2732 {
2733 // Note: implemented inline due to Sun CC compilation error.
2734
2735 return find(key) != end() ? 1 : 0;
2736 }
2737
2738 /// Return `true` if this map contains no elements, and `false`
2739 /// otherwise.
2740 bool empty() const;
2741
2742 /// Return a pair of `const_iterator`s defining the sequence of elements
2743 /// in this map having the specified `key`, where the first iterator is
2744 /// positioned at the start of the sequence and the second iterator is
2745 /// positioned one past the end of the sequence. If this map contains
2746 /// no elements having a key equivalent to `key`, then the two returned iterators will have the same value.
2747 ///
2748 /// \note Note that since a map maintains
2749 /// unique keys, the range will contain at most one element.
2751 const KEY& key) const;
2752
2753 /// Return a pair of iterators providing non-modifiable access to the
2754 /// sequence of `value_type` objects in this unordered map that are
2755 /// equivalent to the specified `key`, where the first iterator is
2756 /// positioned at the start of the sequence and the second iterator is
2757 /// positioned one past the end of the sequence. If this unordered map
2758 /// contains no `value_type` objects equivalent to `key`, then the two returned iterators will have the same value.
2759 ///
2760 /// \note Note that since an
2761 /// unordered map maintains unique keys, the range will contain at most one
2762 /// element.
2763 template <class LOOKUP_KEY>
2764 typename bsl::enable_if<
2765 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2766 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2768 equal_range(const LOOKUP_KEY& key) const
2769 {
2770 // Note: implemented inline due to Sun CC compilation error.
2771
2772 return d_impl.equal_range(key);
2773 }
2774
2775 /// Return a `const_iterator` referring to the element in this map
2776 /// having the specified `key`, or `end()` if no such entry exists in
2777 /// this map.
2778 const_iterator find(const KEY& key) const;
2779
2780 /// Return a `const_iterator` referring to the element in this map
2781 /// having the specified `key`, or `end()` if no such entry exists in
2782 /// this map.
2783 template <class LOOKUP_KEY>
2784 typename bsl::enable_if<
2785 BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
2786 && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
2787 , const_iterator>::type
2788 find(const LOOKUP_KEY& key) const
2789 {
2790 // Note: implemented inline due to Sun CC compilation error.
2791
2792 return const_iterator(d_impl.find(key));
2793 }
2794
2795
2796 /// Return (a copy of) the unary hash functor used by this map to
2797 /// generate a hash value (of type `bsl::size_t`) for a `KEY` object.
2798 HASH hash_function() const;
2799
2800 /// Return (a copy of) the binary key-equality functor that returns
2801 /// `true` if the value of two `KEY` objects are equivalent, and `false`
2802 /// otherwise.
2803 EQUAL key_eq() const;
2804
2805 /// Return the current ratio between the number of elements in this
2806 /// container and its capacity.
2807 float load_factor() const;
2808
2809 /// Return the maximum load factor allowed for this map.
2810 /// \note Note that if
2811 /// an insert operation would cause the load factor to exceed
2812 /// `max_load_factor()`, that same insert operation will increase the
2813 /// capacity and rehash the entries of the container (see {Load Factor
2814 /// and Resizing}). Also note that the value returned by
2815 /// @ref max_load_factor is implementation defined and cannot be changed by
2816 /// the user.
2817 float max_load_factor() const;
2818
2819 /// Return the number of elements in this map.
2820 bsl::size_t size() const;
2821
2822 // Iterators
2823
2824 /// Return a `const_iterator` to the first element in the sequence of
2825 /// elements maintained by this map, or the `end` iterator if this map
2826 /// is empty.
2827 const_iterator begin() const;
2828
2829 /// Return a `const_iterator` to the first element in the sequence of
2830 /// elements maintained by this map, or the `end` iterator if this map
2831 /// is empty.
2832 const_iterator cbegin() const;
2833
2834 /// Return a `const_iterator` to the past-the-end element in the
2835 /// sequence of elements maintained by this map.
2836 const_iterator cend() const;
2837
2838 /// Return a `const_iterator` to the past-the-end element in the
2839 /// sequence of elements maintained by this map.
2840 const_iterator end() const;
2841
2842 // Aspects
2843
2844 /// Return the allocator used by this flat hash map to supply memory.
2845 bslma::Allocator *allocator() const;
2846
2847 /// Format this object to the specified output `stream` at the (absolute
2848 /// value of) the optionally specified indentation `level`, and return a
2849 /// reference to the modifiable `stream`. If `level` is specified,
2850 /// optionally specify `spacesPerLevel`, the number of spaces per
2851 /// indentation level for this and all of its nested objects. If
2852 /// `level` is negative, suppress indentation of the first line. If
2853 /// `spacesPerLevel` is negative, format the entire output on one line,
2854 /// suppressing all but the initial indentation (as governed by
2855 /// `level`). If `stream` is not valid on entry, this operation has no
2856 /// effect.
2857 bsl::ostream& print(bsl::ostream& stream,
2858 int level = 0,
2859 int spacesPerLevel = 4) const;
2860};
2861
2862// FREE OPERATORS
2863
2864/// Return `true` if the specified `lhs` and `rhs` objects have the same
2865/// value, and `false` otherwise. Two `FlatHashMap` objects have the same
2866/// value if their sizes are the same and each element contained in one is
2867/// equal to an element of the other. The hash and equality functors are
2868/// not involved in the comparison.
2869template <class KEY, class VALUE, class HASH, class EQUAL>
2870bool operator==(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
2871 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
2872
2873/// Return `true` if the specified `lhs` and `rhs` objects do not have the
2874/// same value, and `false` otherwise. Two `FlatHashMap` objects do not
2875/// have the same value if their sizes are different or one contains an
2876/// element equal to no element of the other. The hash and equality
2877/// functors are not involved in the comparison.
2878template <class KEY, class VALUE, class HASH, class EQUAL>
2879bool operator!=(const FlatHashMap<KEY, VALUE, HASH, EQUAL> &lhs,
2880 const FlatHashMap<KEY, VALUE, HASH, EQUAL> &rhs);
2881
2882/// Write the value of the specified `map` to the specified output `stream`
2883/// in a single-line format, and return a reference providing modifiable
2884/// access to `stream`. If `stream` is not valid on entry, this operation has no effect.
2885///
2886/// \note Note that this human-readable format is not fully
2887/// specified and can change without notice.
2888template <class KEY, class VALUE, class HASH, class EQUAL>
2889bsl::ostream& operator<<(bsl::ostream& stream,
2890 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& map);
2891
2892// FREE FUNCTIONS
2893
2894/// Exchange the value, the hasher, and the key-equality functor of the
2895/// specified `a` and `b` objects. This function provides the no-throw
2896/// exception-safety guarantee if the two objects were created with the same
2897/// allocator and the basic guarantee otherwise.
2898template <class KEY, class VALUE, class HASH, class EQUAL>
2899void swap(FlatHashMap<KEY, VALUE, HASH, EQUAL>& a,
2900 FlatHashMap<KEY, VALUE, HASH, EQUAL>& b);
2901
2902// ============================================================================
2903// TEMPLATE AND INLINE FUNCTION DEFINITIONS
2904// ============================================================================
2905
2906 // ----------------------------
2907 // struct FlatHashMap_EntryUtil
2908 // ----------------------------
2909
2910// CLASS METHODS
2911#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2912// {{{ BEGIN GENERATED CODE
2913// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
2914#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
2915#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
2916#endif
2917#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_G
2918#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_G BDLC_FLATHASHMAP_VARIADIC_LIMIT
2919#endif
2920#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 0
2921template <class KEY, class VALUE, class ENTRY>
2922inline
2924 ENTRY *entry,
2925 bslma::Allocator *allocator)
2926{
2927 BSLS_ASSERT_SAFE(entry);
2929 entry,
2930 allocator);
2931}
2932#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 0
2933
2934#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 1
2935template <class KEY, class VALUE, class ENTRY>
2936template <class ARGS_01>
2937inline
2939 ENTRY *entry,
2940 bslma::Allocator *allocator,
2941 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
2942{
2943 BSLS_ASSERT_SAFE(entry);
2945 entry,
2946 allocator,
2947 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01));
2948}
2949#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 1
2950
2951#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 2
2952template <class KEY, class VALUE, class ENTRY>
2953template <class ARGS_01,
2954 class ARGS_02>
2955inline
2957 ENTRY *entry,
2958 bslma::Allocator *allocator,
2959 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2960 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
2961{
2962 BSLS_ASSERT_SAFE(entry);
2964 entry,
2965 allocator,
2966 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2967 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02));
2968}
2969#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 2
2970
2971#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 3
2972template <class KEY, class VALUE, class ENTRY>
2973template <class ARGS_01,
2974 class ARGS_02,
2975 class ARGS_03>
2976inline
2978 ENTRY *entry,
2979 bslma::Allocator *allocator,
2980 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
2981 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
2982 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
2983{
2984 BSLS_ASSERT_SAFE(entry);
2986 entry,
2987 allocator,
2988 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
2989 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
2990 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03));
2991}
2992#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 3
2993
2994#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 4
2995template <class KEY, class VALUE, class ENTRY>
2996template <class ARGS_01,
2997 class ARGS_02,
2998 class ARGS_03,
2999 class ARGS_04>
3000inline
3002 ENTRY *entry,
3003 bslma::Allocator *allocator,
3004 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3005 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3006 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3007 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3008{
3009 BSLS_ASSERT_SAFE(entry);
3011 entry,
3012 allocator,
3013 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3014 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3015 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3016 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04));
3017}
3018#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 4
3019
3020#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 5
3021template <class KEY, class VALUE, class ENTRY>
3022template <class ARGS_01,
3023 class ARGS_02,
3024 class ARGS_03,
3025 class ARGS_04,
3026 class ARGS_05>
3027inline
3029 ENTRY *entry,
3030 bslma::Allocator *allocator,
3031 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3032 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3033 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3034 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3035 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3036{
3037 BSLS_ASSERT_SAFE(entry);
3039 entry,
3040 allocator,
3041 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3042 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3043 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3044 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3045 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05));
3046}
3047#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 5
3048
3049#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 6
3050template <class KEY, class VALUE, class ENTRY>
3051template <class ARGS_01,
3052 class ARGS_02,
3053 class ARGS_03,
3054 class ARGS_04,
3055 class ARGS_05,
3056 class ARGS_06>
3057inline
3059 ENTRY *entry,
3060 bslma::Allocator *allocator,
3061 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3062 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3063 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3064 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3065 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3066 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
3067{
3068 BSLS_ASSERT_SAFE(entry);
3070 entry,
3071 allocator,
3072 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3073 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3074 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3075 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3076 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3077 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06));
3078}
3079#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 6
3080
3081#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 7
3082template <class KEY, class VALUE, class ENTRY>
3083template <class ARGS_01,
3084 class ARGS_02,
3085 class ARGS_03,
3086 class ARGS_04,
3087 class ARGS_05,
3088 class ARGS_06,
3089 class ARGS_07>
3090inline
3092 ENTRY *entry,
3093 bslma::Allocator *allocator,
3094 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3095 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3096 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3097 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3098 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3099 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3100 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
3101{
3102 BSLS_ASSERT_SAFE(entry);
3104 entry,
3105 allocator,
3106 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3107 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3108 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3109 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3110 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3111 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3112 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07));
3113}
3114#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 7
3115
3116#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 8
3117template <class KEY, class VALUE, class ENTRY>
3118template <class ARGS_01,
3119 class ARGS_02,
3120 class ARGS_03,
3121 class ARGS_04,
3122 class ARGS_05,
3123 class ARGS_06,
3124 class ARGS_07,
3125 class ARGS_08>
3126inline
3128 ENTRY *entry,
3129 bslma::Allocator *allocator,
3130 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3131 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3132 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3133 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3134 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3135 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3136 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3137 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
3138{
3139 BSLS_ASSERT_SAFE(entry);
3141 entry,
3142 allocator,
3143 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3144 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3145 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3146 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3147 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3148 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3149 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3150 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08));
3151}
3152#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 8
3153
3154#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 9
3155template <class KEY, class VALUE, class ENTRY>
3156template <class ARGS_01,
3157 class ARGS_02,
3158 class ARGS_03,
3159 class ARGS_04,
3160 class ARGS_05,
3161 class ARGS_06,
3162 class ARGS_07,
3163 class ARGS_08,
3164 class ARGS_09>
3165inline
3167 ENTRY *entry,
3168 bslma::Allocator *allocator,
3169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3170 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3171 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3172 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3173 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3174 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3175 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3176 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3177 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
3178{
3179 BSLS_ASSERT_SAFE(entry);
3181 entry,
3182 allocator,
3183 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3184 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3185 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3186 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3187 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3188 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3189 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3190 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3191 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09));
3192}
3193#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 9
3194
3195#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 10
3196template <class KEY, class VALUE, class ENTRY>
3197template <class ARGS_01,
3198 class ARGS_02,
3199 class ARGS_03,
3200 class ARGS_04,
3201 class ARGS_05,
3202 class ARGS_06,
3203 class ARGS_07,
3204 class ARGS_08,
3205 class ARGS_09,
3206 class ARGS_10>
3207inline
3209 ENTRY *entry,
3210 bslma::Allocator *allocator,
3211 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3212 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3213 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3214 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3215 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3216 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3217 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3218 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3219 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
3220 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
3221{
3222 BSLS_ASSERT_SAFE(entry);
3224 entry,
3225 allocator,
3226 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3227 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3228 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3229 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3230 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3231 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3232 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3233 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3234 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
3235 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10));
3236}
3237#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_G >= 10
3238
3239#else
3240// The generated code below is a workaround for the absence of perfect
3241// forwarding in some compilers.
3242template <class KEY, class VALUE, class ENTRY>
3243template <class... ARGS>
3244inline
3246 ENTRY *entry,
3247 bslma::Allocator *allocator,
3249{
3250 BSLS_ASSERT_SAFE(entry);
3252 entry,
3253 allocator,
3254 BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...);
3255}
3256// }}} END GENERATED CODE
3257#endif
3258
3259template <class KEY, class VALUE, class ENTRY>
3260template <class KEY_TYPE>
3261inline
3263 ENTRY *entry,
3264 bslma::Allocator *allocator,
3266{
3267 BSLS_ASSERT_SAFE(entry);
3268
3270
3271 bslma::ConstructionUtil::construct(value.address(), allocator);
3273
3275 entry,
3276 allocator,
3277 BSLS_COMPILERFEATURES_FORWARD(KEY_TYPE, key),
3279}
3280
3281template <class KEY, class VALUE, class ENTRY>
3282inline
3283const KEY& FlatHashMap_EntryUtil<KEY, VALUE, ENTRY>::key(const ENTRY& entry)
3284{
3285 return entry.first;
3286}
3287
3288 // -----------------
3289 // class FlatHashMap
3290 // -----------------
3291
3292// CREATORS
3293template <class KEY, class VALUE, class HASH, class EQUAL>
3294inline
3296: d_impl(0, HASH(), EQUAL())
3297{
3298}
3299
3300template <class KEY, class VALUE, class HASH, class EQUAL>
3301inline
3302FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3303 bslma::Allocator *basicAllocator)
3304: d_impl(0, HASH(), EQUAL(), basicAllocator)
3305{
3306}
3307
3308template <class KEY, class VALUE, class HASH, class EQUAL>
3309inline
3310FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(bsl::size_t capacity)
3311: d_impl(capacity, HASH(), EQUAL())
3312{
3313}
3314
3315template <class KEY, class VALUE, class HASH, class EQUAL>
3316inline
3317FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3318 bsl::size_t capacity,
3319 bslma::Allocator *basicAllocator)
3320: d_impl(capacity, HASH(), EQUAL(), basicAllocator)
3321{
3322}
3323
3324template <class KEY, class VALUE, class HASH, class EQUAL>
3325inline
3326FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3327 bsl::size_t capacity,
3328 const HASH& hash,
3329 bslma::Allocator *basicAllocator)
3330: d_impl(capacity, hash, EQUAL(), basicAllocator)
3331{
3332}
3333
3334template <class KEY, class VALUE, class HASH, class EQUAL>
3335inline
3336FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3337 bsl::size_t capacity,
3338 const HASH& hash,
3339 const EQUAL& equal,
3340 bslma::Allocator *basicAllocator)
3341: d_impl(capacity, hash, equal, basicAllocator)
3342{
3343}
3344
3345template <class KEY, class VALUE, class HASH, class EQUAL>
3346template <class INPUT_ITERATOR>
3347inline
3348FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3349 INPUT_ITERATOR first,
3350 INPUT_ITERATOR last,
3351 bslma::Allocator *basicAllocator)
3352: d_impl(0, HASH(), EQUAL(), basicAllocator)
3353{
3354 insert(first, last);
3355}
3356
3357template <class KEY, class VALUE, class HASH, class EQUAL>
3358template <class INPUT_ITERATOR>
3359inline
3360FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3361 INPUT_ITERATOR first,
3362 INPUT_ITERATOR last,
3363 bsl::size_t capacity,
3364 bslma::Allocator *basicAllocator)
3365: d_impl(capacity, HASH(), EQUAL(), basicAllocator)
3366{
3367 insert(first, last);
3368}
3369
3370template <class KEY, class VALUE, class HASH, class EQUAL>
3371template <class INPUT_ITERATOR>
3372inline
3373FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3374 INPUT_ITERATOR first,
3375 INPUT_ITERATOR last,
3376 bsl::size_t capacity,
3377 const HASH& hash,
3378 bslma::Allocator *basicAllocator)
3379: d_impl(capacity, hash, EQUAL(), basicAllocator)
3380{
3381 insert(first, last);
3382}
3383
3384template <class KEY, class VALUE, class HASH, class EQUAL>
3385template <class INPUT_ITERATOR>
3386inline
3387FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3388 INPUT_ITERATOR first,
3389 INPUT_ITERATOR last,
3390 bsl::size_t capacity,
3391 const HASH& hash,
3392 const EQUAL& equal,
3393 bslma::Allocator *basicAllocator)
3394: d_impl(capacity, hash, equal, basicAllocator)
3395{
3396 insert(first, last);
3397}
3398
3399#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3400template <class KEY, class VALUE, class HASH, class EQUAL>
3401inline
3402FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3403 bsl::initializer_list<value_type> values,
3404 bslma::Allocator *basicAllocator)
3405: FlatHashMap(values.begin(),
3406 values.end(),
3407 0,
3408 HASH(),
3409 EQUAL(),
3410 basicAllocator)
3411{
3412}
3413
3414template <class KEY, class VALUE, class HASH, class EQUAL>
3415inline
3416FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3417 bsl::initializer_list<value_type> values,
3418 bsl::size_t capacity,
3419 bslma::Allocator *basicAllocator)
3420: FlatHashMap(values.begin(),
3421 values.end(),
3422 capacity,
3423 HASH(),
3424 EQUAL(),
3425 basicAllocator)
3426{
3427}
3428
3429template <class KEY, class VALUE, class HASH, class EQUAL>
3430inline
3431FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3432 bsl::initializer_list<value_type> values,
3433 bsl::size_t capacity,
3434 const HASH& hash,
3435 bslma::Allocator *basicAllocator)
3436: FlatHashMap(values.begin(),
3437 values.end(),
3438 capacity,
3439 hash,
3440 EQUAL(),
3441 basicAllocator)
3442{
3443}
3444
3445template <class KEY, class VALUE, class HASH, class EQUAL>
3446inline
3447FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3448 bsl::initializer_list<value_type> values,
3449 bsl::size_t capacity,
3450 const HASH& hash,
3451 const EQUAL& equal,
3452 bslma::Allocator *basicAllocator)
3453: FlatHashMap(values.begin(),
3454 values.end(),
3455 capacity,
3456 hash,
3457 equal,
3458 basicAllocator)
3459{
3460}
3461#endif
3462
3463template <class KEY, class VALUE, class HASH, class EQUAL>
3464inline
3465FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3466 const FlatHashMap& original,
3467 bslma::Allocator *basicAllocator)
3468: d_impl(original.d_impl, basicAllocator)
3469{
3470}
3471
3472template <class KEY, class VALUE, class HASH, class EQUAL>
3473inline
3474FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3476: d_impl(bslmf::MovableRefUtil::move(
3477 bslmf::MovableRefUtil::access(original).d_impl))
3478{
3479}
3480
3481template <class KEY, class VALUE, class HASH, class EQUAL>
3482inline
3483FlatHashMap<KEY, VALUE, HASH, EQUAL>::FlatHashMap(
3485 bslma::Allocator *basicAllocator)
3486: d_impl(bslmf::MovableRefUtil::move(
3487 bslmf::MovableRefUtil::access(original).d_impl),
3488 basicAllocator)
3489{
3490}
3491
3492template <class KEY, class VALUE, class HASH, class EQUAL>
3493inline
3494FlatHashMap<KEY, VALUE, HASH, EQUAL>::~FlatHashMap()
3495{
3496}
3497
3498// MANIPULATORS
3499template <class KEY, class VALUE, class HASH, class EQUAL>
3500inline
3501FlatHashMap<KEY, VALUE, HASH, EQUAL>&
3502FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(const FlatHashMap& rhs)
3503{
3504 d_impl = rhs.d_impl;
3505
3506 return *this;
3507}
3508
3509template <class KEY, class VALUE, class HASH, class EQUAL>
3510inline
3511FlatHashMap<KEY, VALUE, HASH, EQUAL>&
3512FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(
3514{
3515 FlatHashMap& lvalue = rhs;
3516
3517 d_impl = bslmf::MovableRefUtil::move(lvalue.d_impl);
3518
3519 return *this;
3520}
3521
3522#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3523template <class KEY, class VALUE, class HASH, class EQUAL>
3524inline
3525FlatHashMap<KEY, VALUE, HASH, EQUAL>&
3526FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator=(
3527 bsl::initializer_list<value_type> values)
3528{
3529 FlatHashMap tmp(values.begin(),
3530 values.end(),
3531 0,
3532 d_impl.hash_function(),
3533 d_impl.key_eq(),
3534 d_impl.allocator());
3535
3536 this->swap(tmp);
3537
3538 return *this;
3539}
3540#endif
3541
3542template <class KEY, class VALUE, class HASH, class EQUAL>
3543inline
3544VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator[](const KEY& key)
3545{
3546 return d_impl[key].second;
3547}
3548
3549template <class KEY, class VALUE, class HASH, class EQUAL>
3550inline
3551VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::operator[](bslmf::MovableRef<KEY> key)
3552{
3553 return d_impl[BSLS_COMPILERFEATURES_FORWARD(KEY, key)].second;
3554}
3555
3556template <class KEY, class VALUE, class HASH, class EQUAL>
3557inline
3558VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::at(const KEY& key)
3559{
3560 iterator node = d_impl.find(key);
3561
3562 if (node == d_impl.end()) {
3563 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
3564 "FlatHashMap<...>::at(key_type): invalid key value");
3565 }
3566
3567 return node->second;
3568}
3569
3570template <class KEY, class VALUE, class HASH, class EQUAL>
3571inline
3572void
3573FlatHashMap<KEY, VALUE, HASH, EQUAL>::clear()
3574{
3575 d_impl.clear();
3576}
3577
3578template <class KEY, class VALUE, class HASH, class EQUAL>
3580 typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator>
3581FlatHashMap<KEY, VALUE, HASH, EQUAL>::equal_range(const KEY& key)
3582{
3583 return d_impl.equal_range(key);
3584}
3585
3586#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3587// {{{ BEGIN GENERATED CODE
3588// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
3589#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
3590#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
3591#endif
3592#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_H
3593#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_H BDLC_FLATHASHMAP_VARIADIC_LIMIT
3594#endif
3595#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 0
3596template <class KEY, class VALUE, class HASH, class EQUAL>
3597inline
3599FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3600 )
3601{
3602 return d_impl.emplace();
3603}
3604#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 0
3605
3606#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 1
3607template <class KEY, class VALUE, class HASH, class EQUAL>
3608template <class ARGS_01>
3609inline
3611FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3612 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
3613{
3614 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01));
3615}
3616#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 1
3617
3618#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 2
3619template <class KEY, class VALUE, class HASH, class EQUAL>
3620template <class ARGS_01,
3621 class ARGS_02>
3622inline
3624FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3625 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3626 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
3627{
3628 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3629 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02));
3630}
3631#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 2
3632
3633#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 3
3634template <class KEY, class VALUE, class HASH, class EQUAL>
3635template <class ARGS_01,
3636 class ARGS_02,
3637 class ARGS_03>
3638inline
3640FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3641 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3642 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3643 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
3644{
3645 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3646 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3647 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03));
3648}
3649#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 3
3650
3651#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 4
3652template <class KEY, class VALUE, class HASH, class EQUAL>
3653template <class ARGS_01,
3654 class ARGS_02,
3655 class ARGS_03,
3656 class ARGS_04>
3657inline
3659FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3660 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3661 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3662 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3663 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3664{
3665 return d_impl.emplace(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}
3670#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 4
3671
3672#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 5
3673template <class KEY, class VALUE, class HASH, class EQUAL>
3674template <class ARGS_01,
3675 class ARGS_02,
3676 class ARGS_03,
3677 class ARGS_04,
3678 class ARGS_05>
3679inline
3681FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3682 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3683 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3684 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3685 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3686 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3687{
3688 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3689 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3690 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3691 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3692 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05));
3693}
3694#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 5
3695
3696#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 6
3697template <class KEY, class VALUE, class HASH, class EQUAL>
3698template <class ARGS_01,
3699 class ARGS_02,
3700 class ARGS_03,
3701 class ARGS_04,
3702 class ARGS_05,
3703 class ARGS_06>
3704inline
3706FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3707 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3708 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3709 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3710 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3711 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3712 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
3713{
3714 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3715 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3716 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3717 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3718 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3719 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06));
3720}
3721#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 6
3722
3723#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 7
3724template <class KEY, class VALUE, class HASH, class EQUAL>
3725template <class ARGS_01,
3726 class ARGS_02,
3727 class ARGS_03,
3728 class ARGS_04,
3729 class ARGS_05,
3730 class ARGS_06,
3731 class ARGS_07>
3732inline
3734FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3735 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3736 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3737 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3738 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3739 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3740 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3741 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
3742{
3743 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3744 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3745 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3746 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3747 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3748 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3749 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07));
3750}
3751#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 7
3752
3753#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 8
3754template <class KEY, class VALUE, class HASH, class EQUAL>
3755template <class ARGS_01,
3756 class ARGS_02,
3757 class ARGS_03,
3758 class ARGS_04,
3759 class ARGS_05,
3760 class ARGS_06,
3761 class ARGS_07,
3762 class ARGS_08>
3763inline
3765FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3766 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3767 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3768 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3769 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3770 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3771 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3772 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3773 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
3774{
3775 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3776 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3777 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3778 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3779 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3780 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3781 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3782 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08));
3783}
3784#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 8
3785
3786#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 9
3787template <class KEY, class VALUE, class HASH, class EQUAL>
3788template <class ARGS_01,
3789 class ARGS_02,
3790 class ARGS_03,
3791 class ARGS_04,
3792 class ARGS_05,
3793 class ARGS_06,
3794 class ARGS_07,
3795 class ARGS_08,
3796 class ARGS_09>
3797inline
3799FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3800 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3801 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3802 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3803 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3804 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3805 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3806 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3807 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3808 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
3809{
3810 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3811 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3812 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3813 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3814 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3815 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3816 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3817 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3818 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09));
3819}
3820#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 9
3821
3822#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 10
3823template <class KEY, class VALUE, class HASH, class EQUAL>
3824template <class ARGS_01,
3825 class ARGS_02,
3826 class ARGS_03,
3827 class ARGS_04,
3828 class ARGS_05,
3829 class ARGS_06,
3830 class ARGS_07,
3831 class ARGS_08,
3832 class ARGS_09,
3833 class ARGS_10>
3834inline
3836FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
3837 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3838 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3839 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3841 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3842 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
3843 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
3844 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
3845 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
3846 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
3847{
3848 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3849 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3850 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3851 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3852 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3853 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
3854 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
3855 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
3856 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
3857 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10));
3858}
3859#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 10
3860
3861
3862#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 0
3863template <class KEY, class VALUE, class HASH, class EQUAL>
3864inline
3865typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3866FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator)
3867{
3868 return emplace().first;
3869}
3870#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 0
3871
3872#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 1
3873template <class KEY, class VALUE, class HASH, class EQUAL>
3874template <class ARGS_01>
3875inline
3876typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3877FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3878 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
3879{
3880 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)).first;
3881}
3882#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 1
3883
3884#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 2
3885template <class KEY, class VALUE, class HASH, class EQUAL>
3886template <class ARGS_01,
3887 class ARGS_02>
3888inline
3889typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3890FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3891 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3892 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
3893{
3894 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3895 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)).first;
3896}
3897#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 2
3898
3899#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 3
3900template <class KEY, class VALUE, class HASH, class EQUAL>
3901template <class ARGS_01,
3902 class ARGS_02,
3903 class ARGS_03>
3904inline
3905typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3906FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3907 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3908 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3909 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
3910{
3911 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3912 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3913 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)).first;
3914}
3915#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 3
3916
3917#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 4
3918template <class KEY, class VALUE, class HASH, class EQUAL>
3919template <class ARGS_01,
3920 class ARGS_02,
3921 class ARGS_03,
3922 class ARGS_04>
3923inline
3924typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3925FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
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 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
3930{
3931 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3932 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3933 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3934 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)).first;
3935}
3936#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 4
3937
3938#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 5
3939template <class KEY, class VALUE, class HASH, class EQUAL>
3940template <class ARGS_01,
3941 class ARGS_02,
3942 class ARGS_03,
3943 class ARGS_04,
3944 class ARGS_05>
3945inline
3946typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3947FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3948 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3949 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3950 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3951 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3952 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
3953{
3954 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3955 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3956 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3957 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3958 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)).first;
3959}
3960#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 5
3961
3962#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 6
3963template <class KEY, class VALUE, class HASH, class EQUAL>
3964template <class ARGS_01,
3965 class ARGS_02,
3966 class ARGS_03,
3967 class ARGS_04,
3968 class ARGS_05,
3969 class ARGS_06>
3970inline
3971typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
3972FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
3973 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
3974 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
3975 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
3976 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
3977 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
3978 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
3979{
3980 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
3981 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
3982 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
3983 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
3984 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
3985 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)).first;
3986}
3987#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 6
3988
3989#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 7
3990template <class KEY, class VALUE, class HASH, class EQUAL>
3991template <class ARGS_01,
3992 class ARGS_02,
3993 class ARGS_03,
3994 class ARGS_04,
3995 class ARGS_05,
3996 class ARGS_06,
3997 class ARGS_07>
3998inline
3999typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4000FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
4001 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4002 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4003 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4004 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4005 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4006 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4007 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
4008{
4009 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4010 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4011 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4012 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4013 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4014 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4015 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)).first;
4016}
4017#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 7
4018
4019#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 8
4020template <class KEY, class VALUE, class HASH, class EQUAL>
4021template <class ARGS_01,
4022 class ARGS_02,
4023 class ARGS_03,
4024 class ARGS_04,
4025 class ARGS_05,
4026 class ARGS_06,
4027 class ARGS_07,
4028 class ARGS_08>
4029inline
4030typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4031FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
4032 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4033 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4034 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4035 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4036 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4037 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4038 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4039 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
4040{
4041 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4042 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4043 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4044 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4045 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4046 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4047 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4048 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)).first;
4049}
4050#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 8
4051
4052#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 9
4053template <class KEY, class VALUE, class HASH, class EQUAL>
4054template <class ARGS_01,
4055 class ARGS_02,
4056 class ARGS_03,
4057 class ARGS_04,
4058 class ARGS_05,
4059 class ARGS_06,
4060 class ARGS_07,
4061 class ARGS_08,
4062 class ARGS_09>
4063inline
4064typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4065FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
4066 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4067 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4068 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4069 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4070 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4071 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4072 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4073 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4074 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
4075{
4076 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4077 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4078 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4079 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4080 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4081 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4082 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4083 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4084 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)).first;
4085}
4086#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 9
4087
4088#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 10
4089template <class KEY, class VALUE, class HASH, class EQUAL>
4090template <class ARGS_01,
4091 class ARGS_02,
4092 class ARGS_03,
4093 class ARGS_04,
4094 class ARGS_05,
4095 class ARGS_06,
4096 class ARGS_07,
4097 class ARGS_08,
4098 class ARGS_09,
4099 class ARGS_10>
4100inline
4101typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4102FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
4103 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4104 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4105 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4106 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4107 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4108 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4109 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4110 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4111 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
4112 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
4113{
4114 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4115 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4116 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4117 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4118 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4119 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4120 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4121 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4122 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
4123 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)).first;
4124}
4125#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_H >= 10
4126
4127#else
4128// The generated code below is a workaround for the absence of perfect
4129// forwarding in some compilers.
4130template <class KEY, class VALUE, class HASH, class EQUAL>
4131template <class... ARGS>
4132inline
4134FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace(
4136{
4137 return d_impl.emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...);
4138}
4139
4140template <class KEY, class VALUE, class HASH, class EQUAL>
4141template <class... ARGS>
4142inline
4143typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4144FlatHashMap<KEY, VALUE, HASH, EQUAL>::emplace_hint(const_iterator,
4146{
4147 return emplace(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...).first;
4148}
4149// }}} END GENERATED CODE
4150#endif
4151
4152
4153template <class KEY, class VALUE, class HASH, class EQUAL>
4154bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const KEY& key)
4155{
4156 return d_impl.erase(key);
4157}
4158
4159template <class KEY, class VALUE, class HASH, class EQUAL>
4160inline
4161typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4162FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const_iterator position)
4163{
4164 BSLS_ASSERT_SAFE(position != end());
4165
4166 return d_impl.erase(position);
4167}
4168
4169template <class KEY, class VALUE, class HASH, class EQUAL>
4170inline
4171typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4172FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(iterator position)
4173{
4174 // Note that this overload is necessary to avoid ambiguity when the key is
4175 // an iterator.
4176
4177 BSLS_ASSERT_SAFE(position != end());
4178
4179 return d_impl.erase(position);
4180}
4181
4182template <class KEY, class VALUE, class HASH, class EQUAL>
4183typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4184FlatHashMap<KEY, VALUE, HASH, EQUAL>::erase(const_iterator first,
4185 const_iterator last)
4186{
4187 return d_impl.erase(first, last);
4188}
4189
4190template <class KEY, class VALUE, class HASH, class EQUAL>
4191inline
4192typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4193FlatHashMap<KEY, VALUE, HASH, EQUAL>::find(const KEY& key)
4194{
4195 return d_impl.find(key);
4196}
4197
4198template <class KEY, class VALUE, class HASH, class EQUAL>
4199template <class INPUT_ITERATOR>
4200void FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert(INPUT_ITERATOR first,
4201 INPUT_ITERATOR last)
4202{
4203 d_impl.insert(first, last);
4204}
4205
4206// {{{ BEGIN GENERATED CODE
4207// The generated code below is a workaround for the absence of perfect
4208// forwarding in some compilers.
4209template <class KEY, class VALUE, class HASH, class EQUAL>
4210template <class MAPPED>
4211inline
4213FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert_or_assign(const KEY& key,
4215{
4216 iterator iter = find(key);
4217 if (iter != end()) {
4218 iter->second = BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj);
4219 return make_pair(iter, false);
4220 }
4221 return emplace(key, BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj));
4222}
4223
4224template <class KEY, class VALUE, class HASH, class EQUAL>
4225template <class MAPPED>
4226inline
4228FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert_or_assign(
4229 BloombergLP::bslmf::MovableRef<KEY> key,
4231{
4232 const KEY& lvalue = key;
4233 iterator iter = find(lvalue);
4234 if (iter != end()) {
4235 iter->second = BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj);
4236 return make_pair(iter, false);
4237 }
4238 return emplace(bslmf::MovableRefUtil::move(lvalue),
4239 BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj));
4240}
4241
4242template <class KEY, class VALUE, class HASH, class EQUAL>
4243template <class MAPPED>
4244inline
4245typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4246FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert_or_assign(const_iterator,
4247 const KEY& key,
4249{
4250 return insert_or_assign(key,
4251 BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj)).first;
4252}
4253
4254template <class KEY, class VALUE, class HASH, class EQUAL>
4255template <class MAPPED>
4256inline
4257typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4258FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert_or_assign(
4259 const_iterator,
4260 BloombergLP::bslmf::MovableRef<KEY> key,
4262{
4263 const KEY& lvalue = key;
4264 return insert_or_assign(bslmf::MovableRefUtil::move(lvalue),
4265 BSLS_COMPILERFEATURES_FORWARD(MAPPED, obj)).first;
4266}
4267// }}} END GENERATED CODE
4268
4269#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4270template <class KEY, class VALUE, class HASH, class EQUAL>
4271void FlatHashMap<KEY, VALUE, HASH, EQUAL>::insert(
4272 bsl::initializer_list<value_type> values)
4273{
4274 insert(values.begin(), values.end());
4275}
4276#endif
4277
4278template <class KEY, class VALUE, class HASH, class EQUAL>
4279inline
4280void FlatHashMap<KEY, VALUE, HASH, EQUAL>::rehash(bsl::size_t minimumCapacity)
4281{
4282 d_impl.rehash(minimumCapacity);
4283}
4284
4285template <class KEY, class VALUE, class HASH, class EQUAL>
4286inline
4287void FlatHashMap<KEY, VALUE, HASH, EQUAL>::reserve(bsl::size_t numEntries)
4288{
4289 d_impl.reserve(numEntries);
4290}
4291
4292template <class KEY, class VALUE, class HASH, class EQUAL>
4293inline
4294void FlatHashMap<KEY, VALUE, HASH, EQUAL>::reset()
4295{
4296 d_impl.reset();
4297}
4298
4299#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
4300// {{{ BEGIN GENERATED CODE
4301// Command line: sim_cpp11_features.pl bdlc_flathashmap.h
4302#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT
4303#define BDLC_FLATHASHMAP_VARIADIC_LIMIT 10
4304#endif
4305#ifndef BDLC_FLATHASHMAP_VARIADIC_LIMIT_J
4306#define BDLC_FLATHASHMAP_VARIADIC_LIMIT_J BDLC_FLATHASHMAP_VARIADIC_LIMIT
4307#endif
4308#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
4309#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4310template <class KEY, class VALUE, class HASH, class EQUAL>
4311inline
4313FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key)
4314{
4315 return d_impl.try_emplace(
4316 key,
4317 std::piecewise_construct,
4318 std::forward_as_tuple(key),
4319 std::forward_as_tuple());
4320}
4321#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4322
4323#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4324template <class KEY, class VALUE, class HASH, class EQUAL>
4325template< class ARGS_01>
4326inline
4328FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4329 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
4330{
4331 return d_impl.try_emplace(
4332 key,
4333 std::piecewise_construct,
4334 std::forward_as_tuple(key),
4335 std::forward_as_tuple(
4336 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)));
4337}
4338#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4339
4340#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
4341template <class KEY, class VALUE, class HASH, class EQUAL>
4342template< class ARGS_01,
4343 class ARGS_02>
4344inline
4346FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4347 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4348 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
4349{
4350 return d_impl.try_emplace(
4351 key,
4352 std::piecewise_construct,
4353 std::forward_as_tuple(key),
4354 std::forward_as_tuple(
4355 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4356 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)));
4357}
4358#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
4359
4360#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
4361template <class KEY, class VALUE, class HASH, class EQUAL>
4362template< class ARGS_01,
4363 class ARGS_02,
4364 class ARGS_03>
4365inline
4367FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4368 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4369 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4370 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
4371{
4372 return d_impl.try_emplace(
4373 key,
4374 std::piecewise_construct,
4375 std::forward_as_tuple(key),
4376 std::forward_as_tuple(
4377 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4378 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4379 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)));
4380}
4381#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
4382
4383#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
4384template <class KEY, class VALUE, class HASH, class EQUAL>
4385template< class ARGS_01,
4386 class ARGS_02,
4387 class ARGS_03,
4388 class ARGS_04>
4389inline
4391FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4392 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4393 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4394 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4395 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
4396{
4397 return d_impl.try_emplace(
4398 key,
4399 std::piecewise_construct,
4400 std::forward_as_tuple(key),
4401 std::forward_as_tuple(
4402 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4403 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4404 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4405 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)));
4406}
4407#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
4408
4409#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
4410template <class KEY, class VALUE, class HASH, class EQUAL>
4411template< class ARGS_01,
4412 class ARGS_02,
4413 class ARGS_03,
4414 class ARGS_04,
4415 class ARGS_05>
4416inline
4418FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4419 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4420 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4421 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4422 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4423 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
4424{
4425 return d_impl.try_emplace(
4426 key,
4427 std::piecewise_construct,
4428 std::forward_as_tuple(key),
4429 std::forward_as_tuple(
4430 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4431 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4432 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4433 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4434 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)));
4435}
4436#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
4437
4438#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
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>
4446inline
4448FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4449 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4450 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4451 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4452 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4453 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4454 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
4455{
4456 return d_impl.try_emplace(
4457 key,
4458 std::piecewise_construct,
4459 std::forward_as_tuple(key),
4460 std::forward_as_tuple(
4461 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4462 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4463 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4464 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4465 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4466 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)));
4467}
4468#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
4469
4470#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
4471template <class KEY, class VALUE, class HASH, class EQUAL>
4472template< class ARGS_01,
4473 class ARGS_02,
4474 class ARGS_03,
4475 class ARGS_04,
4476 class ARGS_05,
4477 class ARGS_06,
4478 class ARGS_07>
4479inline
4481FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4482 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4483 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4484 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4485 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4486 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4487 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4488 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
4489{
4490 return d_impl.try_emplace(
4491 key,
4492 std::piecewise_construct,
4493 std::forward_as_tuple(key),
4494 std::forward_as_tuple(
4495 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4496 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4497 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4498 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4499 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4500 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4501 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)));
4502}
4503#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
4504
4505#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
4506template <class KEY, class VALUE, class HASH, class EQUAL>
4507template< class ARGS_01,
4508 class ARGS_02,
4509 class ARGS_03,
4510 class ARGS_04,
4511 class ARGS_05,
4512 class ARGS_06,
4513 class ARGS_07,
4514 class ARGS_08>
4515inline
4517FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4518 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4519 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4520 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4521 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4522 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4523 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4524 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4525 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
4526{
4527 return d_impl.try_emplace(
4528 key,
4529 std::piecewise_construct,
4530 std::forward_as_tuple(key),
4531 std::forward_as_tuple(
4532 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4533 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4534 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4535 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4536 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4537 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4538 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4539 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)));
4540}
4541#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
4542
4543#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
4544template <class KEY, class VALUE, class HASH, class EQUAL>
4545template< class ARGS_01,
4546 class ARGS_02,
4547 class ARGS_03,
4548 class ARGS_04,
4549 class ARGS_05,
4550 class ARGS_06,
4551 class ARGS_07,
4552 class ARGS_08,
4553 class ARGS_09>
4554inline
4556FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4557 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4558 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4559 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4560 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4561 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4562 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4563 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4564 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4565 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
4566{
4567 return d_impl.try_emplace(
4568 key,
4569 std::piecewise_construct,
4570 std::forward_as_tuple(key),
4571 std::forward_as_tuple(
4572 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4573 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4574 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4575 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4576 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4577 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4578 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4579 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4580 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)));
4581}
4582#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
4583
4584#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
4585template <class KEY, class VALUE, class HASH, class EQUAL>
4586template< class ARGS_01,
4587 class ARGS_02,
4588 class ARGS_03,
4589 class ARGS_04,
4590 class ARGS_05,
4591 class ARGS_06,
4592 class ARGS_07,
4593 class ARGS_08,
4594 class ARGS_09,
4595 class ARGS_10>
4596inline
4598FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
4599 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4600 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4601 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4602 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4603 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4604 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4605 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4606 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4607 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
4608 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
4609{
4610 return d_impl.try_emplace(
4611 key,
4612 std::piecewise_construct,
4613 std::forward_as_tuple(key),
4614 std::forward_as_tuple(
4615 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4616 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4617 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4618 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4619 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4620 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4621 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4622 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4623 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
4624 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)));
4625}
4626#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
4627
4628
4629#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4630template <class KEY, class VALUE, class HASH, class EQUAL>
4632FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4633 BloombergLP::bslmf::MovableRef<KEY> key)
4634{
4635 return d_impl.try_emplace(
4637 std::piecewise_construct,
4638 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4639 std::forward_as_tuple());
4640}
4641#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4642
4643#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4644template <class KEY, class VALUE, class HASH, class EQUAL>
4645template <class ARGS_01>
4647FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4648 BloombergLP::bslmf::MovableRef<KEY> key,
4649 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
4650{
4651 return d_impl.try_emplace(
4653 std::piecewise_construct,
4654 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4655 std::forward_as_tuple(
4656 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)));
4657}
4658#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4659
4660#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
4661template <class KEY, class VALUE, class HASH, class EQUAL>
4662template <class ARGS_01,
4663 class ARGS_02>
4665FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4666 BloombergLP::bslmf::MovableRef<KEY> key,
4667 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4668 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
4669{
4670 return d_impl.try_emplace(
4672 std::piecewise_construct,
4673 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4674 std::forward_as_tuple(
4675 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4676 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)));
4677}
4678#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
4679
4680#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
4681template <class KEY, class VALUE, class HASH, class EQUAL>
4682template <class ARGS_01,
4683 class ARGS_02,
4684 class ARGS_03>
4686FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4687 BloombergLP::bslmf::MovableRef<KEY> key,
4688 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4689 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4690 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
4691{
4692 return d_impl.try_emplace(
4694 std::piecewise_construct,
4695 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4696 std::forward_as_tuple(
4697 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4698 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4699 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)));
4700}
4701#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
4702
4703#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
4704template <class KEY, class VALUE, class HASH, class EQUAL>
4705template <class ARGS_01,
4706 class ARGS_02,
4707 class ARGS_03,
4708 class ARGS_04>
4710FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4711 BloombergLP::bslmf::MovableRef<KEY> key,
4712 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4713 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4714 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4715 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
4716{
4717 return d_impl.try_emplace(
4719 std::piecewise_construct,
4720 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4721 std::forward_as_tuple(
4722 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4723 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4724 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4725 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)));
4726}
4727#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
4728
4729#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
4730template <class KEY, class VALUE, class HASH, class EQUAL>
4731template <class ARGS_01,
4732 class ARGS_02,
4733 class ARGS_03,
4734 class ARGS_04,
4735 class ARGS_05>
4737FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4738 BloombergLP::bslmf::MovableRef<KEY> key,
4739 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4740 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4741 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4742 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4743 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
4744{
4745 return d_impl.try_emplace(
4747 std::piecewise_construct,
4748 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4749 std::forward_as_tuple(
4750 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4751 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4752 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4753 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4754 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)));
4755}
4756#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
4757
4758#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
4759template <class KEY, class VALUE, class HASH, class EQUAL>
4760template <class ARGS_01,
4761 class ARGS_02,
4762 class ARGS_03,
4763 class ARGS_04,
4764 class ARGS_05,
4765 class ARGS_06>
4767FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4768 BloombergLP::bslmf::MovableRef<KEY> key,
4769 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4770 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4771 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4772 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4773 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4774 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
4775{
4776 return d_impl.try_emplace(
4778 std::piecewise_construct,
4779 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4780 std::forward_as_tuple(
4781 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4782 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4783 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4784 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4785 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4786 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)));
4787}
4788#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
4789
4790#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
4791template <class KEY, class VALUE, class HASH, class EQUAL>
4792template <class ARGS_01,
4793 class ARGS_02,
4794 class ARGS_03,
4795 class ARGS_04,
4796 class ARGS_05,
4797 class ARGS_06,
4798 class ARGS_07>
4800FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4801 BloombergLP::bslmf::MovableRef<KEY> key,
4802 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4803 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4804 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4805 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4806 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4807 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4808 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
4809{
4810 return d_impl.try_emplace(
4812 std::piecewise_construct,
4813 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4814 std::forward_as_tuple(
4815 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4816 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4817 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4818 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4819 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4820 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4821 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)));
4822}
4823#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
4824
4825#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
4826template <class KEY, class VALUE, class HASH, class EQUAL>
4827template <class ARGS_01,
4828 class ARGS_02,
4829 class ARGS_03,
4830 class ARGS_04,
4831 class ARGS_05,
4832 class ARGS_06,
4833 class ARGS_07,
4834 class ARGS_08>
4836FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4837 BloombergLP::bslmf::MovableRef<KEY> key,
4838 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4839 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4840 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4841 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4842 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4843 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4844 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4845 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
4846{
4847 return d_impl.try_emplace(
4849 std::piecewise_construct,
4850 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4851 std::forward_as_tuple(
4852 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4853 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4854 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4855 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4856 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4857 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4858 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4859 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)));
4860}
4861#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
4862
4863#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
4864template <class KEY, class VALUE, class HASH, class EQUAL>
4865template <class ARGS_01,
4866 class ARGS_02,
4867 class ARGS_03,
4868 class ARGS_04,
4869 class ARGS_05,
4870 class ARGS_06,
4871 class ARGS_07,
4872 class ARGS_08,
4873 class ARGS_09>
4875FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4876 BloombergLP::bslmf::MovableRef<KEY> key,
4877 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4878 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4879 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4880 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4881 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4882 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4883 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4884 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4885 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
4886{
4887 return d_impl.try_emplace(
4889 std::piecewise_construct,
4890 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4891 std::forward_as_tuple(
4892 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4893 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4894 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4895 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4896 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4897 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4898 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4899 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4900 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)));
4901}
4902#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
4903
4904#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
4905template <class KEY, class VALUE, class HASH, class EQUAL>
4906template <class ARGS_01,
4907 class ARGS_02,
4908 class ARGS_03,
4909 class ARGS_04,
4910 class ARGS_05,
4911 class ARGS_06,
4912 class ARGS_07,
4913 class ARGS_08,
4914 class ARGS_09,
4915 class ARGS_10>
4917FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
4918 BloombergLP::bslmf::MovableRef<KEY> key,
4919 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4920 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
4921 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
4922 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
4923 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
4924 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
4925 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
4926 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
4927 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
4928 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
4929{
4930 return d_impl.try_emplace(
4932 std::piecewise_construct,
4933 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
4934 std::forward_as_tuple(
4935 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4936 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
4937 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
4938 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
4939 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
4940 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
4941 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
4942 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
4943 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
4944 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)));
4945}
4946#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
4947
4948
4949#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4950template <class KEY, class VALUE, class HASH, class EQUAL>
4951typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4952FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4953 const KEY& key)
4954{
4955 return d_impl.try_emplace(
4956 key,
4957 std::piecewise_construct,
4958 std::forward_as_tuple(key),
4959 std::forward_as_tuple())
4960 .first;
4961}
4962#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
4963
4964#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4965template <class KEY, class VALUE, class HASH, class EQUAL>
4966template<class ARGS_01>
4967typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4968FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4969 const KEY& key,
4970 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
4971{
4972 return d_impl.try_emplace(
4973 key,
4974 std::piecewise_construct,
4975 std::forward_as_tuple(key),
4976 std::forward_as_tuple(
4977 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)))
4978 .first;
4979}
4980#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
4981
4982#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
4983template <class KEY, class VALUE, class HASH, class EQUAL>
4984template<class ARGS_01,
4985 class ARGS_02>
4986typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
4987FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
4988 const KEY& key,
4989 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
4990 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
4991{
4992 return d_impl.try_emplace(
4993 key,
4994 std::piecewise_construct,
4995 std::forward_as_tuple(key),
4996 std::forward_as_tuple(
4997 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
4998 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)))
4999 .first;
5000}
5001#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
5002
5003#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
5004template <class KEY, class VALUE, class HASH, class EQUAL>
5005template<class ARGS_01,
5006 class ARGS_02,
5007 class ARGS_03>
5008typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5009FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5010 const KEY& key,
5011 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5012 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5013 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
5014{
5015 return d_impl.try_emplace(
5016 key,
5017 std::piecewise_construct,
5018 std::forward_as_tuple(key),
5019 std::forward_as_tuple(
5020 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5021 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5022 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)))
5023 .first;
5024}
5025#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
5026
5027#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
5028template <class KEY, class VALUE, class HASH, class EQUAL>
5029template<class ARGS_01,
5030 class ARGS_02,
5031 class ARGS_03,
5032 class ARGS_04>
5033typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5034FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5035 const KEY& key,
5036 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5037 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5038 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5039 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
5040{
5041 return d_impl.try_emplace(
5042 key,
5043 std::piecewise_construct,
5044 std::forward_as_tuple(key),
5045 std::forward_as_tuple(
5046 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5047 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5048 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5049 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)))
5050 .first;
5051}
5052#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
5053
5054#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
5055template <class KEY, class VALUE, class HASH, class EQUAL>
5056template<class ARGS_01,
5057 class ARGS_02,
5058 class ARGS_03,
5059 class ARGS_04,
5060 class ARGS_05>
5061typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5062FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5063 const KEY& key,
5064 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5065 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5066 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5067 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5068 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
5069{
5070 return d_impl.try_emplace(
5071 key,
5072 std::piecewise_construct,
5073 std::forward_as_tuple(key),
5074 std::forward_as_tuple(
5075 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5076 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5077 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5078 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5079 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)))
5080 .first;
5081}
5082#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
5083
5084#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
5085template <class KEY, class VALUE, class HASH, class EQUAL>
5086template<class ARGS_01,
5087 class ARGS_02,
5088 class ARGS_03,
5089 class ARGS_04,
5090 class ARGS_05,
5091 class ARGS_06>
5092typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5093FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5094 const KEY& key,
5095 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5096 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5097 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5098 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5099 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5100 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
5101{
5102 return d_impl.try_emplace(
5103 key,
5104 std::piecewise_construct,
5105 std::forward_as_tuple(key),
5106 std::forward_as_tuple(
5107 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5108 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5109 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5110 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5111 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5112 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)))
5113 .first;
5114}
5115#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
5116
5117#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
5118template <class KEY, class VALUE, class HASH, class EQUAL>
5119template<class ARGS_01,
5120 class ARGS_02,
5121 class ARGS_03,
5122 class ARGS_04,
5123 class ARGS_05,
5124 class ARGS_06,
5125 class ARGS_07>
5126typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5127FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5128 const KEY& key,
5129 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5130 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5131 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5132 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5133 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5134 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5135 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
5136{
5137 return d_impl.try_emplace(
5138 key,
5139 std::piecewise_construct,
5140 std::forward_as_tuple(key),
5141 std::forward_as_tuple(
5142 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5143 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5144 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5145 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5146 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5147 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5148 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)))
5149 .first;
5150}
5151#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
5152
5153#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
5154template <class KEY, class VALUE, class HASH, class EQUAL>
5155template<class ARGS_01,
5156 class ARGS_02,
5157 class ARGS_03,
5158 class ARGS_04,
5159 class ARGS_05,
5160 class ARGS_06,
5161 class ARGS_07,
5162 class ARGS_08>
5163typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5164FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5165 const KEY& key,
5166 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5167 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5168 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5169 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5170 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5171 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5172 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5173 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
5174{
5175 return d_impl.try_emplace(
5176 key,
5177 std::piecewise_construct,
5178 std::forward_as_tuple(key),
5179 std::forward_as_tuple(
5180 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5181 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5182 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5183 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5184 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5185 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5186 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5187 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)))
5188 .first;
5189}
5190#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
5191
5192#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
5193template <class KEY, class VALUE, class HASH, class EQUAL>
5194template<class ARGS_01,
5195 class ARGS_02,
5196 class ARGS_03,
5197 class ARGS_04,
5198 class ARGS_05,
5199 class ARGS_06,
5200 class ARGS_07,
5201 class ARGS_08,
5202 class ARGS_09>
5203typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5204FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5205 const KEY& key,
5206 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5207 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5208 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5209 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5210 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5211 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5212 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5213 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
5214 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
5215{
5216 return d_impl.try_emplace(
5217 key,
5218 std::piecewise_construct,
5219 std::forward_as_tuple(key),
5220 std::forward_as_tuple(
5221 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5222 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5223 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5224 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5225 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5226 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5227 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5228 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
5229 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)))
5230 .first;
5231}
5232#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
5233
5234#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
5235template <class KEY, class VALUE, class HASH, class EQUAL>
5236template<class ARGS_01,
5237 class ARGS_02,
5238 class ARGS_03,
5239 class ARGS_04,
5240 class ARGS_05,
5241 class ARGS_06,
5242 class ARGS_07,
5243 class ARGS_08,
5244 class ARGS_09,
5245 class ARGS_10>
5246typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5247FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5248 const KEY& key,
5249 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5250 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5251 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5252 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5253 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5254 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5255 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5256 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
5257 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
5258 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
5259{
5260 return d_impl.try_emplace(
5261 key,
5262 std::piecewise_construct,
5263 std::forward_as_tuple(key),
5264 std::forward_as_tuple(
5265 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5266 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5267 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5268 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5269 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5270 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5271 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5272 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
5273 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
5274 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)))
5275 .first;
5276}
5277#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
5278
5279
5280#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
5281template <class KEY, class VALUE, class HASH, class EQUAL>
5282typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5283FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5284 BloombergLP::bslmf::MovableRef<KEY> key)
5285{
5286 return d_impl.try_emplace(
5288 std::piecewise_construct,
5289 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5290 std::forward_as_tuple())
5291 .first;
5292}
5293#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 0
5294
5295#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
5296template <class KEY, class VALUE, class HASH, class EQUAL>
5297template <class ARGS_01>
5298typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5299FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5300 BloombergLP::bslmf::MovableRef<KEY> key,
5301 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01)
5302{
5303 return d_impl.try_emplace(
5305 std::piecewise_construct,
5306 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5307 std::forward_as_tuple(
5308 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)))
5309 .first;
5310}
5311#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 1
5312
5313#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
5314template <class KEY, class VALUE, class HASH, class EQUAL>
5315template <class ARGS_01,
5316 class ARGS_02>
5317typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5318FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5319 BloombergLP::bslmf::MovableRef<KEY> key,
5320 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5321 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02)
5322{
5323 return d_impl.try_emplace(
5325 std::piecewise_construct,
5326 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5327 std::forward_as_tuple(
5328 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5329 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)))
5330 .first;
5331}
5332#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 2
5333
5334#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
5335template <class KEY, class VALUE, class HASH, class EQUAL>
5336template <class ARGS_01,
5337 class ARGS_02,
5338 class ARGS_03>
5339typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5340FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5341 BloombergLP::bslmf::MovableRef<KEY> key,
5342 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5343 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5344 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03)
5345{
5346 return d_impl.try_emplace(
5348 std::piecewise_construct,
5349 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5350 std::forward_as_tuple(
5351 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5352 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5353 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)))
5354 .first;
5355}
5356#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 3
5357
5358#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
5359template <class KEY, class VALUE, class HASH, class EQUAL>
5360template <class ARGS_01,
5361 class ARGS_02,
5362 class ARGS_03,
5363 class ARGS_04>
5364typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5365FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5366 BloombergLP::bslmf::MovableRef<KEY> key,
5367 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5368 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5369 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5370 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04)
5371{
5372 return d_impl.try_emplace(
5374 std::piecewise_construct,
5375 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5376 std::forward_as_tuple(
5377 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5378 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5379 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5380 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)))
5381 .first;
5382}
5383#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 4
5384
5385#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
5386template <class KEY, class VALUE, class HASH, class EQUAL>
5387template <class ARGS_01,
5388 class ARGS_02,
5389 class ARGS_03,
5390 class ARGS_04,
5391 class ARGS_05>
5392typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5393FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5394 BloombergLP::bslmf::MovableRef<KEY> key,
5395 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5396 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5397 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5398 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5399 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05)
5400{
5401 return d_impl.try_emplace(
5403 std::piecewise_construct,
5404 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5405 std::forward_as_tuple(
5406 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5407 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5408 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5409 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5410 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)))
5411 .first;
5412}
5413#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 5
5414
5415#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
5416template <class KEY, class VALUE, class HASH, class EQUAL>
5417template <class ARGS_01,
5418 class ARGS_02,
5419 class ARGS_03,
5420 class ARGS_04,
5421 class ARGS_05,
5422 class ARGS_06>
5423typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5424FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5425 BloombergLP::bslmf::MovableRef<KEY> key,
5426 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5427 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5428 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5429 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5430 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5431 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06)
5432{
5433 return d_impl.try_emplace(
5435 std::piecewise_construct,
5436 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5437 std::forward_as_tuple(
5438 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5439 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5440 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5441 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5442 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5443 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)))
5444 .first;
5445}
5446#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 6
5447
5448#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
5449template <class KEY, class VALUE, class HASH, class EQUAL>
5450template <class ARGS_01,
5451 class ARGS_02,
5452 class ARGS_03,
5453 class ARGS_04,
5454 class ARGS_05,
5455 class ARGS_06,
5456 class ARGS_07>
5457typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5458FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5459 BloombergLP::bslmf::MovableRef<KEY> key,
5460 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5461 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5462 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5463 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5464 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5465 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5466 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07)
5467{
5468 return d_impl.try_emplace(
5470 std::piecewise_construct,
5471 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5472 std::forward_as_tuple(
5473 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5474 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5475 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5476 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5477 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5478 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5479 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)))
5480 .first;
5481}
5482#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 7
5483
5484#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
5485template <class KEY, class VALUE, class HASH, class EQUAL>
5486template <class ARGS_01,
5487 class ARGS_02,
5488 class ARGS_03,
5489 class ARGS_04,
5490 class ARGS_05,
5491 class ARGS_06,
5492 class ARGS_07,
5493 class ARGS_08>
5494typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5495FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5496 BloombergLP::bslmf::MovableRef<KEY> key,
5497 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5498 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5499 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5500 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5501 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5502 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5503 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5504 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08)
5505{
5506 return d_impl.try_emplace(
5508 std::piecewise_construct,
5509 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5510 std::forward_as_tuple(
5511 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5512 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5513 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5514 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5515 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5516 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5517 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5518 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)))
5519 .first;
5520}
5521#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 8
5522
5523#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
5524template <class KEY, class VALUE, class HASH, class EQUAL>
5525template <class ARGS_01,
5526 class ARGS_02,
5527 class ARGS_03,
5528 class ARGS_04,
5529 class ARGS_05,
5530 class ARGS_06,
5531 class ARGS_07,
5532 class ARGS_08,
5533 class ARGS_09>
5534typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5535FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5536 BloombergLP::bslmf::MovableRef<KEY> key,
5537 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5538 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5539 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5540 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5541 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5542 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5543 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5544 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
5545 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09)
5546{
5547 return d_impl.try_emplace(
5549 std::piecewise_construct,
5550 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5551 std::forward_as_tuple(
5552 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5553 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5554 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5555 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5556 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5557 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5558 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5559 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
5560 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)))
5561 .first;
5562}
5563#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 9
5564
5565#if BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
5566template <class KEY, class VALUE, class HASH, class EQUAL>
5567template <class ARGS_01,
5568 class ARGS_02,
5569 class ARGS_03,
5570 class ARGS_04,
5571 class ARGS_05,
5572 class ARGS_06,
5573 class ARGS_07,
5574 class ARGS_08,
5575 class ARGS_09,
5576 class ARGS_10>
5577typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5578FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5579 BloombergLP::bslmf::MovableRef<KEY> key,
5580 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01,
5581 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02,
5582 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03,
5583 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04,
5584 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05,
5585 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06,
5586 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07,
5587 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08,
5588 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09,
5589 BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10)
5590{
5591 return d_impl.try_emplace(
5593 std::piecewise_construct,
5594 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5595 std::forward_as_tuple(
5596 BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01),
5597 BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02),
5598 BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03),
5599 BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04),
5600 BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05),
5601 BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06),
5602 BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07),
5603 BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08),
5604 BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09),
5605 BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)))
5606 .first;
5607}
5608#endif // BDLC_FLATHASHMAP_VARIADIC_LIMIT_J >= 10
5609
5610#endif
5611#else
5612// The generated code below is a workaround for the absence of perfect
5613// forwarding in some compilers.
5614#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
5615template <class KEY, class VALUE, class HASH, class EQUAL>
5616template< class... ARGS>
5617inline
5619FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const KEY& key,
5621{
5622 return d_impl.try_emplace(
5623 key,
5624 std::piecewise_construct,
5625 std::forward_as_tuple(key),
5626 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...));
5627}
5628
5629template <class KEY, class VALUE, class HASH, class EQUAL>
5630template <class... ARGS>
5632FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(
5633 BloombergLP::bslmf::MovableRef<KEY> key,
5635{
5636 return d_impl.try_emplace(
5638 std::piecewise_construct,
5639 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5640 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...));
5641}
5642
5643template <class KEY, class VALUE, class HASH, class EQUAL>
5644template<class... ARGS>
5645typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5646FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5647 const KEY& key,
5649{
5650 return d_impl.try_emplace(
5651 key,
5652 std::piecewise_construct,
5653 std::forward_as_tuple(key),
5654 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...))
5655 .first;
5656}
5657
5658template <class KEY, class VALUE, class HASH, class EQUAL>
5659template <class... ARGS>
5660typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5661FlatHashMap<KEY, VALUE, HASH, EQUAL>::try_emplace(const_iterator,
5662 BloombergLP::bslmf::MovableRef<KEY> key,
5664{
5665 return d_impl.try_emplace(
5667 std::piecewise_construct,
5668 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(KEY, key)),
5669 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...))
5670 .first;
5671}
5672#endif
5673// }}} END GENERATED CODE
5674#endif
5675
5676 // Iterators
5677
5678template <class KEY, class VALUE, class HASH, class EQUAL>
5679inline
5680typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5681 FlatHashMap<KEY, VALUE, HASH, EQUAL>::begin()
5682{
5683 return d_impl.begin();
5684}
5685
5686template <class KEY, class VALUE, class HASH, class EQUAL>
5687inline
5688typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
5689 FlatHashMap<KEY, VALUE, HASH, EQUAL>::end()
5690{
5691 return d_impl.end();
5692}
5693
5694 // Aspects
5695
5696template <class KEY, class VALUE, class HASH, class EQUAL>
5697inline
5698void FlatHashMap<KEY, VALUE, HASH, EQUAL>::swap(FlatHashMap& other)
5699{
5700 BSLS_ASSERT_SAFE(allocator() == other.allocator());
5701
5702 d_impl.swap(other.d_impl);
5703}
5704
5705// ACCESSORS
5706template <class KEY, class VALUE, class HASH, class EQUAL>
5707inline
5708const VALUE& FlatHashMap<KEY, VALUE, HASH, EQUAL>::at(const KEY& key) const
5709{
5710 const_iterator node = d_impl.find(key);
5711
5712 if (node == d_impl.end()) {
5713 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
5714 "FlatHashMap<...>::at(key_type) const: invalid key value");
5715 }
5716
5717 return node->second;
5718}
5719
5720template <class KEY, class VALUE, class HASH, class EQUAL>
5721inline
5722bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::capacity() const
5723{
5724 return d_impl.capacity();
5725}
5726
5727template <class KEY, class VALUE, class HASH, class EQUAL>
5728inline
5729bool FlatHashMap<KEY, VALUE, HASH, EQUAL>::contains(const KEY& key) const
5730{
5731 return d_impl.contains(key);
5732}
5733
5734template <class KEY, class VALUE, class HASH, class EQUAL>
5735inline
5736bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::count(const KEY& key) const
5737{
5738 return d_impl.count(key);
5739}
5740
5741template <class KEY, class VALUE, class HASH, class EQUAL>
5742inline
5743bool FlatHashMap<KEY, VALUE, HASH, EQUAL>::empty() const
5744{
5745 return d_impl.empty();
5746}
5747
5748template <class KEY, class VALUE, class HASH, class EQUAL>
5750 typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator>
5751FlatHashMap<KEY, VALUE, HASH, EQUAL>::equal_range(const KEY& key) const
5752{
5753 return d_impl.equal_range(key);
5754}
5755
5756template <class KEY, class VALUE, class HASH, class EQUAL>
5757inline
5758typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
5759FlatHashMap<KEY, VALUE, HASH, EQUAL>::find(const KEY& key) const
5760{
5761 return d_impl.find(key);
5762}
5763
5764template <class KEY, class VALUE, class HASH, class EQUAL>
5765inline
5766HASH FlatHashMap<KEY, VALUE, HASH, EQUAL>::hash_function() const
5767{
5768 return d_impl.hash_function();
5769}
5770
5771template <class KEY, class VALUE, class HASH, class EQUAL>
5772inline
5773EQUAL FlatHashMap<KEY, VALUE, HASH, EQUAL>::key_eq() const
5774{
5775 return d_impl.key_eq();
5776}
5777
5778template <class KEY, class VALUE, class HASH, class EQUAL>
5779inline
5780float FlatHashMap<KEY, VALUE, HASH, EQUAL>::load_factor() const
5781{
5782 return d_impl.load_factor();
5783}
5784
5785template <class KEY, class VALUE, class HASH, class EQUAL>
5786inline
5787float FlatHashMap<KEY, VALUE, HASH, EQUAL>::max_load_factor() const
5788{
5789 return d_impl.max_load_factor();
5790}
5791
5792template <class KEY, class VALUE, class HASH, class EQUAL>
5793inline
5794bsl::size_t FlatHashMap<KEY, VALUE, HASH, EQUAL>::size() const
5795{
5796 return d_impl.size();
5797}
5798
5799 // Iterators
5800
5801template <class KEY, class VALUE, class HASH, class EQUAL>
5802inline
5803typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
5804 FlatHashMap<KEY, VALUE, HASH, EQUAL>::begin() const
5805{
5806 return d_impl.begin();
5807}
5808template <class KEY, class VALUE, class HASH, class EQUAL>
5809inline
5810typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
5811 FlatHashMap<KEY, VALUE, HASH, EQUAL>::cbegin() const
5812{
5813 return d_impl.cbegin();
5814}
5815
5816template <class KEY, class VALUE, class HASH, class EQUAL>
5817inline
5818typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
5819 FlatHashMap<KEY, VALUE, HASH, EQUAL>::cend() const
5820{
5821 return d_impl.cend();
5822}
5823
5824template <class KEY, class VALUE, class HASH, class EQUAL>
5825inline
5826typename FlatHashMap<KEY, VALUE, HASH, EQUAL>::const_iterator
5827 FlatHashMap<KEY, VALUE, HASH, EQUAL>::end() const
5828{
5829 return d_impl.end();
5830}
5831
5832 // Aspects
5833
5834template <class KEY, class VALUE, class HASH, class EQUAL>
5835inline
5836bslma::Allocator *FlatHashMap<KEY, VALUE, HASH, EQUAL>::allocator() const
5837{
5838 return d_impl.allocator();
5839}
5840
5841template <class KEY, class VALUE, class HASH, class EQUAL>
5842bsl::ostream& FlatHashMap<KEY, VALUE, HASH, EQUAL>::print(
5843 bsl::ostream& stream,
5844 int level,
5845 int spacesPerLevel) const
5846{
5847 if (stream.bad()) {
5848 return stream; // RETURN
5849 }
5850
5851 bslim::Printer printer(&stream, level, spacesPerLevel);
5852
5853 printer.start();
5854
5855 const_iterator iter = begin();
5856 while (iter != end()) {
5857 printer.printValue(*iter);
5858 ++iter;
5859 }
5860
5861 printer.end();
5862
5863 return stream;
5864}
5865
5866} // close package namespace
5867
5868// FREE OPERATORS
5869template <class KEY, class VALUE, class HASH, class EQUAL>
5870inline
5871bool bdlc::operator==(const FlatHashMap<KEY, VALUE, HASH, EQUAL>& lhs,
5872 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& rhs)
5873{
5874 return lhs.d_impl == rhs.d_impl;
5875}
5876
5877template <class KEY, class VALUE, class HASH, class EQUAL>
5878inline
5879bool bdlc::operator!=(const FlatHashMap<KEY, VALUE, HASH, EQUAL>& lhs,
5880 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& rhs)
5881{
5882 return lhs.d_impl != rhs.d_impl;
5883}
5884
5885template <class KEY, class VALUE, class HASH, class EQUAL>
5886inline
5887bsl::ostream& bdlc::operator<<(
5888 bsl::ostream& stream,
5889 const FlatHashMap<KEY, VALUE, HASH, EQUAL>& map)
5890{
5891 return map.print(stream, 0, -1);
5892}
5893
5894// FREE FUNCTIONS
5895template <class KEY, class VALUE, class HASH, class EQUAL>
5896inline
5897void bdlc::swap(FlatHashMap<KEY, VALUE, HASH, EQUAL>& a,
5898 FlatHashMap<KEY, VALUE, HASH, EQUAL>& b)
5899{
5900 bslalg::SwapUtil::swap(&a.d_impl, &b.d_impl);
5901}
5902
5903// ============================================================================
5904// TYPE TRAITS
5905// ============================================================================
5906
5907namespace bslalg {
5908
5909template <class KEY, class VALUE, class HASH, class EQUAL>
5910struct HasStlIterators<bdlc::FlatHashMap<KEY, VALUE, HASH, EQUAL> >
5912};
5913
5914} // close namespace bslalg
5915
5916namespace bslma {
5917
5918template <class KEY, class VALUE, class HASH, class EQUAL>
5919struct UsesBslmaAllocator<bdlc::FlatHashMap<KEY, VALUE, HASH, EQUAL> >
5921};
5922
5923} // close namespace bslma
5924
5925
5926#else // if ! defined(DEFINED_BDLC_FLATHASHMAP_H)
5927# error Not valid except when included from bdlc_flathashmap.h
5928#endif // ! defined(COMPILING_BDLC_FLATHASHMAP_H)
5929
5930#endif // ! defined(INCLUDED_BDLC_FLATHASHMAP_CPP03)
5931
5932// ----------------------------------------------------------------------------
5933// Copyright 2020 Bloomberg Finance L.P.
5934//
5935// Licensed under the Apache License, Version 2.0 (the "License");
5936// you may not use this file except in compliance with the License.
5937// You may obtain a copy of the License at
5938//
5939// http://www.apache.org/licenses/LICENSE-2.0
5940//
5941// Unless required by applicable law or agreed to in writing, software
5942// distributed under the License is distributed on an "AS IS" BASIS,
5943// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5944// See the License for the specific language governing permissions and
5945// limitations under the License.
5946// ----------------------------- END-OF-FILE ----------------------------------
5947
5948/** @} */
5949/** @} */
5950/** @} */
HASH hasher
Definition bdlc_flathashmap.h:468
const value_type * const_pointer
Definition bdlc_flathashmap.h:472
value_type * pointer
Definition bdlc_flathashmap.h:471
bsl::ptrdiff_t difference_type
Definition bdlc_flathashmap.h:466
friend void swap(FlatHashMap< K, V, H, E > &, FlatHashMap< K, V, H, E > &)
const value_type & const_reference
Definition bdlc_flathashmap.h:470
void clear()
Definition bdlc_flathashmap.h:1746
VALUE & at(const KEY &key)
Definition bdlc_flathashmap.h:1731
EQUAL key_eq() const
Definition bdlc_flathashmap.h:2084
iterator find(const KEY &key)
Definition bdlc_flathashmap.h:1821
bool contains(const KEY &key) const
Definition bdlc_flathashmap.h:2040
ImplType::const_iterator const_iterator
Definition bdlc_flathashmap.h:474
bsl::pair< iterator, bool > insert_or_assign(const KEY &key, M &&obj)
bool empty() const
Definition bdlc_flathashmap.h:2054
const_iterator cbegin() const
Definition bdlc_flathashmap.h:2122
bsl::size_t size() const
Return the number of elements in this map.
Definition bdlc_flathashmap.h:2105
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:875
void rehash(bsl::size_t minimumCapacity)
Definition bdlc_flathashmap.h:1906
bslma::Allocator * allocator() const
Return the allocator used by this flat hash map to supply memory.
Definition bdlc_flathashmap.h:2147
bsl::pair< iterator, bool > emplace(ARGS &&... args)
bsl::pair< iterator, iterator > equal_range(const KEY &key)
Definition bdlc_flathashmap.h:1754
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition bdlc_flathashmap.h:2153
const_iterator cend() const
Definition bdlc_flathashmap.h:2130
void reserve(bsl::size_t numEntries)
Definition bdlc_flathashmap.h:1913
float load_factor() const
Definition bdlc_flathashmap.h:2091
HASH hash_function() const
Definition bdlc_flathashmap.h:2077
~FlatHashMap()
Destroy this object and each of its elements.
Definition bdlc_flathashmap.h:1667
bsl::size_t erase(const KEY &key)
Definition bdlc_flathashmap.h:1782
iterator begin()
Definition bdlc_flathashmap.h:1992
FlatHashMap & operator=(const FlatHashMap &rhs)
Definition bdlc_flathashmap.h:1675
EQUAL key_compare
Definition bdlc_flathashmap.h:467
KEY key_type
Definition bdlc_flathashmap.h:463
FlatHashMap()
Definition bdlc_flathashmap.h:1468
VALUE & operator[](const KEY &key)
Definition bdlc_flathashmap.h:1717
ImplType::iterator iterator
Definition bdlc_flathashmap.h:473
float max_load_factor() const
Definition bdlc_flathashmap.h:2098
value_type & reference
Definition bdlc_flathashmap.h:469
void reset()
Definition bdlc_flathashmap.h:1920
bsl::size_t capacity() const
Definition bdlc_flathashmap.h:2033
iterator emplace_hint(const_iterator hint, ARGS &&... args)
Definition bdlc_flathashmap.h:1773
bsl::size_t count(const KEY &key) const
Definition bdlc_flathashmap.h:2047
VALUE mapped_type
Definition bdlc_flathashmap.h:464
bsl::pair< typename bsl::add_const< KEY >::type, VALUE > value_type
Definition bdlc_flathashmap.h:461
iterator end()
Definition bdlc_flathashmap.h:2000
bsl::size_t size_type
Definition bdlc_flathashmap.h:465
bslstl::ForwardIterator< const bsl::pair< KEY, VALUE >, IteratorImp > const_iterator
Definition bdlc_flathashtable.h:343
bslstl::ForwardIterator< bsl::pair< KEY, VALUE >, IteratorImp > iterator
Definition bdlc_flathashtable.h:341
Definition bslstl_pair.h:1280
static void swap(T *a, T *b)
Definition bslalg_swaputil.h:182
Definition bslh_fibonaccibadhashwrapper.h:165
Definition bslim_printer.h:604
Definition bslma_allocator.h:545
Definition bslma_destructorguard.h:132
Definition bslmf_movableref.h:752
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
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:506
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)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
T::iterator begin(T &container)
Definition bslstl_iterator.h:1593
ALLOCATOR & lhs
Definition bslstl_string.h:3917
T::iterator end(T &container)
Definition bslstl_iterator.h:1621
Definition bdlc_flathashmap.h:2218
Definition baljsn_encoder_testtypes.h:76
Definition bdlbb_blob.h:579
static void constructFromKey(ENTRY *entry, bslma::Allocator *allocator, BSLS_COMPILERFEATURES_FORWARD_REF(KEY_TYPE) key)
Definition bdlc_flathashmap.h:1435
static const KEY & key(const ENTRY &entry)
Return the key of the specified entry.
Definition bdlc_flathashmap.h:1456
static void construct(ENTRY *entry, bslma::Allocator *allocator, ARGS &&... args)
Definition bdlc_flathashmap.h:1419
TYPE first
Definition bslstl_pair.h:587
Definition bslmf_enableif.h:530
Definition bslstl_equalto.h:316
static void construct(TARGET_TYPE *address, const ALLOCATOR &allocator)
Definition bslma_constructionutil.h:1244
static MovableRef< t_TYPE > move(t_TYPE &reference) BSLS_KEYWORD_NOEXCEPT
Definition bslmf_movableref.h:1067
Definition bsls_objectbuffer.h:277
TYPE * address()
Definition bsls_objectbuffer.h:335
TYPE & object()
Definition bsls_objectbuffer.h:352