BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_map_cpp03.h
Go to the documentation of this file.
1/// @file bslstl_map_cpp03.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bslstl_map_cpp03.h -*-C++-*-
8
9// Automatically generated file. **DO NOT EDIT**
10
11#ifndef INCLUDED_BSLSTL_MAP_CPP03
12#define INCLUDED_BSLSTL_MAP_CPP03
13
14/// @defgroup bslstl_map_cpp03 bslstl_map_cpp03
15/// @brief Provide C++03 implementation for bslstl_map.h
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bslstl
19/// @{
20/// @addtogroup bslstl_map_cpp03
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bslstl_map_cpp03-purpose"> Purpose</a>
25/// * <a href="#bslstl_map_cpp03-classes"> Classes </a>
26/// * <a href="#bslstl_map_cpp03-description"> Description </a>
27///
28/// # Purpose {#bslstl_map_cpp03-purpose}
29/// Provide C++03 implementation for bslstl_map.h
30///
31/// # Classes {#bslstl_map_cpp03-classes}
32/// See bslstl_map.h for list of classes
33///
34/// @see bslstl_map
35///
36/// # Description {#bslstl_map_cpp03-description}
37/// This component is the C++03 translation of a C++11 component,
38/// generated by the 'sim_cpp11_features.pl' program. If the original header
39/// contains any specially delimited regions of C++11 code, then this generated
40/// file contains the C++03 equivalent, i.e., with variadic templates expanded
41/// and rvalue-references replaced by 'bslmf::MovableRef' objects. The header
42/// code in this file is designed to be '#include'd into the original header
43/// when compiling with a C++03 compiler. If there are no specially delimited
44/// regions of C++11 code, then this header contains no code and is not
45/// '#include'd in the original header.
46///
47/// Generated on Sun Sep 1 05:39:10 2024
48/// Command line: sim_cpp11_features.pl bslstl_map.h
49/// @}
50/** @} */
51/** @} */
52
53/** @addtogroup bsl
54 * @{
55 */
56/** @addtogroup bslstl
57 * @{
58 */
59/** @addtogroup bslstl_map_cpp03
60 * @{
61 */
62
63#ifdef COMPILING_BSLSTL_MAP_H
64
65namespace bsl {
66
67 // =========
68 // class map
69 // =========
70
71/// This class template implements a value-semantic container type holding
72/// an ordered sequence of key-value pairs having unique keys that provide a
73/// mapping from keys (of the template parameter type, `KEY`) to their
74/// associated values (of another template parameter type, `VALUE`).
75///
76/// This class:
77/// * supports a complete set of *value-semantic* operations
78/// - except for BDEX serialization
79/// * is *exception-neutral*
80/// * is *alias-safe*
81/// * is `const` *thread-safe*
82/// For terminology see @ref bsldoc_glossary .
83///
84/// See @ref bslstl_map_cpp03
85template <class KEY,
86 class VALUE,
87 class COMPARATOR = std::less<KEY>,
88 class ALLOCATOR = allocator<pair<const KEY, VALUE> > >
89class map {
90
91 // PRIVATE TYPES
92
93 /// This typedef is an alias for the type of key-value pair objects
94 /// maintained by this map.
95 typedef pair<const KEY, VALUE> ValueType;
96
97 /// This typedef is an alias for the comparator used internally by this
98 /// map.
99 typedef BloombergLP::bslstl::MapComparator<KEY, VALUE, COMPARATOR>
100 Comparator;
101
102 /// This typedef is an alias for the type of nodes held by the tree (of
103 /// nodes) used to implement this map.
104 typedef BloombergLP::bslstl::TreeNode<ValueType> Node;
105
106 /// This typedef is an alias for the factory type used to create and
107 /// destroy `Node` objects.
108 typedef BloombergLP::bslstl::TreeNodePool<ValueType, ALLOCATOR>
109 NodeFactory;
110
111 /// This typedef is an alias for the allocator traits type associated
112 /// with this container.
113 typedef typename bsl::allocator_traits<ALLOCATOR> AllocatorTraits;
114
115 /// This typedef is a convenient alias for the utility associated with
116 /// movable references.
117 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
118
119 /// This struct is wrapper around the comparator and allocator data
120 /// members. It takes advantage of the empty-base optimization (EBO) so
121 /// that if the comparator is stateless, it takes up no space.
122 ///
123 /// TBD: This class should eventually be replaced by the use of a
124 /// general EBO-enabled component that provides a `pair`-like interface
125 /// or a `tuple`.
126 ///
127 /// See @ref bslstl_map_cpp03
128 class DataWrapper : public Comparator {
129
130 // DATA
131 NodeFactory d_pool; // pool of 'Node' objects
132
133 private:
134 // NOT IMPLEMENTED
135 DataWrapper(const DataWrapper&);
136 DataWrapper& operator=(const DataWrapper&);
137
138 public:
139 // CREATORS
140
141 /// Create a data wrapper using a copy of the specified `comparator`
142 /// to order key-value pairs and a copy of the specified
143 /// `basicAllocator` to supply memory.
144 DataWrapper(const COMPARATOR& comparator,
145 const ALLOCATOR& basicAllocator);
146
147 /// Create a data wrapper initialized to the contents of the `pool`
148 /// associated with the specified `original` data wrapper. The
149 /// comparator and allocator associated with `original` are
150 /// propagated to the new data wrapper. `original` is left in a
151 /// valid but unspecified state.
152 DataWrapper(
153 BloombergLP::bslmf::MovableRef<DataWrapper> original);// IMPLICIT
154
155 // MANIPULATORS
156
157 /// Return a reference providing modifiable access to the node
158 /// factory associated with this data wrapper.
159 NodeFactory& nodeFactory();
160
161 // ACCESSORS
162
163 /// Return a reference providing non-modifiable access to the node
164 /// factory associated with this data wrapper.
165 const NodeFactory& nodeFactory() const;
166 };
167
168 // DATA
169 DataWrapper d_compAndAlloc;
170 // comparator and pool of 'Node'
171 // objects
172
173 BloombergLP::bslalg::RbTreeAnchor d_tree; // balanced tree of 'Node'
174 // objects
175
176 public:
177 // PUBLIC TYPES
178 typedef KEY key_type;
179 typedef VALUE mapped_type;
180 typedef pair<const KEY, VALUE> value_type;
181 typedef COMPARATOR key_compare;
182 typedef ALLOCATOR allocator_type;
183 typedef value_type& reference;
184 typedef const value_type& const_reference;
185
186 typedef typename AllocatorTraits::size_type size_type;
188 typedef typename AllocatorTraits::pointer pointer;
190
191 typedef BloombergLP::bslstl::TreeIterator<
193 typedef BloombergLP::bslstl::TreeIterator<
195 typedef bsl::reverse_iterator<iterator> reverse_iterator;
196 typedef bsl::reverse_iterator<const_iterator> const_reverse_iterator;
197
198 /// This nested class defines a mechanism for comparing two objects of
199 /// `value_type` by adapting an object of (template parameter) type
200 /// `COMPARATOR`, which compares two objects of (template parameter)
201 /// type `KEY` . Note that this class exactly matches its definition in
202 /// the C++11 standard [map.overview]; otherwise, we would have
203 /// implemented it as a separate component-local class.
204 ///
205 /// See @ref bslstl_map_cpp03
206 class value_compare {
207
208 // FRIENDS
209 friend class map;
210
211 protected:
212 // PROTECTED DATA
213 COMPARATOR comp; // we would not have elected to make this data
214 // member 'protected'
215
216 // PROTECTED CREATORS
217
218 /// Create a @ref value_compare object that uses the specified
219 /// `comparator`.
220 value_compare(COMPARATOR comparator); // IMPLICIT
221
222 public:
223 // PUBLIC TYPES
224
225 /// This `typedef` is an alias for the result type of a call to the
226 /// overload of `operator()` (the comparison function) provided by a
227 /// `map::value_compare` object.
228 typedef bool result_type;
229
230 /// This `typedef` is an alias for the type of the first parameter
231 /// of the overload of `operator()` (the comparison function)
232 /// provided by a `map::value_compare` object.
234
235 /// This `typedef` is an alias for the type of the second parameter
236 /// of the overload of `operator()` (the comparison function)
237 /// provided by a `map::value_compare` object.
239
240 // CREATORS
241 value_compare(const value_compare& original) = default;
242 // Create a @ref value_compare object having the same value as the
243 // specified 'original' object.
244
245 ~value_compare() = default;
246 // Destroy this object.
247
248 // MANIPULATORS
249 value_compare& operator=(const value_compare& rhs) = default;
250 // Assign to this object the value of the specified 'rhs' object,
251 // and return a reference providing modifiable access to this
252 // object.
253
254 // ACCESSORS
255
256 /// Return `true` if the specified `x` object is ordered before the
257 /// specified `y` object, as determined by the comparator supplied
258 /// at construction, and `false` otherwise.
259 bool operator()(const value_type& x, const value_type& y) const;
260 };
261
262 private:
263 // PRIVATE CLASS METHODS
264
265 /// Return an address providing modifiable access to the specified
266 /// `node`. The behavior is undefined unless `node` is the address of a
267 /// `Node` object.
268 static Node *toNode(BloombergLP::bslalg::RbTreeNode *node);
269
270 /// Return an address providing non-modifiable access to the specified
271 /// `node`. The behavior is undefined unless `node` is the address of a
272 /// `Node` object.
273 static const Node *toNode(const BloombergLP::bslalg::RbTreeNode *node);
274
275 // PRIVATE MANIPULATORS
276
277 /// Return a reference providing modifiable access to the node allocator
278 /// for this map.
279 NodeFactory& nodeFactory();
280
281 /// Return a reference providing modifiable access to the comparator for
282 /// this map.
283 Comparator& comparator();
284
285 /// Efficiently exchange the value, comparator, and allocator of this
286 /// object with the value, comparator, and allocator of the specified
287 /// `other` object. This method provides the no-throw exception-safety
288 /// guarantee, *unless* swapping the (user-supplied) comparator or
289 /// allocator objects can throw.
290 void quickSwapExchangeAllocators(map& other);
291
292 /// Efficiently exchange the value and comparator of this object with
293 /// the value and comparator of the specified `other` object. This
294 /// method provides the no-throw exception-safety guarantee, *unless*
295 /// swapping the (user-supplied) comparator objects can throw. The
296 /// behavior is undefined unless this object was created with the same
297 /// allocator as `other`.
298 void quickSwapRetainAllocators(map& other);
299
300 // PRIVATE ACCESSORS
301
302 /// Return a reference providing non-modifiable access to the node
303 /// allocator for this map.
304 const NodeFactory& nodeFactory() const;
305
306 /// Return a reference providing non-modifiable access to the comparator
307 /// for this map.
308 const Comparator& comparator() const;
309
310 public:
311 // CREATORS
312
313 map();
314 /// Create an empty map. Optionally specify a `comparator` used to
315 /// order key-value pairs contained in this object. If `comparator` is
316 /// not supplied, a default-constructed object of the (template
317 /// parameter) type `COMPARATOR` is used. Optionally specify a
318 /// `basicAllocator` used to supply memory. If `basicAllocator` is not
319 /// supplied, a default-constructed object of the (template parameter)
320 /// type `ALLOCATOR` is used. If the type `ALLOCATOR` is
321 /// `bsl::allocator` (the default), then `basicAllocator`, if supplied,
322 /// shall be convertible to `bslma::Allocator *`. If the type
323 /// `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not
324 /// supplied, the currently installed default allocator is used.
325 explicit map(const COMPARATOR& comparator,
326 const ALLOCATOR& basicAllocator = ALLOCATOR())
327 : d_compAndAlloc(comparator, basicAllocator)
328 , d_tree()
329 {
330 // The implementation is placed here in the class definition to work
331 // around an AIX compiler bug, where the constructor can fail to
332 // compile because it is unable to find the definition of the default
333 // argument. This occurs when a parameterized class wraps around the
334 // container and the comparator is defined after the new class.
335 }
336
337 /// Create an empty map that uses the specified `basicAllocator` to
338 /// supply memory. Use a default-constructed object of the (template
339 /// parameter) type `COMPARATOR` to order the key-value pairs contained
340 /// in this map. Note that a `bslma::Allocator *` can be supplied for
341 /// `basicAllocator` if the (template parameter) `ALLOCATOR` is
342 /// `bsl::allocator` (the default).
343 explicit map(const ALLOCATOR& basicAllocator);
344
345 /// Create a map having the same value as the specified `original`
346 /// object. Use a copy of `original.key_comp()` to order the key-value
347 /// pairs contained in this map. Use the allocator returned by
348 /// 'bsl::allocator_traits<ALLOCATOR>::
349 /// select_on_container_copy_construction(original.get_allocator())' to
350 /// allocate memory. If the (template parameter) type `ALLOCATOR` is
351 /// `bsl::allocator` (the default), the currently installed default
352 /// allocator is used. This method requires that the (template
353 /// parameter) types `KEY` and `VALUE` both be `copy-insertable` into
354 /// this map (see {Requirements on `KEY` and `VALUE`}).
355 map(const map& original);
356
357 /// Create a map having the same value as the specified `original`
358 /// object by moving (in constant time) the contents of `original` to
359 /// the new map. Use a copy of `original.key_comp()` to order the
360 /// key-value pairs contained in this map. The allocator associated
361 /// with `original` is propagated for use in the newly-created map.
362 /// `original` is left in a valid but unspecified state.
363 map(BloombergLP::bslmf::MovableRef<map> original); // IMPLICIT
364
365 /// Create a map having the same value as the specified `original`
366 /// object that uses the specified `basicAllocator` to supply memory.
367 /// Use a copy of `original.key_comp()` to order the key-value pairs
368 /// contained in this map. This method requires that the (template
369 /// parameter) types `KEY` and `VALUE` both be `copy-insertable` into
370 /// this map (see {Requirements on `KEY` and `VALUE`}). Note that a
371 /// `bslma::Allocator *` can be supplied for `basicAllocator` if the
372 /// (template parameter) `ALLOCATOR` is `bsl::allocator` (the default).
373 map(const map& original,
374 const typename type_identity<ALLOCATOR>::type& basicAllocator);
375
376 /// Create a map having the same value as the specified `original`
377 /// object that uses the specified `basicAllocator` to supply memory.
378 /// The contents of `original` are moved (in constant time) to the new
379 /// map if `basicAllocator == original.get_allocator()`, and are move-
380 /// inserted (in linear time) using `basicAllocator` otherwise.
381 /// `original` is left in a valid but unspecified state. Use a copy of
382 /// `original.key_comp()` to order the key-value pairs contained in this
383 /// map. This method requires that the (template parameter) types `KEY`
384 /// and `VALUE` both be `move-insertable` into this map (see
385 /// {Requirements on `KEY` and `VALUE`}). Note that a
386 /// `bslma::Allocator *` can be supplied for `basicAllocator` if the
387 /// (template parameter) `ALLOCATOR` is `bsl::allocator` (the default).
388 map(BloombergLP::bslmf::MovableRef<map> original,
389 const typename type_identity<ALLOCATOR>::type& basicAllocator);
390
391 /// Create a map, and insert each `value_type` object in the sequence
392 /// starting at the specified `first` element, and ending immediately
393 /// before the specified `last` element, ignoring those objects having a
394 /// key equivalent to that which appears earlier in the sequence.
395 /// Optionally specify a `comparator` used to order key-value pairs
396 /// contained in this object. If `comparator` is not supplied, a
397 /// default-constructed object of the (template parameter) type
398 /// `COMPARATOR` is used. Optionally specify a `basicAllocator` used to
399 /// supply memory. If `basicAllocator` is not supplied, a
400 /// default-constructed object of the (template parameter) type
401 /// `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator`
402 /// (the default), then `basicAllocator`, if supplied, shall be
403 /// convertible to `bslma::Allocator *`. If the type `ALLOCATOR` is
404 /// `bsl::allocator` and `basicAllocator` is not supplied, the currently
405 /// installed default allocator is used. If the sequence `first` to
406 /// `last` is ordered according to `comparator`, then this operation has
407 /// `O[N]` complexity, where `N` is the number of elements between
408 /// `first` and `last`; otherwise, this operation has `O[N * log(N)]`
409 /// complexity. The (template parameter) type `INPUT_ITERATOR` shall
410 /// meet the requirements of an input iterator defined in the C++11
411 /// standard [input.iterators] providing access to values of a type
412 /// convertible to `value_type`, and `value_type` must be
413 /// `emplace-constructible` from `*i` into this map, where `i` is a
414 /// dereferenceable iterator in the range `[first .. last)` (see
415 /// {Requirements on `KEY` and `VALUE`}). The behavior is undefined
416 /// unless `first` and `last` refer to a sequence of valid values where
417 /// `first` is at a position at or before `last`.
418 template <class INPUT_ITERATOR>
419 map(INPUT_ITERATOR first,
420 INPUT_ITERATOR last,
421 const COMPARATOR& comparator = COMPARATOR(),
422 const ALLOCATOR& basicAllocator = ALLOCATOR());
423 template <class INPUT_ITERATOR>
424 map(INPUT_ITERATOR first,
425 INPUT_ITERATOR last,
426 const ALLOCATOR& basicAllocator);
427
428#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
429 map(std::initializer_list<value_type> values,
430 const COMPARATOR& comparator = COMPARATOR(),
431 const ALLOCATOR& basicAllocator = ALLOCATOR());
432 /// Create a map and insert each `value_type` object in the specified
433 /// `values` initializer list, ignoring those objects having a key
434 /// equivalent to that which appears earlier in the list. Optionally
435 /// specify a `comparator` used to order keys contained in this object.
436 /// If `comparator` is not supplied, a default-constructed object of the
437 /// (template parameter) type `COMPARATOR` is used. Optionally specify
438 /// a `basicAllocator` used to supply memory. If `basicAllocator` is
439 /// not supplied, a default-constructed object of the (template
440 /// parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is
441 /// `bsl::allocator` (the default), then `basicAllocator`, if supplied,
442 /// shall be convertible to `bslma::Allocator *`. If the type
443 /// `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not
444 /// supplied, the currently installed default allocator is used. If
445 /// `values` is ordered according to `comparator`, then this operation
446 /// has `O[N]` complexity, where `N` is the number of elements in
447 /// `values`; otherwise, this operation has `O[N * log(N)]` complexity.
448 /// This method requires that the (template parameter) types `KEY` and
449 /// `VALUE` both be `copy-insertable` into this map (see {Requirements
450 /// on `KEY` and `VALUE`}).
451 map(std::initializer_list<value_type> values,
452 const ALLOCATOR& basicAllocator);
453#endif
454
455 /// Destroy this object.
456 ~map();
457
458 // MANIPULATORS
459
460 /// Assign to this object the value and comparator of the specified
461 /// `rhs` object, propagate to this object the allocator of `rhs` if the
462 /// `ALLOCATOR` type has trait `propagate_on_container_copy_assignment`,
463 /// and return a reference providing modifiable access to this object.
464 /// If an exception is thrown, `*this` is left in a valid but
465 /// unspecified state. This method requires that the (template
466 /// parameter) types `KEY` and `VALUE` both be `copy-assignable` and
467 /// `copy-insertable` into this map (see {Requirements on `KEY` and
468 /// `VALUE`}).
469 map& operator=(const map& rhs);
470
471 map& operator=(BloombergLP::bslmf::MovableRef<map> rhs)
473 AllocatorTraits::is_always_equal::value &&
474 std::is_nothrow_move_assignable<COMPARATOR>::value);
475 // Assign to this object the value and comparator of the specified
476 // 'rhs' object, propagate to this object the allocator of 'rhs' if the
477 // 'ALLOCATOR' type has trait 'propagate_on_container_move_assignment',
478 // and return a reference providing modifiable access to this object.
479 // The contents of 'rhs' are moved (in constant time) to this map if
480 // 'get_allocator() == rhs.get_allocator()' (after accounting for the
481 // aforementioned trait); otherwise, all elements in this map are
482 // either destroyed or move-assigned to and each additional element in
483 // 'rhs' is move-inserted into this map. 'rhs' is left in a valid but
484 // unspecified state, and if an exception is thrown, '*this' is left
485 // in a valid but unspecified state. This method requires that the
486 // (template parameter) types 'KEY' and 'VALUE' both be
487 // 'move-assignable' and 'move-insertable' into this map (see
488 // {Requirements on 'KEY' and 'VALUE'}).
489
490#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
491 /// Assign to this object the value resulting from first clearing this
492 /// map and then inserting each `value_type` object in the specified
493 /// `values` initializer list, ignoring those objects having a key
494 /// equivalent to that which appears earlier in the list; return a
495 /// reference providing modifiable access to this object. This method
496 /// requires that the (template parameter) types `KEY` and `VALUE` both
497 /// be `copy-insertable` into this map (see {Requirements on `KEY` and
498 /// `VALUE`}).
499 map& operator=(std::initializer_list<value_type> values);
500#endif
501
502 /// Return a reference providing modifiable access to the mapped-value
503 /// associated with the specified `key`; if this `map` does not already
504 /// contain a `value_type` object having an equivalent key, first insert
505 /// a new `value_type` object having `key` and a default-constructed
506 /// `VALUE` object, and return a reference to the newly mapped (default)
507 /// value. This method requires that the (template parameter) type
508 /// `KEY` be `copy-insertable` into this map and the (template
509 /// parameter) type `VALUE` be `default-insertable` into this map (see
510 /// {Requirements on `KEY` and `VALUE`}).
512
513 /// Return a reference providing modifiable access to the mapped-value
514 /// associated with the specified `key`; if this `map` does not already
515 /// contain a `value_type` object having an equivalent key, first insert
516 /// a new `value_type` object having the move-inserted `key` and a
517 /// default-constructed `VALUE` object, and return a reference to the
518 /// newly mapped (default) value. This method requires that the
519 /// (template parameter) type `KEY` be `move-insertable` into this map
520 /// and the (template parameter) type `VALUE` be `default-insertable`
521 /// into this map (see {Requirements on `KEY` and `VALUE`}).
523 BloombergLP::bslmf::MovableRef<key_type> key);
524
525 /// Return a reference providing modifiable access to the mapped-value
526 /// associated with the specified `key`, if such an entry exists;
527 /// otherwise, throw a `std::out_of_range` exception. Note that this
528 /// method may also throw a different kind of exception if the
529 /// (user-supplied) comparator throws.
530 typename add_lvalue_reference<VALUE>::type at(const key_type& key);
531
532 /// Return an iterator providing modifiable access to the first
533 /// `value_type` object in the ordered sequence of `value_type` objects
534 /// maintained by this map, or the `end` iterator if this map is empty.
536
537 /// Return an iterator providing modifiable access to the past-the-end
538 /// element in the ordered sequence of `value_type` objects maintained
539 /// by this map.
541
542 /// Return a reverse iterator providing modifiable access to the last
543 /// `value_type` object in the ordered sequence of `value_type` objects
544 /// maintained by this map, or `rend` if this map is empty.
546
547 /// Return a reverse iterator providing modifiable access to the
548 /// prior-to-the-beginning element in the ordered sequence of
549 /// `value_type` objects maintained by this map.
551
552 /// Insert the specified `value` into this map if a key (the `first`
553 /// element) equivalent to that of `value` does not already exist in
554 /// this map; otherwise, if a `value_type` object whose key is
555 /// equivalent to that of `value` already exists in this map, this
556 /// method has no effect. Return a pair whose `first` member is an
557 /// iterator referring to the (possibly newly inserted) `value_type`
558 /// object in this map whose key is equivalent to that of `value`, and
559 /// whose `second` member is `true` if a new value was inserted, and
560 /// `false` if the key was already present. This method requires that
561 /// the (template parameter) types `KEY` and `VALUE` both be
562 /// `copy-insertable` into this map (see {Requirements on `KEY` and
563 /// `VALUE`}).
564 pair<iterator, bool> insert(const value_type& value);
565
566 /// Insert into this map the specified `value` if a key (the `first`
567 /// element) equivalent to that of `value` does not already exist in
568 /// this map; otherwise, this method has no effect. Return a pair whose
569 /// `first` member is an iterator referring to the (possibly newly
570 /// inserted) `value_type` object in this map whose key is equivalent to
571 /// that of `value`, and whose `second` member is `true` if a new value
572 /// was inserted and `false` if the key was already present. This
573 /// method requires that the (template parameter) types `KEY` and
574 /// `VALUE` both be `move-insertable` into this map (see {Requirements
575 /// on `KEY` and `VALUE`}).
576 pair<iterator, bool> insert(
577 BloombergLP::bslmf::MovableRef<value_type> value);
578
579#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
580 template <class ALT_VALUE_TYPE>
581 pair<iterator, bool>
582#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
583 template <class ALT_VALUE_TYPE>
584 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
585 pair<iterator, bool> >::type
586#else
587 /// Insert into this map a `value_type` object created from the
588 /// specified `value` if a key (the `first` element) equivalent to that
589 /// of such an object does not already exist in this map; otherwise,
590 /// this method has no effect (other than possibly creating a temporary
591 /// `value_type` object). Return a pair whose `first` member is an
592 /// iterator referring to the (possibly newly inserted) `value_type`
593 /// object in this map whose key is equivalent to that of the object
594 /// created from `value`, and whose `second` member is `true` if a new
595 /// value was inserted and `false` if the key was already present. This
596 /// method requires that the (template parameter) types `KEY` and
597 /// `VALUE` both be `move-insertable` into this map (see {Requirements
598 /// on `KEY` and `VALUE`}), and the `value_type` be constructible from
599 /// the (template parameter) `ALT_VALUE_TYPE`.
600 template <class ALT_VALUE_TYPE>
601 typename enable_if<std::is_constructible<value_type,
602 ALT_VALUE_TYPE&&>::value,
603 pair<iterator, bool> >::type
604#endif
605 insert(BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
606 {
607 // This function has to be implemented inline, in violation of BDE
608 // convention, as the MSVC compiler cannot match the out-of-class
609 // definition of the declaration in the class.
610
611 return emplace(BSLS_COMPILERFEATURES_FORWARD(ALT_VALUE_TYPE, value));
612 }
613
614 /// Insert the specified `value` into this map (in amortized constant
615 /// time if the specified `hint` is a valid immediate successor to the
616 /// key of `value`) if a key (the `first` element) equivalent to that of
617 /// `value` does not already exist in this map; otherwise, if a
618 /// `value_type` object whose key is equivalent to that of `value`
619 /// already exists in this map, this method has no effect. Return an
620 /// iterator referring to the (possibly newly inserted) `value_type`
621 /// object in this map whose key is equivalent to that of `value`. If
622 /// `hint` is not a valid immediate successor to the key of `value`,
623 /// this operation has `O[log(N)]` complexity, where `N` is the size of
624 /// this map. This method requires that the (template parameter) types
625 /// `KEY` and `VALUE` both be `copy-insertable` into this map (see
626 /// {Requirements on `KEY` and `VALUE`}). The behavior is undefined
627 /// unless `hint` is an iterator in the range `[begin() .. end()]` (both
628 /// endpoints included).
629 iterator insert(const_iterator hint, const value_type& value);
630
631 /// Insert into this map the specified `value` (in amortized constant
632 /// time if the specified `hint` is a valid immediate successor to
633 /// `value`) if a key (the `first` element) equivalent to that of
634 /// `value` does not already exist in this map; otherwise, this method
635 /// has no effect. Return an iterator referring to the (possibly newly
636 /// inserted) `value_type` object in this map whose key is equivalent to
637 /// that of `value`. If `hint` is not a valid immediate successor to
638 /// `value`, this operation has `O[log(N)]` complexity, where `N` is the
639 /// size of this map. This method requires that the (template
640 /// parameter) types `KEY` and `VALUE` both be `move-insertable` into
641 /// this map (see {Requirements on `KEY` and `VALUE`}). The behavior is
642 /// undefined unless `hint` is an iterator in the range
643 /// `[begin() .. end()]` (both endpoints included).
645 BloombergLP::bslmf::MovableRef<value_type> value);
646
647#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
648 template <class ALT_VALUE_TYPE>
650#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
651 template <class ALT_VALUE_TYPE>
652 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
653 iterator>::type
654#else
655 /// Insert into this map a `value_type` object created from the
656 /// specified `value` (in amortized constant time if the specified
657 /// `hint` is a valid immediate successor to the object created from
658 /// `value`) if a key (the `first` element) equivalent to such an object
659 /// does not already exist in this map; otherwise, this method has no
660 /// effect (other than possibly creating a temporary `value_type`
661 /// object). Return an iterator referring to the (possibly newly
662 /// inserted) `value_type` object in this map whose key is equivalent to
663 /// that of the object created from `value`. If `hint` is not a valid
664 /// immediate successor to the object created from `value`, this
665 /// operation has `O[log(N)]` complexity, where `N` is the size of this
666 /// map. This method requires that the (template parameter) types `KEY`
667 /// and `VALUE` both be `move-insertable` into this map (see
668 /// {Requirements on `KEY` and `VALUE`}), and the `value_type` be
669 /// constructible from the (template parameter) `ALT_VALUE_TYPE`. The
670 /// behavior is undefined unless `hint` is an iterator in the range
671 /// `[begin() .. end()]` (both endpoints included).
672 template <class ALT_VALUE_TYPE>
673 typename enable_if<std::is_constructible<value_type,
674 ALT_VALUE_TYPE&&>::value,
675 iterator>::type
676#endif
678 BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
679 {
680 // This function has to be implemented inline, in violation of BDE
681 // convention, as the MSVC compiler cannot match the out-of-class
682 // definition of the declaration in the class.
683
684 return emplace_hint(
685 hint,
686 BSLS_COMPILERFEATURES_FORWARD(ALT_VALUE_TYPE, value));
687 }
688
689 /// Insert into this map the value of each `value_type` object in the
690 /// range starting at the specified `first` iterator and ending
691 /// immediately before the specified `last` iterator, if a key
692 /// equivalent to that of the object is not already contained in this
693 /// map. The (template parameter) type `INPUT_ITERATOR` shall meet the
694 /// requirements of an input iterator defined in the C++11 standard
695 /// [input.iterators] providing access to values of a type convertible
696 /// to `value_type`, and `value_type` must be `emplace-constructible`
697 /// from `*i` into this map, where `i` is a dereferenceable iterator in
698 /// the range `[first .. last)` (see {Requirements on `KEY` and
699 /// `VALUE`}). The behavior is undefined unless `first` and `last`
700 /// refer to a sequence of valid values where `first` is at a position
701 /// at or before `last`.
702 template <class INPUT_ITERATOR>
703 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
704
705#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
706 void insert(const_iterator first, const_iterator last);
707 // This method is provided only on Sun to work around a bug in the Sun
708 // Studio 12.3 compiler, which prevents us from disabling (at compile
709 // time) the overload of 'insert' taking a 'const_iterator' and a
710 // forwarding reference if the second argument is not convertible to
711 // the value type associated with the map. Without such a check, in
712 // certain cases, the same compiler complains of ambiguity between
713 // the 'insert' method taking two input iterators and the 'insert'
714 // method taking a 'const_iterator' and a forwarding reference; such
715 // an ambiguity is resolved by providing this method, which is
716 // equivalent to the 'insert' method (above) taking two input iterators
717 // of template parameter type.
718#endif
719
720#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
721 /// Insert into this map the value of each `value_type` object in the
722 /// specified `values` initializer list if a key equivalent to that of
723 /// the object is not already contained in this map. This method
724 /// requires that the (template parameter) types `KEY` and `VALUE` both
725 /// be `copy-insertable` into this map (see {Requirements on `KEY` and
726 /// `VALUE`}).
727 void insert(std::initializer_list<value_type> values);
728#endif
729
730// {{{ BEGIN GENERATED CODE
731// The generated code below is a workaround for the absence of perfect
732// forwarding in some compilers.
733 template <class BDE_OTHER_TYPE>
734 pair<iterator, bool> insert_or_assign(const KEY& key,
735 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
736
737 template <class BDE_OTHER_TYPE>
738 pair<iterator, bool> insert_or_assign(
739 BloombergLP::bslmf::MovableRef<KEY> key,
740 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
741
742 template <class BDE_OTHER_TYPE>
744 const KEY& key,
745 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
746
747 template <class BDE_OTHER_TYPE>
749 BloombergLP::bslmf::MovableRef<KEY> key,
750 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj);
751// }}} END GENERATED CODE
752
753#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
754// {{{ BEGIN GENERATED CODE
755// Command line: sim_cpp11_features.pl bslstl_map.h
756#ifndef BSLSTL_MAP_VARIADIC_LIMIT
757#define BSLSTL_MAP_VARIADIC_LIMIT 10
758#endif
759#ifndef BSLSTL_MAP_VARIADIC_LIMIT_B
760#define BSLSTL_MAP_VARIADIC_LIMIT_B BSLSTL_MAP_VARIADIC_LIMIT
761#endif
762#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 0
763 pair<iterator, bool> emplace(
764 );
765#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 0
766
767#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 1
768 template <class Args_01>
769 pair<iterator, bool> emplace(
770 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
771#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 1
772
773#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 2
774 template <class Args_01,
775 class Args_02>
776 pair<iterator, bool> emplace(
777 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
778 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
779#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 2
780
781#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 3
782 template <class Args_01,
783 class Args_02,
784 class Args_03>
785 pair<iterator, bool> emplace(
786 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
787 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
788 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
789#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 3
790
791#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 4
792 template <class Args_01,
793 class Args_02,
794 class Args_03,
795 class Args_04>
796 pair<iterator, bool> emplace(
797 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
798 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
799 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
800 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
801#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 4
802
803#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 5
804 template <class Args_01,
805 class Args_02,
806 class Args_03,
807 class Args_04,
808 class Args_05>
809 pair<iterator, bool> emplace(
810 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
811 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
812 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
813 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
814 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
815#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 5
816
817#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 6
818 template <class Args_01,
819 class Args_02,
820 class Args_03,
821 class Args_04,
822 class Args_05,
823 class Args_06>
824 pair<iterator, bool> emplace(
825 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
826 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
827 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
828 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
829 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
830 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
831#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 6
832
833#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 7
834 template <class Args_01,
835 class Args_02,
836 class Args_03,
837 class Args_04,
838 class Args_05,
839 class Args_06,
840 class Args_07>
841 pair<iterator, bool> emplace(
842 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
843 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
844 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
845 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
846 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
847 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
848 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
849#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 7
850
851#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 8
852 template <class Args_01,
853 class Args_02,
854 class Args_03,
855 class Args_04,
856 class Args_05,
857 class Args_06,
858 class Args_07,
859 class Args_08>
860 pair<iterator, bool> emplace(
861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
862 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
863 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
864 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
865 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
866 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
867 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
868 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
869#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 8
870
871#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 9
872 template <class Args_01,
873 class Args_02,
874 class Args_03,
875 class Args_04,
876 class Args_05,
877 class Args_06,
878 class Args_07,
879 class Args_08,
880 class Args_09>
881 pair<iterator, bool> emplace(
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 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
890 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
891#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 9
892
893#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 10
894 template <class Args_01,
895 class Args_02,
896 class Args_03,
897 class Args_04,
898 class Args_05,
899 class Args_06,
900 class Args_07,
901 class Args_08,
902 class Args_09,
903 class Args_10>
904 pair<iterator, bool> emplace(
905 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
906 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
907 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
908 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
909 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
910 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
911 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
912 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
913 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
914 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
915#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 10
916
917
918#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 0
920#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 0
921
922#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 1
923 template <class Args_01>
925 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
926#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 1
927
928#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 2
929 template <class Args_01,
930 class Args_02>
932 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
933 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
934#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 2
935
936#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 3
937 template <class Args_01,
938 class Args_02,
939 class Args_03>
941 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
942 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
943 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
944#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 3
945
946#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 4
947 template <class Args_01,
948 class Args_02,
949 class Args_03,
950 class Args_04>
952 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
953 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
954 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
955 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
956#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 4
957
958#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 5
959 template <class Args_01,
960 class Args_02,
961 class Args_03,
962 class Args_04,
963 class Args_05>
965 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
966 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
967 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
968 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
969 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
970#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 5
971
972#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 6
973 template <class Args_01,
974 class Args_02,
975 class Args_03,
976 class Args_04,
977 class Args_05,
978 class Args_06>
980 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
981 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
982 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
983 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
984 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
985 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
986#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 6
987
988#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 7
989 template <class Args_01,
990 class Args_02,
991 class Args_03,
992 class Args_04,
993 class Args_05,
994 class Args_06,
995 class Args_07>
997 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
998 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
999 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1000 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1001 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1002 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1003 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
1004#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 7
1005
1006#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 8
1007 template <class Args_01,
1008 class Args_02,
1009 class Args_03,
1010 class Args_04,
1011 class Args_05,
1012 class Args_06,
1013 class Args_07,
1014 class Args_08>
1016 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1017 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1018 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1019 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1020 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1021 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1022 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1023 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
1024#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 8
1025
1026#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 9
1027 template <class Args_01,
1028 class Args_02,
1029 class Args_03,
1030 class Args_04,
1031 class Args_05,
1032 class Args_06,
1033 class Args_07,
1034 class Args_08,
1035 class Args_09>
1037 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1038 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1039 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1040 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1041 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1042 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1043 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1044 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1045 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
1046#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 9
1047
1048#if BSLSTL_MAP_VARIADIC_LIMIT_B >= 10
1049 template <class Args_01,
1050 class Args_02,
1051 class Args_03,
1052 class Args_04,
1053 class Args_05,
1054 class Args_06,
1055 class Args_07,
1056 class Args_08,
1057 class Args_09,
1058 class Args_10>
1060 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1061 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1062 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1063 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1064 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1065 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1066 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1067 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1068 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1069 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
1070#endif // BSLSTL_MAP_VARIADIC_LIMIT_B >= 10
1071
1072#else
1073// The generated code below is a workaround for the absence of perfect
1074// forwarding in some compilers.
1075 template <class... Args>
1076 pair<iterator, bool> emplace(
1077 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
1078
1079 template <class... Args>
1081 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
1082// }}} END GENERATED CODE
1083#endif
1084
1085 iterator erase(const_iterator position);
1086 /// Remove from this map the `value_type` object at the specified
1087 /// `position`, and return an iterator referring to the element
1088 /// immediately following the removed element, or to the past-the-end
1089 /// position if the removed element was the last element in the sequence
1090 /// of elements maintained by this map. This method invalidates only
1091 /// iterators and references to the removed element and previously saved
1092 /// values of the `end()` iterator. The behavior is undefined unless
1093 /// `position` refers to a `value_type` object in this map.
1094 iterator erase(iterator position);
1095
1096 /// Remove from this map the `value_type` object whose key is equivalent
1097 /// the specified `key`, if such an entry exists, and return 1;
1098 /// otherwise, if there is no `value_type` object having an equivalent
1099 /// key, return 0 with no other effect. This method invalidates only
1100 /// iterators and references to the removed element and previously saved
1101 /// values of the `end()` iterator.
1102 size_type erase(const key_type& key);
1103
1105 /// Remove from this map the `value_type` objects starting at the
1106 /// specified `first` position up to, but including the specified `last`
1107 /// position, and return `last`. This method invalidates only
1108 /// iterators and references to the removed element and previously saved
1109 /// values of the `end()` iterator. The behavior is undefined unless
1110 /// `first` and `last` either refer to elements in this map or are the
1111 /// `end` iterator, and the `first` position is at or before the `last`
1112 /// position in the ordered sequence provided by this container.
1113
1115 AllocatorTraits::is_always_equal::value &&
1116 bsl::is_nothrow_swappable<COMPARATOR>::value);
1117 // Exchange the value and comparator of this object with those of the
1118 // specified 'other' object; also exchange the allocator of this object
1119 // with that of 'other' if the (template parameter) type 'ALLOCATOR'
1120 // has the 'propagate_on_container_swap' trait, and do not modify
1121 // either allocator otherwise. This method provides the no-throw
1122 // exception-safety guarantee if and only if the (template parameter)
1123 // type 'COMPARATOR' provides a no-throw swap operation, and provides
1124 // the basic exception-safety guarantee otherwise; if an exception is
1125 // thrown, both objects are left in valid but unspecified states. This
1126 // operation has 'O[1]' complexity if either this object was created
1127 // with the same allocator as 'other' or 'ALLOCATOR' has the
1128 // 'propagate_on_container_swap' trait; otherwise, it has 'O[n + m]'
1129 // complexity, where 'n' and 'm' are the number of elements in this
1130 // object and 'other', respectively. Note that this method's support
1131 // for swapping objects created with different allocators when
1132 // 'ALLOCATOR' does not have the 'propagate_on_container_swap' trait is
1133 // a departure from the C++ Standard.
1134
1135#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1136// {{{ BEGIN GENERATED CODE
1137// Command line: sim_cpp11_features.pl bslstl_map.h
1138#ifndef BSLSTL_MAP_VARIADIC_LIMIT
1139#define BSLSTL_MAP_VARIADIC_LIMIT 10
1140#endif
1141#ifndef BSLSTL_MAP_VARIADIC_LIMIT_C
1142#define BSLSTL_MAP_VARIADIC_LIMIT_C BSLSTL_MAP_VARIADIC_LIMIT
1143#endif
1144#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1145 pair<iterator, bool> try_emplace(const KEY& key);
1146#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1147
1148#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1149 template <class Args_01>
1150 pair<iterator, bool> try_emplace(const KEY& key,
1151 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
1152#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1153
1154#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1155 template <class Args_01,
1156 class Args_02>
1157 pair<iterator, bool> try_emplace(const KEY& key,
1158 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1159 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
1160#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1161
1162#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1163 template <class Args_01,
1164 class Args_02,
1165 class Args_03>
1166 pair<iterator, bool> try_emplace(const KEY& key,
1167 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1168 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1169 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
1170#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1171
1172#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1173 template <class Args_01,
1174 class Args_02,
1175 class Args_03,
1176 class Args_04>
1177 pair<iterator, bool> try_emplace(const KEY& key,
1178 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1179 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1180 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1181 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
1182#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1183
1184#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1185 template <class Args_01,
1186 class Args_02,
1187 class Args_03,
1188 class Args_04,
1189 class Args_05>
1190 pair<iterator, bool> try_emplace(const KEY& key,
1191 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1192 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1193 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1194 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1195 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
1196#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1197
1198#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1199 template <class Args_01,
1200 class Args_02,
1201 class Args_03,
1202 class Args_04,
1203 class Args_05,
1204 class Args_06>
1205 pair<iterator, bool> try_emplace(const KEY& key,
1206 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1207 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1208 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1209 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1210 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1211 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
1212#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1213
1214#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1215 template <class Args_01,
1216 class Args_02,
1217 class Args_03,
1218 class Args_04,
1219 class Args_05,
1220 class Args_06,
1221 class Args_07>
1222 pair<iterator, bool> try_emplace(const KEY& key,
1223 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1224 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1225 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1226 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1227 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1228 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1229 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
1230#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1231
1232#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1233 template <class Args_01,
1234 class Args_02,
1235 class Args_03,
1236 class Args_04,
1237 class Args_05,
1238 class Args_06,
1239 class Args_07,
1240 class Args_08>
1241 pair<iterator, bool> try_emplace(const KEY& key,
1242 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1243 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1244 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1245 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1246 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1247 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1248 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1249 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
1250#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1251
1252#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1253 template <class Args_01,
1254 class Args_02,
1255 class Args_03,
1256 class Args_04,
1257 class Args_05,
1258 class Args_06,
1259 class Args_07,
1260 class Args_08,
1261 class Args_09>
1262 pair<iterator, bool> try_emplace(const KEY& key,
1263 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1264 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1265 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1266 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1267 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1268 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1269 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1270 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1271 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
1272#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1273
1274#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1275 template <class Args_01,
1276 class Args_02,
1277 class Args_03,
1278 class Args_04,
1279 class Args_05,
1280 class Args_06,
1281 class Args_07,
1282 class Args_08,
1283 class Args_09,
1284 class Args_10>
1285 pair<iterator, bool> try_emplace(const KEY& key,
1286 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1287 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1288 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1289 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1290 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1291 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1292 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1293 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1294 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1295 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
1296#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1297
1298#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1299 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key);
1300#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1301
1302#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1303 template <class Args_01>
1304 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1305 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
1306#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1307
1308#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1309 template <class Args_01,
1310 class Args_02>
1311 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1312 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1313 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
1314#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1315
1316#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1317 template <class Args_01,
1318 class Args_02,
1319 class Args_03>
1320 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1321 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1322 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1323 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
1324#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1325
1326#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1327 template <class Args_01,
1328 class Args_02,
1329 class Args_03,
1330 class Args_04>
1331 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1334 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
1336#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1337
1338#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1339 template <class Args_01,
1340 class Args_02,
1341 class Args_03,
1342 class Args_04,
1343 class Args_05>
1344 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1345 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1346 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
1350#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1351
1352#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1353 template <class Args_01,
1354 class Args_02,
1355 class Args_03,
1356 class Args_04,
1357 class Args_05,
1358 class Args_06>
1359 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1360 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1361 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1362 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1363 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1364 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1365 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
1366#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1367
1368#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1369 template <class Args_01,
1370 class Args_02,
1371 class Args_03,
1372 class Args_04,
1373 class Args_05,
1374 class Args_06,
1375 class Args_07>
1376 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1377 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1378 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1379 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1380 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1381 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1382 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1383 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
1384#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1385
1386#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1387 template <class Args_01,
1388 class Args_02,
1389 class Args_03,
1390 class Args_04,
1391 class Args_05,
1392 class Args_06,
1393 class Args_07,
1394 class Args_08>
1395 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1396 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1397 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1398 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1399 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1400 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1401 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1402 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1403 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
1404#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1405
1406#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1407 template <class Args_01,
1408 class Args_02,
1409 class Args_03,
1410 class Args_04,
1411 class Args_05,
1412 class Args_06,
1413 class Args_07,
1414 class Args_08,
1415 class Args_09>
1416 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1417 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1418 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1419 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1420 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1421 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1422 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1423 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1424 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1425 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
1426#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1427
1428#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1429 template <class Args_01,
1430 class Args_02,
1431 class Args_03,
1432 class Args_04,
1433 class Args_05,
1434 class Args_06,
1435 class Args_07,
1436 class Args_08,
1437 class Args_09,
1438 class Args_10>
1439 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1441 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1442 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1443 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1444 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1445 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1446 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
1447 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
1448 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
1449 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
1450#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1451
1452#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1453 template<class LOOKUP_KEY>
1454 typename bsl::enable_if<
1455 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1456 LOOKUP_KEY>::value &&
1458 const_iterator>::value &&
1460 iterator>::value,
1461 pair<iterator, bool> >::type
1463 {
1464 const LOOKUP_KEY& lvalue = key;
1465
1466 int comparisonResult;
1467 BloombergLP::bslalg::RbTreeNode *insertLocation =
1468 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1469 &comparisonResult,
1470 &d_tree,
1471 this->comparator(),
1472 lvalue);
1473 if (!comparisonResult) {
1474 return pair<iterator, bool>(
1475 iterator(insertLocation), false);
1476 }
1477
1478 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1479 BloombergLP::bslalg::RbTreeNode *node =
1480 nodeFactory().emplaceIntoNewNode(
1481 std::piecewise_construct,
1482 std::forward_as_tuple(
1484 key)),
1485 std::forward_as_tuple());
1486 #else
1487 BloombergLP::bslalg::RbTreeNode *node =
1488 nodeFactory().emplaceIntoNewNode(
1489 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1490 mapped_type());
1491 #endif
1492
1493 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1494 insertLocation,
1495 comparisonResult < 0,
1496 node);
1497
1498 return pair<iterator, bool>(iterator(node), true);
1499 }
1500#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1501
1502#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1503 template<class LOOKUP_KEY, class Args_01>
1504 typename bsl::enable_if<
1505 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1506 LOOKUP_KEY>::value &&
1508 const_iterator>::value &&
1510 iterator>::value,
1511 pair<iterator, bool> >::type
1513 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
1514 {
1515 const LOOKUP_KEY& lvalue = key;
1516
1517 int comparisonResult;
1518 BloombergLP::bslalg::RbTreeNode *insertLocation =
1519 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1520 &comparisonResult,
1521 &d_tree,
1522 this->comparator(),
1523 lvalue);
1524 if (!comparisonResult) {
1525 return pair<iterator, bool>(
1526 iterator(insertLocation), false);
1527 }
1528
1529 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1530 BloombergLP::bslalg::RbTreeNode *node =
1531 nodeFactory().emplaceIntoNewNode(
1532 std::piecewise_construct,
1533 std::forward_as_tuple(
1535 key)),
1536 std::forward_as_tuple(
1538 args_01)));
1539 #else
1540 BloombergLP::bslalg::RbTreeNode *node =
1541 nodeFactory().emplaceIntoNewNode(
1542 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1544 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
1545 #endif
1546
1547 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1548 insertLocation,
1549 comparisonResult < 0,
1550 node);
1551
1552 return pair<iterator, bool>(iterator(node), true);
1553 }
1554#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1555
1556#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1557 template<class LOOKUP_KEY, class Args_01,
1558 class Args_02>
1559 typename bsl::enable_if<
1560 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1561 LOOKUP_KEY>::value &&
1563 const_iterator>::value &&
1565 iterator>::value,
1566 pair<iterator, bool> >::type
1568 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1569 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
1570 {
1571 const LOOKUP_KEY& lvalue = key;
1572
1573 int comparisonResult;
1574 BloombergLP::bslalg::RbTreeNode *insertLocation =
1575 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1576 &comparisonResult,
1577 &d_tree,
1578 this->comparator(),
1579 lvalue);
1580 if (!comparisonResult) {
1581 return pair<iterator, bool>(
1582 iterator(insertLocation), false);
1583 }
1584
1585 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1586 BloombergLP::bslalg::RbTreeNode *node =
1587 nodeFactory().emplaceIntoNewNode(
1588 std::piecewise_construct,
1589 std::forward_as_tuple(
1591 key)),
1592 std::forward_as_tuple(
1594 args_01),
1596 args_02)));
1597 #else
1598 BloombergLP::bslalg::RbTreeNode *node =
1599 nodeFactory().emplaceIntoNewNode(
1600 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1602 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1603 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
1604 #endif
1605
1606 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1607 insertLocation,
1608 comparisonResult < 0,
1609 node);
1610
1611 return pair<iterator, bool>(iterator(node), true);
1612 }
1613#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1614
1615#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1616 template<class LOOKUP_KEY, class Args_01,
1617 class Args_02,
1618 class Args_03>
1619 typename bsl::enable_if<
1620 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1621 LOOKUP_KEY>::value &&
1623 const_iterator>::value &&
1625 iterator>::value,
1626 pair<iterator, bool> >::type
1628 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1629 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1630 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
1631 {
1632 const LOOKUP_KEY& lvalue = key;
1633
1634 int comparisonResult;
1635 BloombergLP::bslalg::RbTreeNode *insertLocation =
1636 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1637 &comparisonResult,
1638 &d_tree,
1639 this->comparator(),
1640 lvalue);
1641 if (!comparisonResult) {
1642 return pair<iterator, bool>(
1643 iterator(insertLocation), false);
1644 }
1645
1646 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1647 BloombergLP::bslalg::RbTreeNode *node =
1648 nodeFactory().emplaceIntoNewNode(
1649 std::piecewise_construct,
1650 std::forward_as_tuple(
1652 key)),
1653 std::forward_as_tuple(
1655 args_01),
1657 args_02),
1659 args_03)));
1660 #else
1661 BloombergLP::bslalg::RbTreeNode *node =
1662 nodeFactory().emplaceIntoNewNode(
1663 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1665 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1666 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1667 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
1668 #endif
1669
1670 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1671 insertLocation,
1672 comparisonResult < 0,
1673 node);
1674
1675 return pair<iterator, bool>(iterator(node), true);
1676 }
1677#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1678
1679#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1680 template<class LOOKUP_KEY, class Args_01,
1681 class Args_02,
1682 class Args_03,
1683 class Args_04>
1684 typename bsl::enable_if<
1685 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1686 LOOKUP_KEY>::value &&
1688 const_iterator>::value &&
1690 iterator>::value,
1691 pair<iterator, bool> >::type
1693 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1694 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1695 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1696 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
1697 {
1698 const LOOKUP_KEY& lvalue = key;
1699
1700 int comparisonResult;
1701 BloombergLP::bslalg::RbTreeNode *insertLocation =
1702 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1703 &comparisonResult,
1704 &d_tree,
1705 this->comparator(),
1706 lvalue);
1707 if (!comparisonResult) {
1708 return pair<iterator, bool>(
1709 iterator(insertLocation), false);
1710 }
1711
1712 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1713 BloombergLP::bslalg::RbTreeNode *node =
1714 nodeFactory().emplaceIntoNewNode(
1715 std::piecewise_construct,
1716 std::forward_as_tuple(
1718 key)),
1719 std::forward_as_tuple(
1721 args_01),
1723 args_02),
1725 args_03),
1727 args_04)));
1728 #else
1729 BloombergLP::bslalg::RbTreeNode *node =
1730 nodeFactory().emplaceIntoNewNode(
1731 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1733 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1734 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1735 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1736 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
1737 #endif
1738
1739 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1740 insertLocation,
1741 comparisonResult < 0,
1742 node);
1743
1744 return pair<iterator, bool>(iterator(node), true);
1745 }
1746#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1747
1748#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1749 template<class LOOKUP_KEY, class Args_01,
1750 class Args_02,
1751 class Args_03,
1752 class Args_04,
1753 class Args_05>
1754 typename bsl::enable_if<
1755 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1756 LOOKUP_KEY>::value &&
1758 const_iterator>::value &&
1760 iterator>::value,
1761 pair<iterator, bool> >::type
1763 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1764 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1765 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1766 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1767 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
1768 {
1769 const LOOKUP_KEY& lvalue = key;
1770
1771 int comparisonResult;
1772 BloombergLP::bslalg::RbTreeNode *insertLocation =
1773 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1774 &comparisonResult,
1775 &d_tree,
1776 this->comparator(),
1777 lvalue);
1778 if (!comparisonResult) {
1779 return pair<iterator, bool>(
1780 iterator(insertLocation), false);
1781 }
1782
1783 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1784 BloombergLP::bslalg::RbTreeNode *node =
1785 nodeFactory().emplaceIntoNewNode(
1786 std::piecewise_construct,
1787 std::forward_as_tuple(
1789 key)),
1790 std::forward_as_tuple(
1792 args_01),
1794 args_02),
1796 args_03),
1798 args_04),
1800 args_05)));
1801 #else
1802 BloombergLP::bslalg::RbTreeNode *node =
1803 nodeFactory().emplaceIntoNewNode(
1804 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1806 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1807 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1808 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1809 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
1810 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
1811 #endif
1812
1813 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1814 insertLocation,
1815 comparisonResult < 0,
1816 node);
1817
1818 return pair<iterator, bool>(iterator(node), true);
1819 }
1820#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1821
1822#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
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 typename bsl::enable_if<
1830 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1831 LOOKUP_KEY>::value &&
1833 const_iterator>::value &&
1835 iterator>::value,
1836 pair<iterator, bool> >::type
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 {
1845 const LOOKUP_KEY& lvalue = key;
1846
1847 int comparisonResult;
1848 BloombergLP::bslalg::RbTreeNode *insertLocation =
1849 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1850 &comparisonResult,
1851 &d_tree,
1852 this->comparator(),
1853 lvalue);
1854 if (!comparisonResult) {
1855 return pair<iterator, bool>(
1856 iterator(insertLocation), false);
1857 }
1858
1859 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1860 BloombergLP::bslalg::RbTreeNode *node =
1861 nodeFactory().emplaceIntoNewNode(
1862 std::piecewise_construct,
1863 std::forward_as_tuple(
1865 key)),
1866 std::forward_as_tuple(
1868 args_01),
1870 args_02),
1872 args_03),
1874 args_04),
1876 args_05),
1878 args_06)));
1879 #else
1880 BloombergLP::bslalg::RbTreeNode *node =
1881 nodeFactory().emplaceIntoNewNode(
1882 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1884 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1885 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1886 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1887 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
1888 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
1889 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
1890 #endif
1891
1892 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1893 insertLocation,
1894 comparisonResult < 0,
1895 node);
1896
1897 return pair<iterator, bool>(iterator(node), true);
1898 }
1899#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1900
1901#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1902 template<class LOOKUP_KEY, class Args_01,
1903 class Args_02,
1904 class Args_03,
1905 class Args_04,
1906 class Args_05,
1907 class Args_06,
1908 class Args_07>
1909 typename bsl::enable_if<
1910 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1911 LOOKUP_KEY>::value &&
1913 const_iterator>::value &&
1915 iterator>::value,
1916 pair<iterator, bool> >::type
1918 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
1919 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
1920 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
1921 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
1922 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
1923 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
1924 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
1925 {
1926 const LOOKUP_KEY& lvalue = key;
1927
1928 int comparisonResult;
1929 BloombergLP::bslalg::RbTreeNode *insertLocation =
1930 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1931 &comparisonResult,
1932 &d_tree,
1933 this->comparator(),
1934 lvalue);
1935 if (!comparisonResult) {
1936 return pair<iterator, bool>(
1937 iterator(insertLocation), false);
1938 }
1939
1940 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1941 BloombergLP::bslalg::RbTreeNode *node =
1942 nodeFactory().emplaceIntoNewNode(
1943 std::piecewise_construct,
1944 std::forward_as_tuple(
1946 key)),
1947 std::forward_as_tuple(
1949 args_01),
1951 args_02),
1953 args_03),
1955 args_04),
1957 args_05),
1959 args_06),
1961 args_07)));
1962 #else
1963 BloombergLP::bslalg::RbTreeNode *node =
1964 nodeFactory().emplaceIntoNewNode(
1965 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
1967 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
1968 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
1969 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
1970 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
1971 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
1972 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
1973 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
1974 #endif
1975
1976 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1977 insertLocation,
1978 comparisonResult < 0,
1979 node);
1980
1981 return pair<iterator, bool>(iterator(node), true);
1982 }
1983#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1984
1985#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1986 template<class LOOKUP_KEY, class Args_01,
1987 class Args_02,
1988 class Args_03,
1989 class Args_04,
1990 class Args_05,
1991 class Args_06,
1992 class Args_07,
1993 class Args_08>
1994 typename bsl::enable_if<
1995 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1996 LOOKUP_KEY>::value &&
1998 const_iterator>::value &&
2000 iterator>::value,
2001 pair<iterator, bool> >::type
2003 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2004 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2005 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2006 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2007 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2008 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2009 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2010 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
2011 {
2012 const LOOKUP_KEY& lvalue = key;
2013
2014 int comparisonResult;
2015 BloombergLP::bslalg::RbTreeNode *insertLocation =
2016 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2017 &comparisonResult,
2018 &d_tree,
2019 this->comparator(),
2020 lvalue);
2021 if (!comparisonResult) {
2022 return pair<iterator, bool>(
2023 iterator(insertLocation), false);
2024 }
2025
2026 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2027 BloombergLP::bslalg::RbTreeNode *node =
2028 nodeFactory().emplaceIntoNewNode(
2029 std::piecewise_construct,
2030 std::forward_as_tuple(
2032 key)),
2033 std::forward_as_tuple(
2035 args_01),
2037 args_02),
2039 args_03),
2041 args_04),
2043 args_05),
2045 args_06),
2047 args_07),
2049 args_08)));
2050 #else
2051 BloombergLP::bslalg::RbTreeNode *node =
2052 nodeFactory().emplaceIntoNewNode(
2053 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2055 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2056 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2057 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2058 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2059 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2060 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2061 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2062 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
2063 #endif
2064
2065 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2066 insertLocation,
2067 comparisonResult < 0,
2068 node);
2069
2070 return pair<iterator, bool>(iterator(node), true);
2071 }
2072#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
2073
2074#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2075 template<class LOOKUP_KEY, class Args_01,
2076 class Args_02,
2077 class Args_03,
2078 class Args_04,
2079 class Args_05,
2080 class Args_06,
2081 class Args_07,
2082 class Args_08,
2083 class Args_09>
2084 typename bsl::enable_if<
2085 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2086 LOOKUP_KEY>::value &&
2088 const_iterator>::value &&
2090 iterator>::value,
2091 pair<iterator, bool> >::type
2093 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2094 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2095 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2096 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2097 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2098 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2099 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2100 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2101 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
2102 {
2103 const LOOKUP_KEY& lvalue = key;
2104
2105 int comparisonResult;
2106 BloombergLP::bslalg::RbTreeNode *insertLocation =
2107 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2108 &comparisonResult,
2109 &d_tree,
2110 this->comparator(),
2111 lvalue);
2112 if (!comparisonResult) {
2113 return pair<iterator, bool>(
2114 iterator(insertLocation), false);
2115 }
2116
2117 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2118 BloombergLP::bslalg::RbTreeNode *node =
2119 nodeFactory().emplaceIntoNewNode(
2120 std::piecewise_construct,
2121 std::forward_as_tuple(
2123 key)),
2124 std::forward_as_tuple(
2126 args_01),
2128 args_02),
2130 args_03),
2132 args_04),
2134 args_05),
2136 args_06),
2138 args_07),
2140 args_08),
2142 args_09)));
2143 #else
2144 BloombergLP::bslalg::RbTreeNode *node =
2145 nodeFactory().emplaceIntoNewNode(
2146 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2148 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2149 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2150 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2151 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2152 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2153 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2154 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2155 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2156 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
2157 #endif
2158
2159 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2160 insertLocation,
2161 comparisonResult < 0,
2162 node);
2163
2164 return pair<iterator, bool>(iterator(node), true);
2165 }
2166#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2167
2168#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2169 template<class LOOKUP_KEY, class Args_01,
2170 class Args_02,
2171 class Args_03,
2172 class Args_04,
2173 class Args_05,
2174 class Args_06,
2175 class Args_07,
2176 class Args_08,
2177 class Args_09,
2178 class Args_10>
2179 typename bsl::enable_if<
2180 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2181 LOOKUP_KEY>::value &&
2183 const_iterator>::value &&
2185 iterator>::value,
2186 pair<iterator, bool> >::type
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 {
2199 const LOOKUP_KEY& lvalue = key;
2200
2201 int comparisonResult;
2202 BloombergLP::bslalg::RbTreeNode *insertLocation =
2203 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2204 &comparisonResult,
2205 &d_tree,
2206 this->comparator(),
2207 lvalue);
2208 if (!comparisonResult) {
2209 return pair<iterator, bool>(
2210 iterator(insertLocation), false);
2211 }
2212
2213 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2214 BloombergLP::bslalg::RbTreeNode *node =
2215 nodeFactory().emplaceIntoNewNode(
2216 std::piecewise_construct,
2217 std::forward_as_tuple(
2219 key)),
2220 std::forward_as_tuple(
2222 args_01),
2224 args_02),
2226 args_03),
2228 args_04),
2230 args_05),
2232 args_06),
2234 args_07),
2236 args_08),
2238 args_09),
2240 args_10)));
2241 #else
2242 BloombergLP::bslalg::RbTreeNode *node =
2243 nodeFactory().emplaceIntoNewNode(
2244 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2246 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2247 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2248 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2249 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2250 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
2251 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
2252 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
2253 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
2254 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
2255 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
2256 #endif
2257
2258 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2259 insertLocation,
2260 comparisonResult < 0,
2261 node);
2262
2263 return pair<iterator, bool>(iterator(node), true);
2264 }
2265#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2266
2267
2268#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2269 iterator try_emplace(const_iterator hint, const KEY& key);
2270#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2271
2272#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2273 template<class Args_01>
2274 iterator try_emplace(const_iterator hint, const KEY& key,
2275 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
2276#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2277
2278#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2279 template<class Args_01,
2280 class Args_02>
2281 iterator try_emplace(const_iterator hint, const KEY& key,
2282 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2283 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
2284#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2285
2286#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2287 template<class Args_01,
2288 class Args_02,
2289 class Args_03>
2290 iterator try_emplace(const_iterator hint, const KEY& key,
2291 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2292 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2293 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
2294#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2295
2296#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2297 template<class Args_01,
2298 class Args_02,
2299 class Args_03,
2300 class Args_04>
2301 iterator try_emplace(const_iterator hint, const KEY& key,
2302 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2303 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2304 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2305 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
2306#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2307
2308#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2309 template<class Args_01,
2310 class Args_02,
2311 class Args_03,
2312 class Args_04,
2313 class Args_05>
2314 iterator try_emplace(const_iterator hint, const KEY& key,
2315 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2316 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2317 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2318 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2319 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
2320#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2321
2322#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
2323 template<class Args_01,
2324 class Args_02,
2325 class Args_03,
2326 class Args_04,
2327 class Args_05,
2328 class Args_06>
2329 iterator try_emplace(const_iterator hint, const KEY& key,
2330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2334 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
2336#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
2337
2338#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
2339 template<class Args_01,
2340 class Args_02,
2341 class Args_03,
2342 class Args_04,
2343 class Args_05,
2344 class Args_06,
2345 class Args_07>
2346 iterator try_emplace(const_iterator hint, const KEY& key,
2347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2351 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2352 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
2354#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
2355
2356#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
2357 template<class Args_01,
2358 class Args_02,
2359 class Args_03,
2360 class Args_04,
2361 class Args_05,
2362 class Args_06,
2363 class Args_07,
2364 class Args_08>
2365 iterator try_emplace(const_iterator hint, const KEY& key,
2366 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2367 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2368 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2369 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2370 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2371 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2372 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2373 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
2374#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
2375
2376#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2377 template<class Args_01,
2378 class Args_02,
2379 class Args_03,
2380 class Args_04,
2381 class Args_05,
2382 class Args_06,
2383 class Args_07,
2384 class Args_08,
2385 class Args_09>
2386 iterator try_emplace(const_iterator hint, const KEY& key,
2387 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2388 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2389 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2390 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2391 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2392 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2393 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2394 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2395 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
2396#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2397
2398#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2399 template<class Args_01,
2400 class Args_02,
2401 class Args_03,
2402 class Args_04,
2403 class Args_05,
2404 class Args_06,
2405 class Args_07,
2406 class Args_08,
2407 class Args_09,
2408 class Args_10>
2409 iterator try_emplace(const_iterator hint, const KEY& key,
2410 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2411 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2412 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2413 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2414 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2415 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2416 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2417 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2418 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2419 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
2420#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2421
2422#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2424 BloombergLP::bslmf::MovableRef<KEY> key);
2425#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2426
2427#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2428 template <class Args_01>
2430 BloombergLP::bslmf::MovableRef<KEY> key,
2431 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01);
2432#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2433
2434#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2435 template <class Args_01,
2436 class Args_02>
2438 BloombergLP::bslmf::MovableRef<KEY> key,
2439 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2440 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02);
2441#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2442
2443#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2444 template <class Args_01,
2445 class Args_02,
2446 class Args_03>
2448 BloombergLP::bslmf::MovableRef<KEY> key,
2449 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2450 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2451 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03);
2452#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2453
2454#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2455 template <class Args_01,
2456 class Args_02,
2457 class Args_03,
2458 class Args_04>
2460 BloombergLP::bslmf::MovableRef<KEY> key,
2461 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2462 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2463 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04);
2465#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2466
2467#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2468 template <class Args_01,
2469 class Args_02,
2470 class Args_03,
2471 class Args_04,
2472 class Args_05>
2474 BloombergLP::bslmf::MovableRef<KEY> key,
2475 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2476 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2477 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2478 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2479 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05);
2480#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2481
2482#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
2483 template <class Args_01,
2484 class Args_02,
2485 class Args_03,
2486 class Args_04,
2487 class Args_05,
2488 class Args_06>
2490 BloombergLP::bslmf::MovableRef<KEY> key,
2491 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2492 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2493 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2494 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2495 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2496 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06);
2497#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
2498
2499#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
2500 template <class Args_01,
2501 class Args_02,
2502 class Args_03,
2503 class Args_04,
2504 class Args_05,
2505 class Args_06,
2506 class Args_07>
2508 BloombergLP::bslmf::MovableRef<KEY> key,
2509 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2510 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2511 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2512 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2513 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2514 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2515 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07);
2516#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
2517
2518#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
2519 template <class Args_01,
2520 class Args_02,
2521 class Args_03,
2522 class Args_04,
2523 class Args_05,
2524 class Args_06,
2525 class Args_07,
2526 class Args_08>
2528 BloombergLP::bslmf::MovableRef<KEY> key,
2529 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2530 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2531 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2532 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2533 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2534 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2535 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2536 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08);
2537#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
2538
2539#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2540 template <class Args_01,
2541 class Args_02,
2542 class Args_03,
2543 class Args_04,
2544 class Args_05,
2545 class Args_06,
2546 class Args_07,
2547 class Args_08,
2548 class Args_09>
2550 BloombergLP::bslmf::MovableRef<KEY> key,
2551 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2552 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2553 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2554 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2555 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2556 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2557 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2558 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2559 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09);
2560#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
2561
2562#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2563 template <class Args_01,
2564 class Args_02,
2565 class Args_03,
2566 class Args_04,
2567 class Args_05,
2568 class Args_06,
2569 class Args_07,
2570 class Args_08,
2571 class Args_09,
2572 class Args_10>
2574 BloombergLP::bslmf::MovableRef<KEY> key,
2575 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2576 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2577 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2578 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2579 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2580 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
2581 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
2582 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
2583 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
2584 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10);
2585#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
2586
2587#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2588 template<class LOOKUP_KEY>
2589 typename bsl::enable_if<
2590 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2591 LOOKUP_KEY>::value,
2592 iterator>::type
2594 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key)
2595 {
2596 const LOOKUP_KEY& lvalue = key;
2597
2598 BloombergLP::bslalg::RbTreeNode *hintNode =
2599 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2600
2601 int comparisonResult;
2602 BloombergLP::bslalg::RbTreeNode *insertLocation =
2603 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2604 &comparisonResult,
2605 &d_tree,
2606 this->comparator(),
2607 lvalue,
2608 hintNode);
2609
2610 if (!comparisonResult) {
2611 return iterator(insertLocation);
2612 }
2613
2614 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2615 BloombergLP::bslalg::RbTreeNode *node =
2616 nodeFactory().emplaceIntoNewNode(
2617 std::piecewise_construct,
2618 std::forward_as_tuple(
2620 key)),
2621 std::forward_as_tuple());
2622 #else
2623 BloombergLP::bslalg::RbTreeNode *node =
2624 nodeFactory().emplaceIntoNewNode(
2625 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2626 mapped_type());
2627 #endif
2628
2629 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2630 insertLocation,
2631 comparisonResult < 0,
2632 node);
2633
2634 return iterator(node);
2635 }
2636#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
2637
2638#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2639 template<class LOOKUP_KEY, class Args_01>
2640 typename bsl::enable_if<
2641 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2642 LOOKUP_KEY>::value,
2643 iterator>::type
2645 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2646 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
2647 {
2648 const LOOKUP_KEY& lvalue = key;
2649
2650 BloombergLP::bslalg::RbTreeNode *hintNode =
2651 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2652
2653 int comparisonResult;
2654 BloombergLP::bslalg::RbTreeNode *insertLocation =
2655 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2656 &comparisonResult,
2657 &d_tree,
2658 this->comparator(),
2659 lvalue,
2660 hintNode);
2661
2662 if (!comparisonResult) {
2663 return iterator(insertLocation);
2664 }
2665
2666 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2667 BloombergLP::bslalg::RbTreeNode *node =
2668 nodeFactory().emplaceIntoNewNode(
2669 std::piecewise_construct,
2670 std::forward_as_tuple(
2672 key)),
2673 std::forward_as_tuple(
2675 args_01)));
2676 #else
2677 BloombergLP::bslalg::RbTreeNode *node =
2678 nodeFactory().emplaceIntoNewNode(
2679 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2681 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
2682 #endif
2683
2684 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2685 insertLocation,
2686 comparisonResult < 0,
2687 node);
2688
2689 return iterator(node);
2690 }
2691#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
2692
2693#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2694 template<class LOOKUP_KEY, class Args_01,
2695 class Args_02>
2696 typename bsl::enable_if<
2697 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2698 LOOKUP_KEY>::value,
2699 iterator>::type
2701 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2702 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2703 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
2704 {
2705 const LOOKUP_KEY& lvalue = key;
2706
2707 BloombergLP::bslalg::RbTreeNode *hintNode =
2708 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2709
2710 int comparisonResult;
2711 BloombergLP::bslalg::RbTreeNode *insertLocation =
2712 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2713 &comparisonResult,
2714 &d_tree,
2715 this->comparator(),
2716 lvalue,
2717 hintNode);
2718
2719 if (!comparisonResult) {
2720 return iterator(insertLocation);
2721 }
2722
2723 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2724 BloombergLP::bslalg::RbTreeNode *node =
2725 nodeFactory().emplaceIntoNewNode(
2726 std::piecewise_construct,
2727 std::forward_as_tuple(
2729 key)),
2730 std::forward_as_tuple(
2732 args_01),
2734 args_02)));
2735 #else
2736 BloombergLP::bslalg::RbTreeNode *node =
2737 nodeFactory().emplaceIntoNewNode(
2738 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2740 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2741 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
2742 #endif
2743
2744 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2745 insertLocation,
2746 comparisonResult < 0,
2747 node);
2748
2749 return iterator(node);
2750 }
2751#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
2752
2753#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2754 template<class LOOKUP_KEY, class Args_01,
2755 class Args_02,
2756 class Args_03>
2757 typename bsl::enable_if<
2758 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2759 LOOKUP_KEY>::value,
2760 iterator>::type
2762 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2763 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2764 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2765 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
2766 {
2767 const LOOKUP_KEY& lvalue = key;
2768
2769 BloombergLP::bslalg::RbTreeNode *hintNode =
2770 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2771
2772 int comparisonResult;
2773 BloombergLP::bslalg::RbTreeNode *insertLocation =
2774 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2775 &comparisonResult,
2776 &d_tree,
2777 this->comparator(),
2778 lvalue,
2779 hintNode);
2780
2781 if (!comparisonResult) {
2782 return iterator(insertLocation);
2783 }
2784
2785 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2786 BloombergLP::bslalg::RbTreeNode *node =
2787 nodeFactory().emplaceIntoNewNode(
2788 std::piecewise_construct,
2789 std::forward_as_tuple(
2791 key)),
2792 std::forward_as_tuple(
2794 args_01),
2796 args_02),
2798 args_03)));
2799 #else
2800 BloombergLP::bslalg::RbTreeNode *node =
2801 nodeFactory().emplaceIntoNewNode(
2802 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2804 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2805 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2806 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
2807 #endif
2808
2809 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2810 insertLocation,
2811 comparisonResult < 0,
2812 node);
2813
2814 return iterator(node);
2815 }
2816#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
2817
2818#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2819 template<class LOOKUP_KEY, class Args_01,
2820 class Args_02,
2821 class Args_03,
2822 class Args_04>
2823 typename bsl::enable_if<
2824 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2825 LOOKUP_KEY>::value,
2826 iterator>::type
2828 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2829 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2830 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2831 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2832 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
2833 {
2834 const LOOKUP_KEY& lvalue = key;
2835
2836 BloombergLP::bslalg::RbTreeNode *hintNode =
2837 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2838
2839 int comparisonResult;
2840 BloombergLP::bslalg::RbTreeNode *insertLocation =
2841 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2842 &comparisonResult,
2843 &d_tree,
2844 this->comparator(),
2845 lvalue,
2846 hintNode);
2847
2848 if (!comparisonResult) {
2849 return iterator(insertLocation);
2850 }
2851
2852 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2853 BloombergLP::bslalg::RbTreeNode *node =
2854 nodeFactory().emplaceIntoNewNode(
2855 std::piecewise_construct,
2856 std::forward_as_tuple(
2858 key)),
2859 std::forward_as_tuple(
2861 args_01),
2863 args_02),
2865 args_03),
2867 args_04)));
2868 #else
2869 BloombergLP::bslalg::RbTreeNode *node =
2870 nodeFactory().emplaceIntoNewNode(
2871 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2873 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2874 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2875 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2876 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
2877 #endif
2878
2879 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2880 insertLocation,
2881 comparisonResult < 0,
2882 node);
2883
2884 return iterator(node);
2885 }
2886#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
2887
2888#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2889 template<class LOOKUP_KEY, class Args_01,
2890 class Args_02,
2891 class Args_03,
2892 class Args_04,
2893 class Args_05>
2894 typename bsl::enable_if<
2895 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2896 LOOKUP_KEY>::value,
2897 iterator>::type
2899 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2900 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2901 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2902 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2903 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2904 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
2905 {
2906 const LOOKUP_KEY& lvalue = key;
2907
2908 BloombergLP::bslalg::RbTreeNode *hintNode =
2909 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2910
2911 int comparisonResult;
2912 BloombergLP::bslalg::RbTreeNode *insertLocation =
2913 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2914 &comparisonResult,
2915 &d_tree,
2916 this->comparator(),
2917 lvalue,
2918 hintNode);
2919
2920 if (!comparisonResult) {
2921 return iterator(insertLocation);
2922 }
2923
2924 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2925 BloombergLP::bslalg::RbTreeNode *node =
2926 nodeFactory().emplaceIntoNewNode(
2927 std::piecewise_construct,
2928 std::forward_as_tuple(
2930 key)),
2931 std::forward_as_tuple(
2933 args_01),
2935 args_02),
2937 args_03),
2939 args_04),
2941 args_05)));
2942 #else
2943 BloombergLP::bslalg::RbTreeNode *node =
2944 nodeFactory().emplaceIntoNewNode(
2945 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
2947 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
2948 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
2949 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
2950 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
2951 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
2952 #endif
2953
2954 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2955 insertLocation,
2956 comparisonResult < 0,
2957 node);
2958
2959 return iterator(node);
2960 }
2961#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
2962
2963#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
2964 template<class LOOKUP_KEY, class Args_01,
2965 class Args_02,
2966 class Args_03,
2967 class Args_04,
2968 class Args_05,
2969 class Args_06>
2970 typename bsl::enable_if<
2971 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2972 LOOKUP_KEY>::value,
2973 iterator>::type
2975 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
2976 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
2977 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
2978 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
2979 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
2980 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
2981 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
2982 {
2983 const LOOKUP_KEY& lvalue = key;
2984
2985 BloombergLP::bslalg::RbTreeNode *hintNode =
2986 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
2987
2988 int comparisonResult;
2989 BloombergLP::bslalg::RbTreeNode *insertLocation =
2990 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2991 &comparisonResult,
2992 &d_tree,
2993 this->comparator(),
2994 lvalue,
2995 hintNode);
2996
2997 if (!comparisonResult) {
2998 return iterator(insertLocation);
2999 }
3000
3001 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3002 BloombergLP::bslalg::RbTreeNode *node =
3003 nodeFactory().emplaceIntoNewNode(
3004 std::piecewise_construct,
3005 std::forward_as_tuple(
3007 key)),
3008 std::forward_as_tuple(
3010 args_01),
3012 args_02),
3014 args_03),
3016 args_04),
3018 args_05),
3020 args_06)));
3021 #else
3022 BloombergLP::bslalg::RbTreeNode *node =
3023 nodeFactory().emplaceIntoNewNode(
3024 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3026 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
3027 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
3028 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
3029 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
3030 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
3031 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
3032 #endif
3033
3034 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3035 insertLocation,
3036 comparisonResult < 0,
3037 node);
3038
3039 return iterator(node);
3040 }
3041#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
3042
3043#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
3044 template<class LOOKUP_KEY, class Args_01,
3045 class Args_02,
3046 class Args_03,
3047 class Args_04,
3048 class Args_05,
3049 class Args_06,
3050 class Args_07>
3051 typename bsl::enable_if<
3052 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3053 LOOKUP_KEY>::value,
3054 iterator>::type
3056 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
3057 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
3058 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
3059 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
3060 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
3061 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
3062 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
3063 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
3064 {
3065 const LOOKUP_KEY& lvalue = key;
3066
3067 BloombergLP::bslalg::RbTreeNode *hintNode =
3068 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
3069
3070 int comparisonResult;
3071 BloombergLP::bslalg::RbTreeNode *insertLocation =
3072 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3073 &comparisonResult,
3074 &d_tree,
3075 this->comparator(),
3076 lvalue,
3077 hintNode);
3078
3079 if (!comparisonResult) {
3080 return iterator(insertLocation);
3081 }
3082
3083 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3084 BloombergLP::bslalg::RbTreeNode *node =
3085 nodeFactory().emplaceIntoNewNode(
3086 std::piecewise_construct,
3087 std::forward_as_tuple(
3089 key)),
3090 std::forward_as_tuple(
3092 args_01),
3094 args_02),
3096 args_03),
3098 args_04),
3100 args_05),
3102 args_06),
3104 args_07)));
3105 #else
3106 BloombergLP::bslalg::RbTreeNode *node =
3107 nodeFactory().emplaceIntoNewNode(
3108 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3110 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
3111 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
3112 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
3113 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
3114 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
3115 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
3116 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
3117 #endif
3118
3119 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3120 insertLocation,
3121 comparisonResult < 0,
3122 node);
3123
3124 return iterator(node);
3125 }
3126#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
3127
3128#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
3129 template<class LOOKUP_KEY, class Args_01,
3130 class Args_02,
3131 class Args_03,
3132 class Args_04,
3133 class Args_05,
3134 class Args_06,
3135 class Args_07,
3136 class Args_08>
3137 typename bsl::enable_if<
3138 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3139 LOOKUP_KEY>::value,
3140 iterator>::type
3142 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
3143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
3144 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
3145 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
3146 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
3147 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
3148 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
3149 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
3150 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
3151 {
3152 const LOOKUP_KEY& lvalue = key;
3153
3154 BloombergLP::bslalg::RbTreeNode *hintNode =
3155 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
3156
3157 int comparisonResult;
3158 BloombergLP::bslalg::RbTreeNode *insertLocation =
3159 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3160 &comparisonResult,
3161 &d_tree,
3162 this->comparator(),
3163 lvalue,
3164 hintNode);
3165
3166 if (!comparisonResult) {
3167 return iterator(insertLocation);
3168 }
3169
3170 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3171 BloombergLP::bslalg::RbTreeNode *node =
3172 nodeFactory().emplaceIntoNewNode(
3173 std::piecewise_construct,
3174 std::forward_as_tuple(
3176 key)),
3177 std::forward_as_tuple(
3179 args_01),
3181 args_02),
3183 args_03),
3185 args_04),
3187 args_05),
3189 args_06),
3191 args_07),
3193 args_08)));
3194 #else
3195 BloombergLP::bslalg::RbTreeNode *node =
3196 nodeFactory().emplaceIntoNewNode(
3197 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3199 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
3200 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
3201 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
3202 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
3203 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
3204 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
3205 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
3206 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
3207 #endif
3208
3209 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3210 insertLocation,
3211 comparisonResult < 0,
3212 node);
3213
3214 return iterator(node);
3215 }
3216#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
3217
3218#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
3219 template<class LOOKUP_KEY, class Args_01,
3220 class Args_02,
3221 class Args_03,
3222 class Args_04,
3223 class Args_05,
3224 class Args_06,
3225 class Args_07,
3226 class Args_08,
3227 class Args_09>
3228 typename bsl::enable_if<
3229 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3230 LOOKUP_KEY>::value,
3231 iterator>::type
3233 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
3234 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
3235 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
3236 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
3237 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
3238 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
3239 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
3240 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
3241 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
3242 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
3243 {
3244 const LOOKUP_KEY& lvalue = key;
3245
3246 BloombergLP::bslalg::RbTreeNode *hintNode =
3247 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
3248
3249 int comparisonResult;
3250 BloombergLP::bslalg::RbTreeNode *insertLocation =
3251 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3252 &comparisonResult,
3253 &d_tree,
3254 this->comparator(),
3255 lvalue,
3256 hintNode);
3257
3258 if (!comparisonResult) {
3259 return iterator(insertLocation);
3260 }
3261
3262 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3263 BloombergLP::bslalg::RbTreeNode *node =
3264 nodeFactory().emplaceIntoNewNode(
3265 std::piecewise_construct,
3266 std::forward_as_tuple(
3268 key)),
3269 std::forward_as_tuple(
3271 args_01),
3273 args_02),
3275 args_03),
3277 args_04),
3279 args_05),
3281 args_06),
3283 args_07),
3285 args_08),
3287 args_09)));
3288 #else
3289 BloombergLP::bslalg::RbTreeNode *node =
3290 nodeFactory().emplaceIntoNewNode(
3291 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3293 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
3294 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
3295 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
3296 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
3297 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
3298 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
3299 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
3300 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
3301 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
3302 #endif
3303
3304 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3305 insertLocation,
3306 comparisonResult < 0,
3307 node);
3308
3309 return iterator(node);
3310 }
3311#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
3312
3313#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
3314 template<class LOOKUP_KEY, class Args_01,
3315 class Args_02,
3316 class Args_03,
3317 class Args_04,
3318 class Args_05,
3319 class Args_06,
3320 class Args_07,
3321 class Args_08,
3322 class Args_09,
3323 class Args_10>
3324 typename bsl::enable_if<
3325 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3326 LOOKUP_KEY>::value,
3327 iterator>::type
3329 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
3330 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
3331 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
3332 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
3333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
3334 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
3335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
3336 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
3337 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
3338 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
3339 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
3340 {
3341 const LOOKUP_KEY& lvalue = key;
3342
3343 BloombergLP::bslalg::RbTreeNode *hintNode =
3344 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
3345
3346 int comparisonResult;
3347 BloombergLP::bslalg::RbTreeNode *insertLocation =
3348 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3349 &comparisonResult,
3350 &d_tree,
3351 this->comparator(),
3352 lvalue,
3353 hintNode);
3354
3355 if (!comparisonResult) {
3356 return iterator(insertLocation);
3357 }
3358
3359 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3360 BloombergLP::bslalg::RbTreeNode *node =
3361 nodeFactory().emplaceIntoNewNode(
3362 std::piecewise_construct,
3363 std::forward_as_tuple(
3365 key)),
3366 std::forward_as_tuple(
3368 args_01),
3370 args_02),
3372 args_03),
3374 args_04),
3376 args_05),
3378 args_06),
3380 args_07),
3382 args_08),
3384 args_09),
3386 args_10)));
3387 #else
3388 BloombergLP::bslalg::RbTreeNode *node =
3389 nodeFactory().emplaceIntoNewNode(
3390 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3392 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
3393 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
3394 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
3395 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
3396 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
3397 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
3398 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
3399 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
3400 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
3401 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
3402 #endif
3403
3404 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3405 insertLocation,
3406 comparisonResult < 0,
3407 node);
3408
3409 return iterator(node);
3410 }
3411#endif // BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
3412
3413#else
3414// The generated code below is a workaround for the absence of perfect
3415// forwarding in some compilers.
3416 template <class... Args>
3417 pair<iterator, bool> try_emplace(const KEY& key,
3418 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
3419 template <class... Args>
3420 pair<iterator, bool> try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
3421 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
3422 template<class LOOKUP_KEY, class... Args>
3423 typename bsl::enable_if<
3424 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3425 LOOKUP_KEY>::value &&
3427 const_iterator>::value &&
3429 iterator>::value,
3430 pair<iterator, bool> >::type
3433 {
3434 const LOOKUP_KEY& lvalue = key;
3435
3436 int comparisonResult;
3437 BloombergLP::bslalg::RbTreeNode *insertLocation =
3438 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3439 &comparisonResult,
3440 &d_tree,
3441 this->comparator(),
3442 lvalue);
3443 if (!comparisonResult) {
3444 return pair<iterator, bool>(
3445 iterator(insertLocation), false);
3446 }
3447
3448 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3449 BloombergLP::bslalg::RbTreeNode *node =
3450 nodeFactory().emplaceIntoNewNode(
3451 std::piecewise_construct,
3452 std::forward_as_tuple(
3454 key)),
3455 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args,
3456 args)...));
3457 #else
3458 BloombergLP::bslalg::RbTreeNode *node =
3459 nodeFactory().emplaceIntoNewNode(
3460 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3462 #endif
3463
3464 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3465 insertLocation,
3466 comparisonResult < 0,
3467 node);
3468
3469 return pair<iterator, bool>(iterator(node), true);
3470 }
3471
3472 template<class... Args>
3473 iterator try_emplace(const_iterator hint, const KEY& key,
3474 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
3475 template <class... Args>
3477 BloombergLP::bslmf::MovableRef<KEY> key,
3478 BSLS_COMPILERFEATURES_FORWARD_REF(Args)... args);
3479 template<class LOOKUP_KEY, class... Args>
3480 typename bsl::enable_if<
3481 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3482 LOOKUP_KEY>::value,
3483 iterator>::type
3485 BSLS_COMPILERFEATURES_FORWARD_REF(LOOKUP_KEY) key,
3487 {
3488 const LOOKUP_KEY& lvalue = key;
3489
3490 BloombergLP::bslalg::RbTreeNode *hintNode =
3491 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
3492
3493 int comparisonResult;
3494 BloombergLP::bslalg::RbTreeNode *insertLocation =
3495 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3496 &comparisonResult,
3497 &d_tree,
3498 this->comparator(),
3499 lvalue,
3500 hintNode);
3501
3502 if (!comparisonResult) {
3503 return iterator(insertLocation);
3504 }
3505
3506 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3507 BloombergLP::bslalg::RbTreeNode *node =
3508 nodeFactory().emplaceIntoNewNode(
3509 std::piecewise_construct,
3510 std::forward_as_tuple(
3512 key)),
3513 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args,
3514 args)...));
3515 #else
3516 BloombergLP::bslalg::RbTreeNode *node =
3517 nodeFactory().emplaceIntoNewNode(
3518 BSLS_COMPILERFEATURES_FORWARD(LOOKUP_KEY, key),
3520 #endif
3521
3522 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3523 insertLocation,
3524 comparisonResult < 0,
3525 node);
3526
3527 return iterator(node);
3528 }
3529// }}} END GENERATED CODE
3530#endif
3531
3532 /// Remove all entries from this map. Note that the map is empty after
3533 /// this call, but allocated memory may be retained for future use.
3535
3536 // Turn off complaints about necessarily class-defined methods.
3537 // BDE_VERIFY pragma: push
3538 // BDE_VERIFY pragma: -CD01
3539
3540 /// Return an iterator providing modifiable access to the `value_type`
3541 /// object in this map whose key is equivalent to the specified `key`,
3542 /// if such an entry exists, and the past-the-end (`end`) iterator
3543 /// otherwise.
3544 ///
3545 /// Note: implemented inline due to Sun CC compilation error.
3546 iterator find(const key_type& key)
3547 {
3548 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
3549 d_tree, this->comparator(), key));
3550 }
3551
3552 /// Return an iterator providing modifiable access to the `value_type`
3553 /// object in this map whose key is equivalent to the specified `key`,
3554 /// if such an entry exists, and the past-the-end (`end`) iterator
3555 /// otherwise.
3556 ///
3557 /// Note: implemented inline due to Sun CC compilation error.
3558 template <class LOOKUP_KEY>
3559 typename bsl::enable_if<
3560 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3561 LOOKUP_KEY>::value,
3562 iterator>::type
3563 find(const LOOKUP_KEY& key)
3564 {
3565 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
3566 d_tree, this->comparator(), key));
3567 }
3568
3569 /// Return an iterator providing modifiable access to the first (i.e.,
3570 /// ordered least) `value_type` object in this map whose key is
3571 /// greater-than or equal-to the specified `key`, and the past-the-end
3572 /// iterator if this map does not contain a `value_type` object whose
3573 /// key is greater-than or equal-to `key`. Note that this function
3574 /// returns the *first* position before which a `value_type` object
3575 /// having an equivalent key could be inserted into the ordered sequence
3576 /// maintained by this map, while preserving its ordering.
3577 ///
3578 /// Note: implemented inline due to Sun CC compilation error.
3579 iterator lower_bound(const key_type& key)
3580 {
3581 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
3582 d_tree, this->comparator(), key));
3583 }
3584
3585 /// Return an iterator providing modifiable access to the first (i.e.,
3586 /// ordered least) `value_type` object in this map whose key is
3587 /// greater-than or equal-to the specified `key`, and the past-the-end
3588 /// iterator if this map does not contain a `value_type` object whose
3589 /// key is greater-than or equal-to `key`. Note that this function
3590 /// returns the *first* position before which a `value_type` object
3591 /// having an equivalent key could be inserted into the ordered sequence
3592 /// maintained by this map, while preserving its ordering.
3593 ///
3594 /// Note: implemented inline due to Sun CC compilation error.
3595 template <class LOOKUP_KEY>
3596 typename bsl::enable_if<
3597 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3598 LOOKUP_KEY>::value,
3599 iterator>::type
3600 lower_bound(const LOOKUP_KEY& key)
3601 {
3602 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
3603 d_tree, this->comparator(), key));
3604 }
3605
3606 /// Return an iterator providing modifiable access to the first (i.e.,
3607 /// ordered least) `value_type` object in this map whose key is greater
3608 /// than the specified `key`, and the past-the-end iterator if this map
3609 /// does not contain a `value_type` object whose key is greater-than
3610 /// `key`. Note that this function returns the *last* position before
3611 /// which a `value_type` object having an equivalent key could be
3612 /// inserted into the ordered sequence maintained by this map, while
3613 /// preserving its ordering.
3614 ///
3615 /// Note: implemented inline due to Sun CC compilation error.
3616 iterator upper_bound(const key_type& key)
3617 {
3618 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3619 d_tree, this->comparator(), key));
3620 }
3621
3622 /// Return an iterator providing modifiable access to the first (i.e.,
3623 /// ordered least) `value_type` object in this map whose key is greater
3624 /// than the specified `key`, and the past-the-end iterator if this map
3625 /// does not contain a `value_type` object whose key is greater-than
3626 /// `key`. Note that this function returns the *last* position before
3627 /// which a `value_type` object having an equivalent key could be
3628 /// inserted into the ordered sequence maintained by this map, while
3629 /// preserving its ordering.
3630 ///
3631 /// Note: implemented inline due to Sun CC compilation error.
3632 template <class LOOKUP_KEY>
3633 typename bsl::enable_if<
3634 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3635 LOOKUP_KEY>::value,
3636 iterator>::type
3637 upper_bound(const LOOKUP_KEY& key)
3638 {
3639 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3640 d_tree, this->comparator(), key));
3641 }
3642
3643 /// Return a pair of iterators providing modifiable access to the
3644 /// sequence of `value_type` objects in this map whose keys are
3645 /// equivalent to the specified `key`, where the first iterator is
3646 /// positioned at the start of the sequence and the second is positioned
3647 /// one past the end of the sequence. The first returned iterator will
3648 /// be `lower_bound(key)`, the second returned iterator will be
3649 /// `upper_bound(key)`, and, if this map contains no `value_type`
3650 /// objects with an equivalent key, then the two returned iterators will
3651 /// have the same value. Note that since a map maintains unique keys,
3652 /// the range will contain at most one element.
3653 ///
3654 /// Note: implemented inline due to Sun CC compilation error.
3655 pair<iterator, iterator> equal_range(const key_type& key)
3656 {
3657 iterator startIt = lower_bound(key);
3658 iterator endIt = startIt;
3659 if (endIt != end() && !comparator()(key, *endIt.node())) {
3660 ++endIt;
3661 }
3662 return pair<iterator, iterator>(startIt, endIt);
3663 }
3664
3665 /// Return a pair of iterators providing modifiable access to the
3666 /// sequence of `value_type` objects in this map whose keys are
3667 /// equivalent to the specified `key`, where the first iterator is
3668 /// positioned at the start of the sequence and the second is positioned
3669 /// one past the end of the sequence. The first returned iterator will
3670 /// be `lower_bound(key)`, the second returned iterator will be
3671 /// `upper_bound(key)`, and, if this map contains no `value_type`
3672 /// objects with an equivalent key, then the two returned iterators will
3673 /// have the same value. Note that although a map maintains unique
3674 /// keys, the range may contain more than one element, because a
3675 /// transparent comparator may have been supplied that provides a
3676 /// different (but compatible) partitioning of keys for `LOOKUP_KEY` as
3677 /// the comparisons used to order the keys in the map.
3678 ///
3679 /// Note: implemented inline due to Sun CC compilation error.
3680 template <class LOOKUP_KEY>
3681 typename bsl::enable_if<
3682 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3683 LOOKUP_KEY>::value,
3684 pair<iterator, iterator> >::type
3685 equal_range(const LOOKUP_KEY& key)
3686 {
3687 iterator startIt = lower_bound(key);
3688 iterator endIt = startIt;
3689 if (endIt != end() && !comparator()(key, *endIt.node())) {
3690 ++endIt;
3691
3692 // Typically, even with a transparent comparator, we expect to find
3693 // either 0 or 1 matching keys. We test for those two common cases
3694 // before performing a logarithmic search via @ref upper_bound to
3695 // determine the end of the range.
3696
3697 if (endIt != end() && !comparator()(key, *endIt.node())) {
3698 endIt = upper_bound(key);
3699 }
3700 }
3701 return pair<iterator, iterator>(startIt, endIt);
3702 }
3703
3704 // BDE_VERIFY pragma: pop
3705
3706 // ACCESSORS
3707
3708 /// Return (a copy of) the allocator used for memory allocation by this
3709 /// map.
3711
3712 /// Return an iterator providing non-modifiable access to the first
3713 /// `value_type` object in the ordered sequence of `value_type` objects
3714 /// maintained by this map, or the `end` iterator if this map is empty.
3716
3717 /// Return an iterator providing non-modifiable access to the
3718 /// past-the-end element in the ordered sequence of `value_type`
3719 /// objects maintained by this map.
3721
3722 /// Return a reverse iterator providing non-modifiable access to the
3723 /// last `value_type` object in the ordered sequence of `value_type`
3724 /// objects maintained by this map, or `rend` if this map is empty.
3726
3727 /// Return a reverse iterator providing non-modifiable access to the
3728 /// prior-to-the-beginning element in the ordered sequence of
3729 /// `value_type` objects maintained by this map.
3731
3732 /// Return an iterator providing non-modifiable access to the first
3733 /// `value_type` object in the ordered sequence of `value_type` objects
3734 /// maintained by this map, or the `cend` iterator if this map is empty.
3736
3737 /// Return an iterator providing non-modifiable access to the
3738 /// past-the-end element in the ordered sequence of `value_type` objects
3739 /// maintained by this map.
3741
3742 /// Return a reverse iterator providing non-modifiable access to the
3743 /// last `value_type` object in the ordered sequence of `value_type`
3744 /// objects maintained by this map, or `crend` if this map is empty.
3746
3747 /// Return a reverse iterator providing non-modifiable access to the
3748 /// prior-to-the-beginning element in the ordered sequence of
3749 /// `value_type` objects maintained by this map.
3751
3752 /// Return `true` if this map contains an element whose key is
3753 /// equivalent to the specified `key`.
3754 bool contains(const key_type &key) const;
3755
3756 /// Return `true` if this map contains an element whose key is
3757 /// equivalent to the specified `key`.
3758 ///
3759 /// Note: implemented inline due to Sun CC compilation error
3760 template <class LOOKUP_KEY>
3761 typename bsl::enable_if<
3762 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3763 LOOKUP_KEY>::value,
3764 bool>::type
3765 contains(const LOOKUP_KEY& key) const
3766 {
3767 return find(key) != end();
3768 }
3769
3770 /// Return `true` if this map contains no elements, and `false`
3771 /// otherwise.
3772 bool empty() const BSLS_KEYWORD_NOEXCEPT;
3773
3774 /// Return the number of elements in this map.
3776
3777 /// Return a theoretical upper bound on the largest number of elements
3778 /// that this map could possibly hold. Note that there is no guarantee
3779 /// that the map can successfully grow to the returned size, or even
3780 /// close to that size without running out of resources.
3782
3783 /// Return a reference providing non-modifiable access to the
3784 /// mapped-value associated with a key that is equivalent to the
3785 /// specified `key`, if such an entry exists; otherwise, throw a
3786 /// `std::out_of_range` exception. Note that this method may also throw
3787 /// a different kind of exception if the (user-supplied) comparator
3788 /// throws.
3789 typename add_lvalue_reference<const VALUE>::type at(const key_type& key)
3790 const;
3791
3792 /// Return the key-comparison functor (or function pointer) used by this
3793 /// map; if a comparator was supplied at construction, return its value;
3794 /// otherwise, return a default constructed @ref key_compare object. Note
3795 /// that this comparator compares objects of type `KEY`, which is the
3796 /// key part of the `value_type` objects contained in this map.
3797 key_compare key_comp() const;
3798
3799 /// Return a functor for comparing two `value_type` objects by comparing
3800 /// their respective keys using `key_comp()`. Note that this
3801 /// comparator compares objects of type `value_type` (i.e.,
3802 /// `bsl::pair<const KEY, VALUE>`).
3803 value_compare value_comp() const;
3804
3805 // Turn off complaints about necessarily class-defined methods.
3806 // BDE_VERIFY pragma: push
3807 // BDE_VERIFY pragma: -CD01
3808
3809 /// Return an iterator providing non-modifiable access to the
3810 /// `value_type` object in this map whose key is equivalent to the
3811 /// specified `key`, if such an entry exists, and the past-the-end
3812 /// (`end`) iterator otherwise.
3813 ///
3814 /// Note: implemented inline due to Sun CC compilation error.
3815 const_iterator find(const key_type& key) const
3816 {
3817 return const_iterator(BloombergLP::bslalg::RbTreeUtil::find(
3818 d_tree, this->comparator(), key));
3819 }
3820
3821 /// Return an iterator providing non-modifiable access to the
3822 /// `value_type` object in this map whose key is equivalent to the
3823 /// specified `key`, if such an entry exists, and the past-the-end
3824 /// (`end`) iterator otherwise.
3825 ///
3826 /// Note: implemented inline due to Sun CC compilation error.
3827 template <class LOOKUP_KEY>
3828 typename bsl::enable_if<
3829 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3830 LOOKUP_KEY>::value,
3831 const_iterator>::type
3832 find(const LOOKUP_KEY& key) const
3833 {
3834 return const_iterator(BloombergLP::bslalg::RbTreeUtil::find(
3835 d_tree, this->comparator(), key));
3836 }
3837
3838 /// Return the number of `value_type` objects within this map whose keys
3839 /// are equivalent to the specified `key`. Note that since a map
3840 /// maintains unique keys, the returned value will be either 0 or 1.
3841 ///
3842 /// Note: implemented inline due to Sun CC compilation error.
3843 size_type count(const key_type& key) const
3844 {
3845 return (find(key) != end()) ? 1 : 0;
3846 }
3847
3848 /// Return the number of `value_type` objects within this map whose keys
3849 /// are equivalent to the specified `key`. Note that although a map
3850 /// maintains unique keys, the returned value can be other than 0 or 1,
3851 /// because a transparent comparator may have been supplied that
3852 /// provides a different (but compatible) partitioning of keys for
3853 /// `LOOKUP_KEY` as the comparisons used to order the keys in the map.
3854 ///
3855 /// Note: implemented inline due to Sun CC compilation error.
3856 template <class LOOKUP_KEY>
3857 typename bsl::enable_if<
3858 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3859 LOOKUP_KEY>::value,
3860 size_type>::type
3861 count(const LOOKUP_KEY& key) const
3862 {
3863 int count = 0;
3864 const_iterator it = lower_bound(key);
3865
3866 while (it != end() && !comparator()(key, *it.node())) {
3867 ++it;
3868 ++count;
3869 }
3870 return count;
3871 }
3872
3873 /// Return an iterator providing non-modifiable access to the first
3874 /// (i.e., ordered least) `value_type` object in this map whose key is
3875 /// greater-than or equal-to the specified `key`, and the past-the-end
3876 /// iterator if this map does not contain a `value_type` object whose
3877 /// key is greater-than or equal-to `key`. Note that this function
3878 /// returns the *first* position before which a `value_type` object
3879 /// having an equivalent key could be inserted into the ordered sequence
3880 /// maintained by this map, while preserving its ordering.
3881 ///
3882 /// Note: implemented inline due to Sun CC compilation error.
3883 const_iterator lower_bound(const key_type& key) const
3884 {
3885 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
3886 d_tree, this->comparator(), key));
3887 }
3888
3889 /// Return an iterator providing non-modifiable access to the first
3890 /// (i.e., ordered least) `value_type` object in this map whose key is
3891 /// greater-than or equal-to the specified `key`, and the past-the-end
3892 /// iterator if this map does not contain a `value_type` object whose
3893 /// key is greater-than or equal-to `key`. Note that this function
3894 /// returns the *first* position before which a `value_type` object
3895 /// having an equivalent key could be inserted into the ordered sequence
3896 /// maintained by this map, while preserving its ordering.
3897 ///
3898 /// Note: implemented inline due to Sun CC compilation error.
3899 template <class LOOKUP_KEY>
3900 typename bsl::enable_if<
3901 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3902 LOOKUP_KEY>::value,
3903 const_iterator>::type
3904 lower_bound(const LOOKUP_KEY& key) const
3905 {
3906 return const_iterator(
3907 BloombergLP::bslalg::RbTreeUtil::lowerBound(d_tree,
3908 this->comparator(),
3909 key));
3910 }
3911
3912 /// Return an iterator providing non-modifiable access to the first
3913 /// (i.e., ordered least) `value_type` object in this map whose key is
3914 /// greater than the specified `key`, and the past-the-end iterator if
3915 /// this map does not contain a `value_type` object whose key is
3916 /// greater-than `key`. Note that this function returns the *last*
3917 /// position before which a `value_type` object having an equivalent key
3918 /// could be inserted into the ordered sequence maintained by this map,
3919 /// while preserving its ordering.
3920 ///
3921 /// Note: implemented inline due to Sun CC compilation error.
3922 const_iterator upper_bound(const key_type& key) const
3923 {
3924 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3925 d_tree, this->comparator(), key));
3926 }
3927
3928 /// Return an iterator providing non-modifiable access to the first
3929 /// (i.e., ordered least) `value_type` object in this map whose key is
3930 /// greater than the specified `key`, and the past-the-end iterator if
3931 /// this map does not contain a `value_type` object whose key is
3932 /// greater-than `key`. Note that this function returns the *last*
3933 /// position before which a `value_type` object having an equivalent key
3934 /// could be inserted into the ordered sequence maintained by this map,
3935 /// while preserving its ordering.
3936 ///
3937 /// Note: implemented inline due to Sun CC compilation error.
3938 template <class LOOKUP_KEY>
3939 typename bsl::enable_if<
3940 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3941 LOOKUP_KEY>::value,
3942 const_iterator>::type
3943 upper_bound(const LOOKUP_KEY& key) const
3944 {
3945 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3946 d_tree, this->comparator(), key));
3947 }
3948
3949 /// Return a pair of iterators providing non-modifiable access to the
3950 /// sequence of `value_type` objects in this map whose keys are
3951 /// equivalent to the specified `key`, where the first iterator is
3952 /// positioned at the start of the sequence and the second iterator is
3953 /// positioned one past the end of the sequence. The first returned
3954 /// iterator will be `lower_bound(key)`, the second returned iterator
3955 /// will be `upper_bound(key)`, and, if this map contains no
3956 /// `value_type` objects having keys equivalent to `key`, then the two
3957 /// returned iterators will have the same value. Note that since a map
3958 /// maintains unique keys, the range will contain at most one element.
3959 ///
3960 /// Note: implemented inline due to Sun CC compilation error.
3961 pair<const_iterator, const_iterator> equal_range(const key_type& key) const
3962 {
3963 const_iterator startIt = lower_bound(key);
3964 const_iterator endIt = startIt;
3965 if (endIt != end() && !comparator()(key, *endIt.node())) {
3966 ++endIt;
3967 }
3968 return pair<const_iterator, const_iterator>(startIt, endIt);
3969 }
3970
3971 /// Return a pair of iterators providing non-modifiable access to the
3972 /// sequence of `value_type` objects in this map whose keys are
3973 /// equivalent to the specified `key`, where the first iterator is
3974 /// positioned at the start of the sequence and the second iterator is
3975 /// positioned one past the end of the sequence. The first returned
3976 /// iterator will be `lower_bound(key)`, the second returned iterator
3977 /// will be `upper_bound(key)`, and, if this map contains no
3978 /// `value_type` objects having keys equivalent to `key`, then the two
3979 /// returned iterators will have the same value. Note that although a
3980 /// map maintains unique keys, the range may contain more than one
3981 /// element, because a transparent comparator may have been supplied
3982 /// that provides a different (but compatible) partitioning of keys for
3983 /// `LOOKUP_KEY` as the comparisons used to order the keys in the map.
3984 ///
3985 /// Note: implemented inline due to Sun CC compilation error.
3986 template <class LOOKUP_KEY>
3987 typename bsl::enable_if<
3988 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3989 LOOKUP_KEY>::value,
3990 pair<const_iterator, const_iterator> >::type
3991 equal_range(const LOOKUP_KEY& key) const
3992 {
3993 const_iterator startIt = lower_bound(key);
3994 const_iterator endIt = startIt;
3995 if (endIt != end() && !comparator()(key, *endIt.node())) {
3996 ++endIt;
3997
3998 // Typically, even with a transparent comparator, we expect to find
3999 // either 0 or 1 matching keys. We test for those two common cases
4000 // before performing a logarithmic search via @ref upper_bound to
4001 // determine the end of the range.
4002
4003 if (endIt != end() && !comparator()(key, *endIt.node())) {
4004 endIt = upper_bound(key);
4005 }
4006 }
4007 return pair<const_iterator, const_iterator>(startIt, endIt);
4008 }
4009
4010 // BDE_VERIFY pragma: pop
4011};
4012
4013#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
4014// CLASS TEMPLATE DEDUCTION GUIDES
4015
4016/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4017/// of the iterators supplied to the constructor of `map`. Deduce the
4018/// template parameters `COMPARATOR` and `ALLOCATOR` from the other
4019/// parameters passed to the constructor. This deduction guide does not
4020/// participate unless the supplied allocator meets the requirements of a
4021/// standard allocator.
4022template <
4023 class INPUT_ITERATOR,
4024 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4025 class VALUE =
4026 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4027 class COMPARATOR = std::less<KEY>,
4028 class ALLOCATOR = bsl::allocator<
4029 BloombergLP::bslstl::IteratorUtil::IterToAlloc_t<INPUT_ITERATOR>>,
4030 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
4031 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4032 >
4033map(INPUT_ITERATOR,
4034 INPUT_ITERATOR,
4035 COMPARATOR = COMPARATOR(),
4036 ALLOCATOR = ALLOCATOR())
4037-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
4038
4039/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4040/// of the iterators supplied to the constructor of `map`. Deduce the
4041/// template parameter `COMPARATOR` from the other parameter passed to the
4042/// constructor. This deduction guide does not participate unless the
4043/// supplied allocator is convertible to
4044/// `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
4045template <
4046 class INPUT_ITERATOR,
4047 class COMPARATOR,
4048 class ALLOC,
4049 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4050 class VALUE =
4051 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4052 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
4053 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4054 >
4055map(INPUT_ITERATOR, INPUT_ITERATOR, COMPARATOR, ALLOC *)
4056-> map<KEY, VALUE, COMPARATOR>;
4057
4058/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4059/// of the iterators supplied to the constructor of `map`. This deduction
4060/// guide does not participate unless the supplied allocator meets the
4061/// requirements of a standard allocator.
4062template <
4063 class INPUT_ITERATOR,
4064 class ALLOCATOR,
4065 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4066 class VALUE =
4067 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4068 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4069 >
4070map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR)
4071-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
4072
4073/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4074/// of the iterators supplied to the constructor of `map`. This deduction
4075/// guide does not participate unless the supplied allocator is convertible
4076/// to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
4077template <
4078 class INPUT_ITERATOR,
4079 class ALLOC,
4080 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4081 class VALUE =
4082 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4083 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
4084 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4085 >
4086map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
4087-> map<KEY, VALUE>;
4088
4089/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4090/// of the initializer_list supplied to the constructor of `map`. Deduce
4091/// the template parameters `COMPARATOR` and `ALLOCATOR` from the other
4092/// parameters passed to the constructor. This deduction guide does not
4093/// participate unless the supplied allocator meets the requirements of a
4094/// standard allocator.
4095template <
4096 class KEY,
4097 class VALUE,
4098 class COMPARATOR = std::less<KEY>,
4099 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4100 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
4101 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4102 >
4103map(std::initializer_list<pair<const KEY, VALUE>>,
4104 COMPARATOR = COMPARATOR(),
4105 ALLOCATOR = ALLOCATOR())
4106-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
4107
4108/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4109/// of the initializer_list supplied to the constructor of `map`. Deduce
4110/// the template parameter `COMPARATOR` from the other parameters passed to
4111/// the constructor. This deduction guide does not participate unless the
4112/// supplied allocator is convertible to
4113/// `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
4114template <
4115 class KEY,
4116 class VALUE,
4117 class COMPARATOR,
4118 class ALLOC,
4119 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4120 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4121 >
4122map(std::initializer_list<pair<const KEY, VALUE>>, COMPARATOR, ALLOC *)
4123-> map<KEY, VALUE, COMPARATOR>;
4124
4125/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4126/// of the initializer_list supplied to the constructor of `map`. Deduce
4127/// the template parameter `ALLOCATOR` from the other parameter passed to
4128/// the constructor. This deduction guide does not participate unless the
4129/// supplied allocator meets the requirements of a standard allocator.
4130template <
4131 class KEY,
4132 class VALUE,
4133 class ALLOCATOR,
4134 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4135 >
4136map(std::initializer_list<pair<const KEY, VALUE>>, ALLOCATOR)
4137-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
4138
4139/// Deduce the template parameters `KEY` and `VALUE` from the `value_type`
4140/// of the initializer_list supplied to the constructor of `map`. This
4141/// deduction guide does not participate unless the supplied allocator is
4142/// convertible to `bsl::allocator<bsl::pair<const KEY, VALUE>>`.
4143template <
4144 class KEY,
4145 class VALUE,
4146 class ALLOC,
4147 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4148 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4149 >
4150map(std::initializer_list<pair<const KEY, VALUE>>, ALLOC *)
4151-> map<KEY, VALUE>;
4152#endif
4153
4154// FREE OPERATORS
4155
4156/// Return `true` if the specified `lhs` and `rhs` objects have the same
4157/// value, and `false` otherwise. Two `map` objects `lhs` and `rhs` have
4158/// the same value if they have the same number of key-value pairs, and each
4159/// element in the ordered sequence of key-value pairs of `lhs` has the same
4160/// value as the corresponding element in the ordered sequence of key-value
4161/// pairs of `rhs`. This method requires that the (template parameter)
4162/// types `KEY` and `VALUE` both be `equality-comparable` (see {Requirements
4163/// on `KEY` and `VALUE`}).
4164template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4165bool operator==(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4166 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4167
4168#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
4169template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4170bool operator!=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4171 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4172 // Return 'true' if the specified 'lhs' and 'rhs' objects do not have the
4173 // same value, and 'false' otherwise. Two 'map' objects 'lhs' and 'rhs' do
4174 // not have the same value if they do not have the same number of key-value
4175 // pairs, or some element in the ordered sequence of key-value pairs of
4176 // 'lhs' does not have the same value as the corresponding element in the
4177 // ordered sequence of key-value pairs of 'rhs'. This method requires that
4178 // the (template parameter) types 'KEY' and 'VALUE' both be
4179 // 'equality-comparable' (see {Requirements on 'KEY' and 'VALUE'}).
4180#endif
4181
4182#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
4183
4184/// Perform a lexicographic three-way comparison of the specified `lhs` and
4185/// the specified `rhs` maps by using the comparison operators of
4186/// `bsl::pair<const KEY, VALUE>` on each element; return the result of that
4187/// comparison.
4188template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4189BloombergLP::bslalg::SynthThreeWayUtil::Result<pair<const KEY, VALUE>>
4190operator<=>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4191 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4192
4193#else
4194
4195template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4196bool operator<(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4197 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4198 // Return 'true' if the value of the specified 'lhs' map is
4199 // lexicographically less than that of the specified 'rhs' map, and 'false'
4200 // otherwise. Given iterators 'i' and 'j' over the respective sequences
4201 // '[lhs.begin() .. lhs.end())' and '[rhs.begin() .. rhs.end())', the value
4202 // of map 'lhs' is lexicographically less than that of map 'rhs' if
4203 // 'true == *i < *j' for the first pair of corresponding iterator positions
4204 // where '*i < *j' and '*j < *i' are not both 'false'. If no such
4205 // corresponding iterator position exists, the value of 'lhs' is
4206 // lexicographically less than that of 'rhs' if 'lhs.size() < rhs.size()'.
4207 // This method requires that 'operator<', inducing a total order, be
4208 // defined for 'value_type'.
4209
4210template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4211bool operator>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4212 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4213 // Return 'true' if the value of the specified 'lhs' map is
4214 // lexicographically greater than that of the specified 'rhs' map, and
4215 // 'false' otherwise. The value of map 'lhs' is lexicographically greater
4216 // than that of map 'rhs' if 'rhs' is lexicographically less than 'lhs'
4217 // (see 'operator<'). This method requires that 'operator<', inducing a
4218 // total order, be defined for 'value_type'. Note that this operator
4219 // returns 'rhs < lhs'.
4220
4221template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4222bool operator<=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4223 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4224 // Return 'true' if the value of the specified 'lhs' map is
4225 // lexicographically less than or equal to that of the specified 'rhs' map,
4226 // and 'false' otherwise. The value of map 'lhs' is lexicographically less
4227 // than or equal to that of map 'rhs' if 'rhs' is not lexicographically
4228 // less than 'lhs' (see 'operator<'). This method requires that
4229 // 'operator<', inducing a total order, be defined for 'value_type'. Note
4230 // that this operator returns '!(rhs < lhs)'.
4231
4232template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4233bool operator>=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4234 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4235 // Return 'true' if the value of the specified 'lhs' map is
4236 // lexicographically greater than or equal to that of the specified 'rhs'
4237 // map, and 'false' otherwise. The value of map 'lhs' is lexicographically
4238 // greater than or equal to that of map 'rhs' if 'lhs' is not
4239 // lexicographically less than 'rhs' (see 'operator<'). This method
4240 // requires that 'operator<', inducing a total order, be defined for
4241 // 'value_type'. Note that this operator returns '!(lhs < rhs)'.
4242
4243#endif // BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
4244
4245// FREE FUNCTIONS
4246
4247/// Erase all the elements in the specified map `m` that satisfy the
4248/// specified predicate `predicate`. Return the number of elements erased.
4249template <class KEY,
4250 class VALUE,
4251 class COMPARATOR,
4252 class ALLOCATOR,
4253 class PREDICATE>
4254typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
4255erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate);
4256
4257/// Exchange the value and comparator of the specified `a` object with those
4258/// of the specified `b` object; also exchange the allocator of `a` with
4259/// that of `b` if the (template parameter) type `ALLOCATOR` has the
4260/// `propagate_on_container_swap` trait, and do not modify either allocator
4261/// otherwise. This function provides the no-throw exception-safety
4262/// guarantee if and only if the (template parameter) type `COMPARATOR`
4263/// provides a no-throw swap operation, and provides the basic
4264/// exception-safety guarantee otherwise; if an exception is thrown, both
4265/// objects are left in valid but unspecified states. This operation has
4266/// `O[1]` complexity if either `a` was created with the same allocator as
4267/// `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait;
4268/// otherwise, it has `O[n + m]` complexity, where `n` and `m` are the
4269/// number of elements in `a` and `b`, respectively. Note that this
4270/// function's support for swapping objects created with different
4271/// allocators when `ALLOCATOR` does not have the
4272/// `propagate_on_container_swap` trait is a departure from the C++
4273/// Standard.
4274template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4275void swap(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& a,
4276 map<KEY, VALUE, COMPARATOR, ALLOCATOR>& b)
4278
4279// ============================================================================
4280// INLINE FUNCTION DEFINITIONS
4281// ============================================================================
4282
4283 // -----------------
4284 // class DataWrapper
4285 // -----------------
4286
4287// CREATORS
4288template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4289inline
4290map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
4291 const COMPARATOR& comparator,
4292 const ALLOCATOR& basicAllocator)
4293: ::bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(comparator)
4294, d_pool(basicAllocator)
4295{
4296}
4297
4298template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4299inline
4300map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
4301 BloombergLP::bslmf::MovableRef<DataWrapper> original)
4302: ::bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(
4303 MoveUtil::access(original).keyComparator())
4304, d_pool(MoveUtil::move(MoveUtil::access(original).d_pool))
4305{
4306}
4307
4308template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4309inline
4310typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4311map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
4312{
4313 return d_pool;
4314}
4315
4316// ACCESSORS
4317template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4318inline
4319const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4320map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory() const
4321{
4322 return d_pool;
4323}
4324
4325 // ------------------------
4326 // class map::value_compare
4327 // ------------------------
4328
4329// CREATORS
4330template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4331inline
4332map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::value_compare(
4333 COMPARATOR comparator)
4334: comp(comparator)
4335{
4336}
4337
4338// ACCESSORS
4339template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4340inline
4341bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::operator()(
4342 const value_type& x,
4343 const value_type& y) const
4344{
4345 return comp(x.first, y.first);
4346}
4347
4348 // ---------
4349 // class map
4350 // ---------
4351
4352// PRIVATE CLASS METHODS
4353template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4354inline
4355typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
4356map<KEY, VALUE, COMPARATOR, ALLOCATOR>::toNode(
4357 BloombergLP::bslalg::RbTreeNode *node)
4358{
4359 return static_cast<Node *>(node);
4360}
4361
4362template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4363inline
4364const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
4365map<KEY, VALUE, COMPARATOR, ALLOCATOR>::toNode(
4366 const BloombergLP::bslalg::RbTreeNode *node)
4367{
4368 return static_cast<const Node *>(node);
4369}
4370
4371// PRIVATE MANIPULATORS
4372template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4373inline
4374typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4375map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
4376{
4377 return d_compAndAlloc.nodeFactory();
4378}
4379
4380template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4381inline
4382typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
4383map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
4384{
4385 return d_compAndAlloc;
4386}
4387
4388template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4389inline
4390void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapExchangeAllocators(
4391 map& other)
4392{
4393 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
4394 nodeFactory().swapExchangeAllocators(other.nodeFactory());
4395
4396 // 'DataWrapper' contains a 'NodeFactory' object and inherits from
4397 // 'Comparator'. If the empty-base-class optimization has been applied to
4398 // 'Comparator', then we must not call 'swap' on it because
4399 // 'sizeof(Comparator) > 0' and, therefore, we will incorrectly swap bytes
4400 // of the 'NodeFactory' members!
4401
4402 if (sizeof(NodeFactory) != sizeof(DataWrapper)) {
4403 comparator().swap(other.comparator());
4404 }
4405}
4406
4407template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4408inline
4409void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapRetainAllocators(
4410 map& other)
4411{
4412 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
4413 nodeFactory().swapRetainAllocators(other.nodeFactory());
4414
4415 // See 'quickSwapExchangeAllocators' (above).
4416
4417 if (sizeof(NodeFactory) != sizeof(DataWrapper)) {
4418 comparator().swap(other.comparator());
4419 }
4420}
4421
4422// PRIVATE ACCESSORS
4423template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4424inline
4425const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4426map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory() const
4427{
4428 return d_compAndAlloc.nodeFactory();
4429}
4430
4431template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4432inline
4433const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
4434map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator() const
4435{
4436 return d_compAndAlloc;
4437}
4438
4439// CREATORS
4440template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4441inline
4442map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map()
4443: d_compAndAlloc(COMPARATOR(), ALLOCATOR())
4444, d_tree()
4445{
4446}
4447
4448template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4449inline
4450map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(const ALLOCATOR& basicAllocator)
4451: d_compAndAlloc(COMPARATOR(), basicAllocator)
4452, d_tree()
4453{
4454}
4455
4456template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4457inline
4458map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(const map& original)
4459: d_compAndAlloc(original.comparator().keyComparator(),
4460 AllocatorTraits::select_on_container_copy_construction(
4461 original.nodeFactory().allocator()))
4462, d_tree()
4463{
4464 if (0 < original.size()) {
4465 nodeFactory().reserveNodes(original.size());
4466 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
4467 original.d_tree,
4468 &nodeFactory());
4469 }
4470}
4471
4472template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4473inline
4474map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
4475 BloombergLP::bslmf::MovableRef<map> original)
4476: d_compAndAlloc(MoveUtil::move(MoveUtil::access(original).d_compAndAlloc))
4477, d_tree()
4478{
4479 map& lvalue = original;
4480 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
4481}
4482
4483template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4484inline
4485map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(const map& original,
4486 const typename type_identity<ALLOCATOR>::type& basicAllocator)
4487: d_compAndAlloc(original.comparator().keyComparator(), basicAllocator)
4488, d_tree()
4489{
4490 if (0 < original.size()) {
4491 nodeFactory().reserveNodes(original.size());
4492 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
4493 original.d_tree,
4494 &nodeFactory());
4495 }
4496}
4497
4498template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4499inline
4500map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
4501 BloombergLP::bslmf::MovableRef<map> original,
4502 const typename type_identity<ALLOCATOR>::type& basicAllocator)
4503: d_compAndAlloc(MoveUtil::access(original).comparator().keyComparator(),
4504 basicAllocator)
4505, d_tree()
4506{
4507 map& lvalue = original;
4508
4510 nodeFactory().allocator() == lvalue.nodeFactory().allocator())) {
4511 d_compAndAlloc.nodeFactory().adopt(
4512 MoveUtil::move(lvalue.d_compAndAlloc.nodeFactory()));
4513 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
4514 }
4515 else if (0 < lvalue.size()) {
4516 nodeFactory().reserveNodes(lvalue.size());
4517 BloombergLP::bslalg::RbTreeUtil::moveTree(&d_tree,
4518 &lvalue.d_tree,
4519 &nodeFactory(),
4520 &lvalue.nodeFactory());
4521 }
4522}
4523
4524template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4525template <class INPUT_ITERATOR>
4526inline
4527map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(INPUT_ITERATOR first,
4528 INPUT_ITERATOR last,
4529 const COMPARATOR& comparator,
4530 const ALLOCATOR& basicAllocator)
4531: d_compAndAlloc(comparator, basicAllocator)
4532, d_tree()
4533{
4534 if (first != last) {
4535
4536 size_type numElements =
4537 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
4538
4539 if (0 < numElements) {
4540 nodeFactory().reserveNodes(numElements);
4541 }
4542
4543 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
4544 &d_tree,
4545 &nodeFactory());
4546
4547 // The following loop guarantees amortized linear time to insert an
4548 // ordered sequence of values (as required by the standard). If the
4549 // values are in sorted order, we are guaranteed the next node can be
4550 // inserted as the right child of the previous node, and can call
4551 // 'insertAt' without 'findUniqueInsertLocation'.
4552
4553 insert(*first);
4554 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
4555 while (++first != last) {
4556 // The values are not in order, so insert them normally.
4557
4558 const value_type& value = *first;
4559 if (this->comparator()(value.first, *prevNode)) {
4560 insert(value);
4561 insert(++first, last);
4562 break;
4563 }
4564
4565 if (this->comparator()(*prevNode, value.first)) {
4566 BloombergLP::bslalg::RbTreeNode *node =
4567 nodeFactory().emplaceIntoNewNode(value);
4568 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4569 prevNode,
4570 false,
4571 node);
4572 prevNode = node;
4573 }
4574 }
4575 proctor.release();
4576 }
4577}
4578
4579template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4580template <class INPUT_ITERATOR>
4581inline
4582map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(INPUT_ITERATOR first,
4583 INPUT_ITERATOR last,
4584 const ALLOCATOR& basicAllocator)
4585: d_compAndAlloc(COMPARATOR(), basicAllocator)
4586, d_tree()
4587{
4588 map other(first, last, COMPARATOR(), nodeFactory().allocator());
4589 quickSwapRetainAllocators(other);
4590}
4591
4592#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4593template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4594inline
4595map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
4596 std::initializer_list<value_type> values,
4597 const COMPARATOR& comparator,
4598 const ALLOCATOR& basicAllocator)
4599: map(values.begin(), values.end(), comparator, basicAllocator)
4600{
4601}
4602
4603template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4604inline
4605map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
4606 std::initializer_list<value_type> values,
4607 const ALLOCATOR& basicAllocator)
4608: map(values.begin(), values.end(), COMPARATOR(), basicAllocator)
4609{
4610}
4611#endif
4612
4613template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4614inline
4615map<KEY, VALUE, COMPARATOR, ALLOCATOR>::~map()
4616{
4617 clear();
4618}
4619
4620// MANIPULATORS
4621template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4622inline
4623map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
4624map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(const map& rhs)
4625{
4626 if (BSLS_PERFORMANCEHINT_PREDICT_LIKELY(this != &rhs)) {
4627 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
4628 map other(rhs, rhs.nodeFactory().allocator());
4629 quickSwapExchangeAllocators(other);
4630 }
4631 else {
4632 map other(rhs, nodeFactory().allocator());
4633 quickSwapRetainAllocators(other);
4634 }
4635 }
4636 return *this;
4637}
4638
4639template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4640inline
4641map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
4642map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
4643 BloombergLP::bslmf::MovableRef<map> rhs)
4645 AllocatorTraits::is_always_equal::value &&
4646 std::is_nothrow_move_assignable<COMPARATOR>::value)
4647{
4648 map& lvalue = rhs;
4649
4650 if (BSLS_PERFORMANCEHINT_PREDICT_LIKELY(this != &lvalue)) {
4651 if (nodeFactory().allocator() == lvalue.nodeFactory().allocator()) {
4652 map other(MoveUtil::move(lvalue));
4653 quickSwapRetainAllocators(other);
4654 }
4655 else if (
4656 AllocatorTraits::propagate_on_container_move_assignment::value) {
4657 map other(MoveUtil::move(lvalue));
4658 quickSwapExchangeAllocators(other);
4659 }
4660 else {
4661 map other(MoveUtil::move(lvalue), nodeFactory().allocator());
4662 quickSwapRetainAllocators(other);
4663 }
4664 }
4665 return *this;
4666}
4667
4668#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4669template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4670inline
4671map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
4672map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
4673 std::initializer_list<value_type> values)
4674{
4675 clear();
4676 insert(values.begin(), values.end());
4677 return *this;
4678}
4679#endif
4680
4681template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4682inline
4683typename add_lvalue_reference<VALUE>::type
4684map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator[](const key_type& key)
4685{
4686 iterator iter = lower_bound(key);
4687 if (iter == end() || this->comparator()(key, *iter.node())) {
4688#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
4689 iter = emplace_hint(iter,
4690 std::piecewise_construct,
4691 std::forward_as_tuple(key),
4692 std::forward_as_tuple());
4693#else
4694 BloombergLP::bsls::ObjectBuffer<VALUE> temp; // for default 'VALUE'
4695
4696 ALLOCATOR alloc = nodeFactory().allocator();
4697
4698 AllocatorTraits::construct(alloc, temp.address());
4699
4700 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
4701
4702 iter = emplace_hint(iter, key, temp.object());
4703#endif
4704 }
4705 return iter->second;
4706}
4707
4708template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4709inline
4710typename add_lvalue_reference<VALUE>::type
4711map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator[](
4712 BloombergLP::bslmf::MovableRef<key_type> key)
4713{
4714 key_type& lvalue = key;
4715
4716 iterator iter = lower_bound(lvalue);
4717 if (iter == end() || this->comparator()(lvalue, *iter.node())) {
4718#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
4719 iter = emplace_hint(
4720 iter,
4721 std::piecewise_construct,
4722 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
4723 std::forward_as_tuple());
4724#else
4725 BloombergLP::bsls::ObjectBuffer<VALUE> temp; // for default 'VALUE'
4726
4727 ALLOCATOR alloc = nodeFactory().allocator();
4728
4729 AllocatorTraits::construct(alloc, temp.address());
4730
4731 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
4732
4733 iter = emplace_hint(iter, lvalue, temp.object());
4734#endif
4735 }
4736 return iter->second;
4737}
4738
4739template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4740typename add_lvalue_reference<VALUE>::type
4741map<KEY, VALUE, COMPARATOR, ALLOCATOR>::at(const key_type& key)
4742{
4743 BloombergLP::bslalg::RbTreeNode *node =
4744 BloombergLP::bslalg::RbTreeUtil::find(d_tree, this->comparator(), key);
4745 if (d_tree.sentinel() == node) {
4746 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
4747 "map<...>::at(key_type): invalid key value");
4748 }
4749 return toNode(node)->value().second;
4750}
4751
4752template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4753inline
4754typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
4755map<KEY, VALUE, COMPARATOR, ALLOCATOR>::begin() BSLS_KEYWORD_NOEXCEPT
4756{
4757 return iterator(d_tree.firstNode());
4758}
4759
4760template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4761inline
4762typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
4763map<KEY, VALUE, COMPARATOR, ALLOCATOR>::end() BSLS_KEYWORD_NOEXCEPT
4764{
4765 return iterator(d_tree.sentinel());
4766}
4767
4768template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4769inline
4770typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
4771map<KEY, VALUE, COMPARATOR, ALLOCATOR>::rbegin() BSLS_KEYWORD_NOEXCEPT
4772{
4773 return reverse_iterator(end());
4774}
4775
4776template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4777inline
4778typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
4779map<KEY, VALUE, COMPARATOR, ALLOCATOR>::rend() BSLS_KEYWORD_NOEXCEPT
4780{
4781 return reverse_iterator(begin());
4782}
4783
4784template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4785inline
4786pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
4787map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const value_type& value)
4788{
4789 int comparisonResult;
4790 BloombergLP::bslalg::RbTreeNode *insertLocation =
4791 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
4792 &comparisonResult,
4793 &d_tree,
4794 this->comparator(),
4795 value.first);
4796 if (!comparisonResult) {
4797 return pair<iterator, bool>(iterator(insertLocation), false); // RETURN
4798 }
4799
4800 BloombergLP::bslalg::RbTreeNode *node =
4801 nodeFactory().emplaceIntoNewNode(value);
4802 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4803 insertLocation,
4804 comparisonResult < 0,
4805 node);
4806 return pair<iterator, bool>(iterator(node), true);
4807}
4808
4809template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4810inline
4811pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
4812map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
4813 BloombergLP::bslmf::MovableRef<value_type> value)
4814{
4815 value_type& lvalue = value;
4816
4817 int comparisonResult;
4818 BloombergLP::bslalg::RbTreeNode *insertLocation =
4819 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
4820 &comparisonResult,
4821 &d_tree,
4822 this->comparator(),
4823 lvalue.first);
4824 if (!comparisonResult) {
4825 return pair<iterator, bool>(iterator(insertLocation), false); // RETURN
4826 }
4827
4828 BloombergLP::bslalg::RbTreeNode *node =
4829 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
4830 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4831 insertLocation,
4832 comparisonResult < 0,
4833 node);
4834 return pair<iterator, bool>(iterator(node), true);
4835}
4836
4837template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4838template <class INPUT_ITERATOR>
4839inline
4840void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(INPUT_ITERATOR first,
4841 INPUT_ITERATOR last)
4842{
4843 ///Implementation Notes
4844 ///--------------------
4845 // First, consume currently held free nodes. If those nodes are
4846 // insufficient *and* one can calculate the remaining number of elements,
4847 // then reserve exactly that many free nodes. There is no more than one
4848 // call to 'reserveNodes' per invocation of this method, hence the use of
4849 // 'BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY'. When reserving nodes, we
4850 // assume the elements remaining to be inserted have unique keys that do
4851 // not duplicate any keys already in the container. If there are any
4852 // duplicates, this container will have free nodes on return from this
4853 // method.
4854
4855 const bool canCalculateInsertDistance =
4856 is_convertible<typename
4857 iterator_traits<INPUT_ITERATOR>::iterator_category,
4858 forward_iterator_tag>::value;
4859
4860 while (first != last) {
4861 if (canCalculateInsertDistance
4863 !nodeFactory().hasFreeNodes())) {
4864 const size_type numElements =
4865 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
4866
4867 nodeFactory().reserveNodes(numElements);
4868 }
4869 insert(*first);
4870 ++first;
4871 }
4872}
4873
4874#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
4875template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4876inline
4877void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator first,
4878 const_iterator last)
4879{
4880 while (first != last) {
4881 insert(*first);
4882 ++first;
4883 }
4884}
4885#endif
4886
4887template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4888inline
4889typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
4890map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator hint,
4891 const value_type& value)
4892{
4893 BloombergLP::bslalg::RbTreeNode *hintNode =
4894 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
4895 int comparisonResult;
4896 BloombergLP::bslalg::RbTreeNode *insertLocation =
4897 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
4898 &comparisonResult,
4899 &d_tree,
4900 this->comparator(),
4901 value.first,
4902 hintNode);
4903 if (!comparisonResult) {
4904 return iterator(insertLocation); // RETURN
4905 }
4906
4907 BloombergLP::bslalg::RbTreeNode *node =
4908 nodeFactory().emplaceIntoNewNode(value);
4909 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4910 insertLocation,
4911 comparisonResult < 0,
4912 node);
4913 return iterator(node);
4914}
4915
4916template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4917inline
4918typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
4919map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
4920 const_iterator hint,
4921 BloombergLP::bslmf::MovableRef<value_type> value)
4922{
4923 value_type& lvalue = value;
4924
4925 BloombergLP::bslalg::RbTreeNode *hintNode =
4926 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
4927 int comparisonResult;
4928 BloombergLP::bslalg::RbTreeNode *insertLocation =
4929 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
4930 &comparisonResult,
4931 &d_tree,
4932 this->comparator(),
4933 lvalue.first,
4934 hintNode);
4935 if (!comparisonResult) {
4936 return iterator(insertLocation); // RETURN
4937 }
4938
4939 BloombergLP::bslalg::RbTreeNode *node =
4940 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
4941
4942 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4943 insertLocation,
4944 comparisonResult < 0,
4945 node);
4946 return iterator(node);
4947}
4948
4949#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4950template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4951inline
4952void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
4953 std::initializer_list<value_type> values)
4954{
4955 insert(values.begin(), values.end());
4956}
4957#endif
4958
4959// {{{ BEGIN GENERATED CODE
4960// The generated code below is a workaround for the absence of perfect
4961// forwarding in some compilers.
4962template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4963template <class BDE_OTHER_TYPE>
4964inline
4965pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
4966map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(const key_type& key,
4967 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
4968{
4969 int comparisonResult;
4970 BloombergLP::bslalg::RbTreeNode *insertLocation =
4971 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
4972 &comparisonResult,
4973 &d_tree,
4974 this->comparator(),
4975 key);
4976
4977 if (!comparisonResult) {
4978 iterator(insertLocation)->second =
4979 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj);
4980 return pair<iterator, bool>(iterator(insertLocation), false);
4981 }
4982
4983 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
4984 key, BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
4985
4986 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4987 insertLocation,
4988 comparisonResult < 0,
4989 node);
4990
4991 return pair<iterator, bool>(iterator(node), true);
4992}
4993
4994template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4995template <class BDE_OTHER_TYPE>
4996inline
4997typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
4998map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(const_iterator hint,
4999 const key_type& key,
5000 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
5001{
5002 BloombergLP::bslalg::RbTreeNode *hintNode =
5003 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5004 int comparisonResult;
5005 BloombergLP::bslalg::RbTreeNode *insertLocation =
5006 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5007 &comparisonResult,
5008 &d_tree,
5009 this->comparator(),
5010 key,
5011 hintNode);
5012
5013 if (!comparisonResult) {
5014 iterator(insertLocation)->second =
5015 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj);
5016 return iterator(insertLocation);
5017 }
5018
5019 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5020 key, BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
5021
5022 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5023 insertLocation,
5024 comparisonResult < 0,
5025 node);
5026
5027 return iterator(node);
5028}
5029
5030template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5031template <class BDE_OTHER_TYPE>
5032inline
5033pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5034map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(
5035 BloombergLP::bslmf::MovableRef<key_type> key,
5036 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
5037{
5038 int comparisonResult;
5039 BloombergLP::bslalg::RbTreeNode *insertLocation =
5040 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5041 &comparisonResult,
5042 &d_tree,
5043 this->comparator(),
5044 key);
5045
5046 if (!comparisonResult) {
5047 iterator(insertLocation)->second =
5048 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj);
5049 return pair<iterator, bool>(iterator(insertLocation), false);
5050 }
5051
5052 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5053 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
5054 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
5055
5056 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5057 insertLocation,
5058 comparisonResult < 0,
5059 node);
5060
5061 return pair<iterator, bool>(iterator(node), true);
5062}
5063
5064template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5065template <class BDE_OTHER_TYPE>
5066inline
5067typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5068map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(
5069 const_iterator hint,
5070 BloombergLP::bslmf::MovableRef<key_type> key,
5071 BSLS_COMPILERFEATURES_FORWARD_REF(BDE_OTHER_TYPE) obj)
5072{
5073 BloombergLP::bslalg::RbTreeNode *hintNode =
5074 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5075 int comparisonResult;
5076 BloombergLP::bslalg::RbTreeNode *insertLocation =
5077 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5078 &comparisonResult,
5079 &d_tree,
5080 this->comparator(),
5081 key,
5082 hintNode);
5083
5084 if (!comparisonResult) {
5085 iterator(insertLocation)->second =
5086 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj);
5087 return iterator(insertLocation);
5088 }
5089
5090 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5091 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
5092 BSLS_COMPILERFEATURES_FORWARD(BDE_OTHER_TYPE, obj));
5093
5094 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5095 insertLocation,
5096 comparisonResult < 0,
5097 node);
5098
5099 return iterator(node);
5100}
5101// }}} END GENERATED CODE
5102
5103#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
5104// {{{ BEGIN GENERATED CODE
5105// Command line: sim_cpp11_features.pl bslstl_map.h
5106#ifndef BSLSTL_MAP_VARIADIC_LIMIT
5107#define BSLSTL_MAP_VARIADIC_LIMIT 10
5108#endif
5109#ifndef BSLSTL_MAP_VARIADIC_LIMIT_E
5110#define BSLSTL_MAP_VARIADIC_LIMIT_E BSLSTL_MAP_VARIADIC_LIMIT
5111#endif
5112
5113#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 0
5114template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5115inline
5116pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5117map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5118 )
5119{
5120 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5121 );
5122 int comparisonResult;
5123 BloombergLP::bslalg::RbTreeNode *insertLocation =
5124 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5125 &comparisonResult,
5126 &d_tree,
5127 this->comparator(),
5128 static_cast<const Node *>(node)->value().first);
5129 if (!comparisonResult) {
5130 nodeFactory().deleteNode(node);
5131 return pair<iterator, bool>(iterator(insertLocation), false);
5132 }
5133
5134 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5135 insertLocation,
5136 comparisonResult < 0,
5137 node);
5138 return pair<iterator, bool>(iterator(node), true);
5139}
5140#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 0
5141
5142#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 1
5143template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5144template <class Args_01>
5145inline
5146pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5147map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5148 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
5149{
5150 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5151 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
5152 int comparisonResult;
5153 BloombergLP::bslalg::RbTreeNode *insertLocation =
5154 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5155 &comparisonResult,
5156 &d_tree,
5157 this->comparator(),
5158 static_cast<const Node *>(node)->value().first);
5159 if (!comparisonResult) {
5160 nodeFactory().deleteNode(node);
5161 return pair<iterator, bool>(iterator(insertLocation), false);
5162 }
5163
5164 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5165 insertLocation,
5166 comparisonResult < 0,
5167 node);
5168 return pair<iterator, bool>(iterator(node), true);
5169}
5170#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 1
5171
5172#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 2
5173template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5174template <class Args_01,
5175 class Args_02>
5176inline
5177pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5178map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5179 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5180 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
5181{
5182 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5183 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5184 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
5185 int comparisonResult;
5186 BloombergLP::bslalg::RbTreeNode *insertLocation =
5187 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5188 &comparisonResult,
5189 &d_tree,
5190 this->comparator(),
5191 static_cast<const Node *>(node)->value().first);
5192 if (!comparisonResult) {
5193 nodeFactory().deleteNode(node);
5194 return pair<iterator, bool>(iterator(insertLocation), false);
5195 }
5196
5197 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5198 insertLocation,
5199 comparisonResult < 0,
5200 node);
5201 return pair<iterator, bool>(iterator(node), true);
5202}
5203#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 2
5204
5205#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 3
5206template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5207template <class Args_01,
5208 class Args_02,
5209 class Args_03>
5210inline
5211pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5212map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5213 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5214 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5215 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
5216{
5217 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5218 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5219 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5220 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
5221 int comparisonResult;
5222 BloombergLP::bslalg::RbTreeNode *insertLocation =
5223 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5224 &comparisonResult,
5225 &d_tree,
5226 this->comparator(),
5227 static_cast<const Node *>(node)->value().first);
5228 if (!comparisonResult) {
5229 nodeFactory().deleteNode(node);
5230 return pair<iterator, bool>(iterator(insertLocation), false);
5231 }
5232
5233 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5234 insertLocation,
5235 comparisonResult < 0,
5236 node);
5237 return pair<iterator, bool>(iterator(node), true);
5238}
5239#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 3
5240
5241#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 4
5242template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5243template <class Args_01,
5244 class Args_02,
5245 class Args_03,
5246 class Args_04>
5247inline
5248pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5249map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5250 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5251 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5252 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5253 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
5254{
5255 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5256 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5257 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5258 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5259 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
5260 int comparisonResult;
5261 BloombergLP::bslalg::RbTreeNode *insertLocation =
5262 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5263 &comparisonResult,
5264 &d_tree,
5265 this->comparator(),
5266 static_cast<const Node *>(node)->value().first);
5267 if (!comparisonResult) {
5268 nodeFactory().deleteNode(node);
5269 return pair<iterator, bool>(iterator(insertLocation), false);
5270 }
5271
5272 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5273 insertLocation,
5274 comparisonResult < 0,
5275 node);
5276 return pair<iterator, bool>(iterator(node), true);
5277}
5278#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 4
5279
5280#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 5
5281template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5282template <class Args_01,
5283 class Args_02,
5284 class Args_03,
5285 class Args_04,
5286 class Args_05>
5287inline
5288pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5289map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5290 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5291 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5292 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5293 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5294 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
5295{
5296 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5297 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5298 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5299 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5300 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5301 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
5302 int comparisonResult;
5303 BloombergLP::bslalg::RbTreeNode *insertLocation =
5304 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5305 &comparisonResult,
5306 &d_tree,
5307 this->comparator(),
5308 static_cast<const Node *>(node)->value().first);
5309 if (!comparisonResult) {
5310 nodeFactory().deleteNode(node);
5311 return pair<iterator, bool>(iterator(insertLocation), false);
5312 }
5313
5314 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5315 insertLocation,
5316 comparisonResult < 0,
5317 node);
5318 return pair<iterator, bool>(iterator(node), true);
5319}
5320#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 5
5321
5322#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 6
5323template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5324template <class Args_01,
5325 class Args_02,
5326 class Args_03,
5327 class Args_04,
5328 class Args_05,
5329 class Args_06>
5330inline
5331pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5332map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5333 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5334 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5335 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5336 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5337 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5338 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
5339{
5340 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5341 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5342 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5343 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5344 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5345 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5346 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
5347 int comparisonResult;
5348 BloombergLP::bslalg::RbTreeNode *insertLocation =
5349 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5350 &comparisonResult,
5351 &d_tree,
5352 this->comparator(),
5353 static_cast<const Node *>(node)->value().first);
5354 if (!comparisonResult) {
5355 nodeFactory().deleteNode(node);
5356 return pair<iterator, bool>(iterator(insertLocation), false);
5357 }
5358
5359 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5360 insertLocation,
5361 comparisonResult < 0,
5362 node);
5363 return pair<iterator, bool>(iterator(node), true);
5364}
5365#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 6
5366
5367#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 7
5368template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5369template <class Args_01,
5370 class Args_02,
5371 class Args_03,
5372 class Args_04,
5373 class Args_05,
5374 class Args_06,
5375 class Args_07>
5376inline
5377pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5378map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5379 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5380 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5381 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5382 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5383 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5384 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5385 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
5386{
5387 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5388 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5389 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5390 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5391 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5392 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5393 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5394 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
5395 int comparisonResult;
5396 BloombergLP::bslalg::RbTreeNode *insertLocation =
5397 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5398 &comparisonResult,
5399 &d_tree,
5400 this->comparator(),
5401 static_cast<const Node *>(node)->value().first);
5402 if (!comparisonResult) {
5403 nodeFactory().deleteNode(node);
5404 return pair<iterator, bool>(iterator(insertLocation), false);
5405 }
5406
5407 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5408 insertLocation,
5409 comparisonResult < 0,
5410 node);
5411 return pair<iterator, bool>(iterator(node), true);
5412}
5413#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 7
5414
5415#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 8
5416template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5417template <class Args_01,
5418 class Args_02,
5419 class Args_03,
5420 class Args_04,
5421 class Args_05,
5422 class Args_06,
5423 class Args_07,
5424 class Args_08>
5425inline
5426pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5427map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5428 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5429 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5430 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5431 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5432 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5433 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5434 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5435 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
5436{
5437 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
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 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5445 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
5446 int comparisonResult;
5447 BloombergLP::bslalg::RbTreeNode *insertLocation =
5448 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5449 &comparisonResult,
5450 &d_tree,
5451 this->comparator(),
5452 static_cast<const Node *>(node)->value().first);
5453 if (!comparisonResult) {
5454 nodeFactory().deleteNode(node);
5455 return pair<iterator, bool>(iterator(insertLocation), false);
5456 }
5457
5458 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5459 insertLocation,
5460 comparisonResult < 0,
5461 node);
5462 return pair<iterator, bool>(iterator(node), true);
5463}
5464#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 8
5465
5466#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 9
5467template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5468template <class Args_01,
5469 class Args_02,
5470 class Args_03,
5471 class Args_04,
5472 class Args_05,
5473 class Args_06,
5474 class Args_07,
5475 class Args_08,
5476 class Args_09>
5477inline
5478pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5479map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5480 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5481 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5482 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5483 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5484 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5485 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5486 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5487 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5488 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
5489{
5490 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5491 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5492 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5493 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5494 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5495 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5496 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5497 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5498 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5499 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
5500 int comparisonResult;
5501 BloombergLP::bslalg::RbTreeNode *insertLocation =
5502 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5503 &comparisonResult,
5504 &d_tree,
5505 this->comparator(),
5506 static_cast<const Node *>(node)->value().first);
5507 if (!comparisonResult) {
5508 nodeFactory().deleteNode(node);
5509 return pair<iterator, bool>(iterator(insertLocation), false);
5510 }
5511
5512 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5513 insertLocation,
5514 comparisonResult < 0,
5515 node);
5516 return pair<iterator, bool>(iterator(node), true);
5517}
5518#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 9
5519
5520#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 10
5521template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5522template <class Args_01,
5523 class Args_02,
5524 class Args_03,
5525 class Args_04,
5526 class Args_05,
5527 class Args_06,
5528 class Args_07,
5529 class Args_08,
5530 class Args_09,
5531 class Args_10>
5532inline
5533pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
5534map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5535 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5536 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5537 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5538 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5539 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5540 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5541 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5542 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5543 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
5544 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
5545{
5546 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5547 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5548 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5549 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5550 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5551 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5552 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5553 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5554 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5555 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
5556 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
5557 int comparisonResult;
5558 BloombergLP::bslalg::RbTreeNode *insertLocation =
5559 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5560 &comparisonResult,
5561 &d_tree,
5562 this->comparator(),
5563 static_cast<const Node *>(node)->value().first);
5564 if (!comparisonResult) {
5565 nodeFactory().deleteNode(node);
5566 return pair<iterator, bool>(iterator(insertLocation), false);
5567 }
5568
5569 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5570 insertLocation,
5571 comparisonResult < 0,
5572 node);
5573 return pair<iterator, bool>(iterator(node), true);
5574}
5575#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 10
5576
5577
5578#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 0
5579template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5580inline
5581typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5582map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint)
5583{
5584 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5585 );
5586 BloombergLP::bslalg::RbTreeNode *hintNode =
5587 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5588 int comparisonResult;
5589 BloombergLP::bslalg::RbTreeNode *insertLocation =
5590 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5591 &comparisonResult,
5592 &d_tree,
5593 this->comparator(),
5594 static_cast<const Node *>(node)->value().first,
5595 hintNode);
5596 if (!comparisonResult) {
5597 nodeFactory().deleteNode(node);
5598 return iterator(insertLocation);
5599 }
5600
5601 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5602 insertLocation,
5603 comparisonResult < 0,
5604 node);
5605 return iterator(node);
5606}
5607#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 0
5608
5609#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 1
5610template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5611template <class Args_01>
5612inline
5613typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5614map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5615 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
5616{
5617 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5618 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01));
5619 BloombergLP::bslalg::RbTreeNode *hintNode =
5620 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5621 int comparisonResult;
5622 BloombergLP::bslalg::RbTreeNode *insertLocation =
5623 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5624 &comparisonResult,
5625 &d_tree,
5626 this->comparator(),
5627 static_cast<const Node *>(node)->value().first,
5628 hintNode);
5629 if (!comparisonResult) {
5630 nodeFactory().deleteNode(node);
5631 return iterator(insertLocation);
5632 }
5633
5634 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5635 insertLocation,
5636 comparisonResult < 0,
5637 node);
5638 return iterator(node);
5639}
5640#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 1
5641
5642#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 2
5643template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5644template <class Args_01,
5645 class Args_02>
5646inline
5647typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5648map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5649 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5650 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
5651{
5652 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5653 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5654 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02));
5655 BloombergLP::bslalg::RbTreeNode *hintNode =
5656 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5657 int comparisonResult;
5658 BloombergLP::bslalg::RbTreeNode *insertLocation =
5659 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5660 &comparisonResult,
5661 &d_tree,
5662 this->comparator(),
5663 static_cast<const Node *>(node)->value().first,
5664 hintNode);
5665 if (!comparisonResult) {
5666 nodeFactory().deleteNode(node);
5667 return iterator(insertLocation);
5668 }
5669
5670 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5671 insertLocation,
5672 comparisonResult < 0,
5673 node);
5674 return iterator(node);
5675}
5676#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 2
5677
5678#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 3
5679template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5680template <class Args_01,
5681 class Args_02,
5682 class Args_03>
5683inline
5684typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5685map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5686 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5687 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5688 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
5689{
5690 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5691 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5692 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5693 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03));
5694 BloombergLP::bslalg::RbTreeNode *hintNode =
5695 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5696 int comparisonResult;
5697 BloombergLP::bslalg::RbTreeNode *insertLocation =
5698 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5699 &comparisonResult,
5700 &d_tree,
5701 this->comparator(),
5702 static_cast<const Node *>(node)->value().first,
5703 hintNode);
5704 if (!comparisonResult) {
5705 nodeFactory().deleteNode(node);
5706 return iterator(insertLocation);
5707 }
5708
5709 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5710 insertLocation,
5711 comparisonResult < 0,
5712 node);
5713 return iterator(node);
5714}
5715#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 3
5716
5717#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 4
5718template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5719template <class Args_01,
5720 class Args_02,
5721 class Args_03,
5722 class Args_04>
5723inline
5724typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5725map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5726 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5727 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5728 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5729 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
5730{
5731 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5732 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5733 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5734 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5735 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04));
5736 BloombergLP::bslalg::RbTreeNode *hintNode =
5737 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5738 int comparisonResult;
5739 BloombergLP::bslalg::RbTreeNode *insertLocation =
5740 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5741 &comparisonResult,
5742 &d_tree,
5743 this->comparator(),
5744 static_cast<const Node *>(node)->value().first,
5745 hintNode);
5746 if (!comparisonResult) {
5747 nodeFactory().deleteNode(node);
5748 return iterator(insertLocation);
5749 }
5750
5751 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5752 insertLocation,
5753 comparisonResult < 0,
5754 node);
5755 return iterator(node);
5756}
5757#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 4
5758
5759#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 5
5760template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5761template <class Args_01,
5762 class Args_02,
5763 class Args_03,
5764 class Args_04,
5765 class Args_05>
5766inline
5767typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5768map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5769 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5770 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5771 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5772 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5773 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
5774{
5775 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5776 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5777 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5778 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5779 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5780 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05));
5781 BloombergLP::bslalg::RbTreeNode *hintNode =
5782 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5783 int comparisonResult;
5784 BloombergLP::bslalg::RbTreeNode *insertLocation =
5785 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5786 &comparisonResult,
5787 &d_tree,
5788 this->comparator(),
5789 static_cast<const Node *>(node)->value().first,
5790 hintNode);
5791 if (!comparisonResult) {
5792 nodeFactory().deleteNode(node);
5793 return iterator(insertLocation);
5794 }
5795
5796 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5797 insertLocation,
5798 comparisonResult < 0,
5799 node);
5800 return iterator(node);
5801}
5802#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 5
5803
5804#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 6
5805template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5806template <class Args_01,
5807 class Args_02,
5808 class Args_03,
5809 class Args_04,
5810 class Args_05,
5811 class Args_06>
5812inline
5813typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5814map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5815 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5816 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5817 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5818 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5819 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5820 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
5821{
5822 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5823 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5824 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5825 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5826 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5827 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5828 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06));
5829 BloombergLP::bslalg::RbTreeNode *hintNode =
5830 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5831 int comparisonResult;
5832 BloombergLP::bslalg::RbTreeNode *insertLocation =
5833 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5834 &comparisonResult,
5835 &d_tree,
5836 this->comparator(),
5837 static_cast<const Node *>(node)->value().first,
5838 hintNode);
5839 if (!comparisonResult) {
5840 nodeFactory().deleteNode(node);
5841 return iterator(insertLocation);
5842 }
5843
5844 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5845 insertLocation,
5846 comparisonResult < 0,
5847 node);
5848 return iterator(node);
5849}
5850#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 6
5851
5852#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 7
5853template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5854template <class Args_01,
5855 class Args_02,
5856 class Args_03,
5857 class Args_04,
5858 class Args_05,
5859 class Args_06,
5860 class Args_07>
5861inline
5862typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5863map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5864 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5865 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5866 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5867 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5868 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5869 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5870 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
5871{
5872 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5873 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5874 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5875 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5876 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5877 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5878 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5879 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07));
5880 BloombergLP::bslalg::RbTreeNode *hintNode =
5881 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5882 int comparisonResult;
5883 BloombergLP::bslalg::RbTreeNode *insertLocation =
5884 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5885 &comparisonResult,
5886 &d_tree,
5887 this->comparator(),
5888 static_cast<const Node *>(node)->value().first,
5889 hintNode);
5890 if (!comparisonResult) {
5891 nodeFactory().deleteNode(node);
5892 return iterator(insertLocation);
5893 }
5894
5895 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5896 insertLocation,
5897 comparisonResult < 0,
5898 node);
5899 return iterator(node);
5900}
5901#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 7
5902
5903#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 8
5904template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5905template <class Args_01,
5906 class Args_02,
5907 class Args_03,
5908 class Args_04,
5909 class Args_05,
5910 class Args_06,
5911 class Args_07,
5912 class Args_08>
5913inline
5914typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5915map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5916 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5917 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5918 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5919 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5920 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5921 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5922 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5923 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
5924{
5925 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5926 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5927 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5928 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5929 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5930 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5931 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5932 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5933 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08));
5934 BloombergLP::bslalg::RbTreeNode *hintNode =
5935 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5936 int comparisonResult;
5937 BloombergLP::bslalg::RbTreeNode *insertLocation =
5938 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5939 &comparisonResult,
5940 &d_tree,
5941 this->comparator(),
5942 static_cast<const Node *>(node)->value().first,
5943 hintNode);
5944 if (!comparisonResult) {
5945 nodeFactory().deleteNode(node);
5946 return iterator(insertLocation);
5947 }
5948
5949 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5950 insertLocation,
5951 comparisonResult < 0,
5952 node);
5953 return iterator(node);
5954}
5955#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 8
5956
5957#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 9
5958template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
5959template <class Args_01,
5960 class Args_02,
5961 class Args_03,
5962 class Args_04,
5963 class Args_05,
5964 class Args_06,
5965 class Args_07,
5966 class Args_08,
5967 class Args_09>
5968inline
5969typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5970map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
5971 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
5972 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
5973 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
5974 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
5975 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
5976 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
5977 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
5978 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
5979 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
5980{
5981 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5982 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
5983 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
5984 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
5985 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
5986 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
5987 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
5988 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
5989 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
5990 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09));
5991 BloombergLP::bslalg::RbTreeNode *hintNode =
5992 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
5993 int comparisonResult;
5994 BloombergLP::bslalg::RbTreeNode *insertLocation =
5995 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5996 &comparisonResult,
5997 &d_tree,
5998 this->comparator(),
5999 static_cast<const Node *>(node)->value().first,
6000 hintNode);
6001 if (!comparisonResult) {
6002 nodeFactory().deleteNode(node);
6003 return iterator(insertLocation);
6004 }
6005
6006 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6007 insertLocation,
6008 comparisonResult < 0,
6009 node);
6010 return iterator(node);
6011}
6012#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 9
6013
6014#if BSLSTL_MAP_VARIADIC_LIMIT_E >= 10
6015template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6016template <class Args_01,
6017 class Args_02,
6018 class Args_03,
6019 class Args_04,
6020 class Args_05,
6021 class Args_06,
6022 class Args_07,
6023 class Args_08,
6024 class Args_09,
6025 class Args_10>
6026inline
6027typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6028map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6029 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6030 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6031 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6032 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6033 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6034 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6035 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6036 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6037 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
6038 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
6039{
6040 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6041 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6042 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6043 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6044 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6045 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6046 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6047 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6048 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6049 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
6050 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10));
6051 BloombergLP::bslalg::RbTreeNode *hintNode =
6052 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6053 int comparisonResult;
6054 BloombergLP::bslalg::RbTreeNode *insertLocation =
6055 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6056 &comparisonResult,
6057 &d_tree,
6058 this->comparator(),
6059 static_cast<const Node *>(node)->value().first,
6060 hintNode);
6061 if (!comparisonResult) {
6062 nodeFactory().deleteNode(node);
6063 return iterator(insertLocation);
6064 }
6065
6066 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6067 insertLocation,
6068 comparisonResult < 0,
6069 node);
6070 return iterator(node);
6071}
6072#endif // BSLSTL_MAP_VARIADIC_LIMIT_E >= 10
6073
6074#else
6075// The generated code below is a workaround for the absence of perfect
6076// forwarding in some compilers.
6077
6078template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6079template <class... Args>
6080inline
6081pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6082map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
6084{
6085 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6086 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6087 int comparisonResult;
6088 BloombergLP::bslalg::RbTreeNode *insertLocation =
6089 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6090 &comparisonResult,
6091 &d_tree,
6092 this->comparator(),
6093 static_cast<const Node *>(node)->value().first);
6094 if (!comparisonResult) {
6095 nodeFactory().deleteNode(node);
6096 return pair<iterator, bool>(iterator(insertLocation), false);
6097 }
6098
6099 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6100 insertLocation,
6101 comparisonResult < 0,
6102 node);
6103 return pair<iterator, bool>(iterator(node), true);
6104}
6105
6106template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6107template <class... Args>
6108inline
6109typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6110map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6112{
6113 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6114 BSLS_COMPILERFEATURES_FORWARD(Args, args)...);
6115 BloombergLP::bslalg::RbTreeNode *hintNode =
6116 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6117 int comparisonResult;
6118 BloombergLP::bslalg::RbTreeNode *insertLocation =
6119 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6120 &comparisonResult,
6121 &d_tree,
6122 this->comparator(),
6123 static_cast<const Node *>(node)->value().first,
6124 hintNode);
6125 if (!comparisonResult) {
6126 nodeFactory().deleteNode(node);
6127 return iterator(insertLocation);
6128 }
6129
6130 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6131 insertLocation,
6132 comparisonResult < 0,
6133 node);
6134 return iterator(node);
6135}
6136
6137// }}} END GENERATED CODE
6138#endif
6139
6140template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6141inline
6142typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6143map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator position)
6144{
6145 BSLS_ASSERT_SAFE(position != end());
6146
6147 BloombergLP::bslalg::RbTreeNode *node =
6148 const_cast<BloombergLP::bslalg::RbTreeNode *>(position.node());
6149 BloombergLP::bslalg::RbTreeNode *result =
6150 BloombergLP::bslalg::RbTreeUtil::next(node);
6151 BloombergLP::bslalg::RbTreeUtil::remove(&d_tree, node);
6152 nodeFactory().deleteNode(node);
6153 return iterator(result);
6154}
6155
6156template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6157inline
6158typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6159map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(iterator position)
6160{
6161 return erase(const_iterator(position));
6162}
6163
6164template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6165inline
6166typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
6167map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const key_type& key)
6168{
6169 const_iterator it = find(key);
6170 if (it == end()) {
6171 return 0; // RETURN
6172 }
6173 erase(it);
6174 return 1;
6175}
6176
6177template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6178inline
6179typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6180map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator first,
6181 const_iterator last)
6182{
6183 while (first != last) {
6184 first = erase(first);
6185 }
6186 return iterator(last.node());
6187}
6188
6189template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6190inline
6191void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::swap(map& other)
6193 AllocatorTraits::is_always_equal::value &&
6194 bsl::is_nothrow_swappable<COMPARATOR>::value)
6195{
6196 if (AllocatorTraits::propagate_on_container_swap::value) {
6197 quickSwapExchangeAllocators(other);
6198 }
6199 else {
6200 // C++11 behavior for member 'swap': undefined for unequal allocators.
6201 // BSLS_ASSERT(allocator() == other.allocator());
6202
6204 nodeFactory().allocator() == other.nodeFactory().allocator())) {
6205 quickSwapRetainAllocators(other);
6206 }
6207 else {
6209
6210 map toOtherCopy(MoveUtil::move(*this),
6211 other.nodeFactory().allocator());
6212 map toThisCopy(MoveUtil::move(other), nodeFactory().allocator());
6213
6214 this->quickSwapRetainAllocators(toThisCopy);
6215 other.quickSwapRetainAllocators(toOtherCopy);
6216 }
6217 }
6218}
6219
6220#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6221// {{{ BEGIN GENERATED CODE
6222// Command line: sim_cpp11_features.pl bslstl_map.h
6223#ifndef BSLSTL_MAP_VARIADIC_LIMIT
6224#define BSLSTL_MAP_VARIADIC_LIMIT 10
6225#endif
6226#ifndef BSLSTL_MAP_VARIADIC_LIMIT_F
6227#define BSLSTL_MAP_VARIADIC_LIMIT_F BSLSTL_MAP_VARIADIC_LIMIT
6228#endif
6229#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
6230template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6231inline
6232pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6233map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key)
6234{
6235 int comparisonResult;
6236 BloombergLP::bslalg::RbTreeNode *insertLocation =
6237 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6238 &comparisonResult,
6239 &d_tree,
6240 this->comparator(),
6241 key);
6242 if (!comparisonResult) {
6243 return pair<iterator, bool>(iterator(insertLocation), false);
6244 }
6245
6246#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6247 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6248 std::piecewise_construct,
6249 std::forward_as_tuple(key),
6250 std::forward_as_tuple());
6251#else
6252 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6253 key,
6254 mapped_type());
6255#endif
6256
6257 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6258 insertLocation,
6259 comparisonResult < 0,
6260 node);
6261 return pair<iterator, bool>(iterator(node), true);
6262}
6263#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
6264
6265#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
6266template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6267template <class Args_01>
6268inline
6269pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6270map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6271 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
6272{
6273 int comparisonResult;
6274 BloombergLP::bslalg::RbTreeNode *insertLocation =
6275 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6276 &comparisonResult,
6277 &d_tree,
6278 this->comparator(),
6279 key);
6280 if (!comparisonResult) {
6281 return pair<iterator, bool>(iterator(insertLocation), false);
6282 }
6283
6284#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6285 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6286 std::piecewise_construct,
6287 std::forward_as_tuple(key),
6288 std::forward_as_tuple(
6289 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
6290#else
6291 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6292 key,
6293 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
6294#endif
6295
6296 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6297 insertLocation,
6298 comparisonResult < 0,
6299 node);
6300 return pair<iterator, bool>(iterator(node), true);
6301}
6302#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
6303
6304#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
6305template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6306template <class Args_01,
6307 class Args_02>
6308inline
6309pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6310map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6311 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6312 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
6313{
6314 int comparisonResult;
6315 BloombergLP::bslalg::RbTreeNode *insertLocation =
6316 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6317 &comparisonResult,
6318 &d_tree,
6319 this->comparator(),
6320 key);
6321 if (!comparisonResult) {
6322 return pair<iterator, bool>(iterator(insertLocation), false);
6323 }
6324
6325#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6326 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6327 std::piecewise_construct,
6328 std::forward_as_tuple(key),
6329 std::forward_as_tuple(
6330 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6331 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
6332#else
6333 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6334 key,
6335 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6336 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
6337#endif
6338
6339 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6340 insertLocation,
6341 comparisonResult < 0,
6342 node);
6343 return pair<iterator, bool>(iterator(node), true);
6344}
6345#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
6346
6347#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
6348template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6349template <class Args_01,
6350 class Args_02,
6351 class Args_03>
6352inline
6353pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6354map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6355 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6356 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6357 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
6358{
6359 int comparisonResult;
6360 BloombergLP::bslalg::RbTreeNode *insertLocation =
6361 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6362 &comparisonResult,
6363 &d_tree,
6364 this->comparator(),
6365 key);
6366 if (!comparisonResult) {
6367 return pair<iterator, bool>(iterator(insertLocation), false);
6368 }
6369
6370#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6371 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6372 std::piecewise_construct,
6373 std::forward_as_tuple(key),
6374 std::forward_as_tuple(
6375 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6376 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6377 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
6378#else
6379 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6380 key,
6381 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6382 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6383 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
6384#endif
6385
6386 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6387 insertLocation,
6388 comparisonResult < 0,
6389 node);
6390 return pair<iterator, bool>(iterator(node), true);
6391}
6392#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
6393
6394#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
6395template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6396template <class Args_01,
6397 class Args_02,
6398 class Args_03,
6399 class Args_04>
6400inline
6401pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6402map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6403 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6404 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6405 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6406 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
6407{
6408 int comparisonResult;
6409 BloombergLP::bslalg::RbTreeNode *insertLocation =
6410 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6411 &comparisonResult,
6412 &d_tree,
6413 this->comparator(),
6414 key);
6415 if (!comparisonResult) {
6416 return pair<iterator, bool>(iterator(insertLocation), false);
6417 }
6418
6419#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6420 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6421 std::piecewise_construct,
6422 std::forward_as_tuple(key),
6423 std::forward_as_tuple(
6424 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6425 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6426 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6427 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
6428#else
6429 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6430 key,
6431 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6432 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6433 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6434 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
6435#endif
6436
6437 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6438 insertLocation,
6439 comparisonResult < 0,
6440 node);
6441 return pair<iterator, bool>(iterator(node), true);
6442}
6443#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
6444
6445#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
6446template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6447template <class Args_01,
6448 class Args_02,
6449 class Args_03,
6450 class Args_04,
6451 class Args_05>
6452inline
6453pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6454map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6455 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6456 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6457 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6458 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6459 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
6460{
6461 int comparisonResult;
6462 BloombergLP::bslalg::RbTreeNode *insertLocation =
6463 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6464 &comparisonResult,
6465 &d_tree,
6466 this->comparator(),
6467 key);
6468 if (!comparisonResult) {
6469 return pair<iterator, bool>(iterator(insertLocation), false);
6470 }
6471
6472#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6473 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6474 std::piecewise_construct,
6475 std::forward_as_tuple(key),
6476 std::forward_as_tuple(
6477 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6478 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6479 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6480 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6481 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
6482#else
6483 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6484 key,
6485 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6486 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6487 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6488 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6489 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
6490#endif
6491
6492 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6493 insertLocation,
6494 comparisonResult < 0,
6495 node);
6496 return pair<iterator, bool>(iterator(node), true);
6497}
6498#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
6499
6500#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
6501template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6502template <class Args_01,
6503 class Args_02,
6504 class Args_03,
6505 class Args_04,
6506 class Args_05,
6507 class Args_06>
6508inline
6509pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6510map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6511 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6512 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6513 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6514 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6515 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6516 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
6517{
6518 int comparisonResult;
6519 BloombergLP::bslalg::RbTreeNode *insertLocation =
6520 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6521 &comparisonResult,
6522 &d_tree,
6523 this->comparator(),
6524 key);
6525 if (!comparisonResult) {
6526 return pair<iterator, bool>(iterator(insertLocation), false);
6527 }
6528
6529#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6530 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6531 std::piecewise_construct,
6532 std::forward_as_tuple(key),
6533 std::forward_as_tuple(
6534 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6535 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6536 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6537 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6538 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6539 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
6540#else
6541 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6542 key,
6543 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6544 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6545 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6546 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6547 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6548 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
6549#endif
6550
6551 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6552 insertLocation,
6553 comparisonResult < 0,
6554 node);
6555 return pair<iterator, bool>(iterator(node), true);
6556}
6557#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
6558
6559#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
6560template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6561template <class Args_01,
6562 class Args_02,
6563 class Args_03,
6564 class Args_04,
6565 class Args_05,
6566 class Args_06,
6567 class Args_07>
6568inline
6569pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6570map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6571 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6572 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6573 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6574 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6575 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6576 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6577 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
6578{
6579 int comparisonResult;
6580 BloombergLP::bslalg::RbTreeNode *insertLocation =
6581 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6582 &comparisonResult,
6583 &d_tree,
6584 this->comparator(),
6585 key);
6586 if (!comparisonResult) {
6587 return pair<iterator, bool>(iterator(insertLocation), false);
6588 }
6589
6590#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6591 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6592 std::piecewise_construct,
6593 std::forward_as_tuple(key),
6594 std::forward_as_tuple(
6595 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6596 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6597 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6598 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6599 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6600 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6601 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
6602#else
6603 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6604 key,
6605 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6606 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6607 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6608 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6609 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6610 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6611 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
6612#endif
6613
6614 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6615 insertLocation,
6616 comparisonResult < 0,
6617 node);
6618 return pair<iterator, bool>(iterator(node), true);
6619}
6620#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
6621
6622#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
6623template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6624template <class Args_01,
6625 class Args_02,
6626 class Args_03,
6627 class Args_04,
6628 class Args_05,
6629 class Args_06,
6630 class Args_07,
6631 class Args_08>
6632inline
6633pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6634map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6635 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6636 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6637 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6638 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6639 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6640 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6641 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6642 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
6643{
6644 int comparisonResult;
6645 BloombergLP::bslalg::RbTreeNode *insertLocation =
6646 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6647 &comparisonResult,
6648 &d_tree,
6649 this->comparator(),
6650 key);
6651 if (!comparisonResult) {
6652 return pair<iterator, bool>(iterator(insertLocation), false);
6653 }
6654
6655#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6656 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6657 std::piecewise_construct,
6658 std::forward_as_tuple(key),
6659 std::forward_as_tuple(
6660 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6661 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6662 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6663 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6664 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6665 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6666 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6667 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
6668#else
6669 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6670 key,
6671 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6672 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6673 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6674 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6675 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6676 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6677 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6678 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
6679#endif
6680
6681 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6682 insertLocation,
6683 comparisonResult < 0,
6684 node);
6685 return pair<iterator, bool>(iterator(node), true);
6686}
6687#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
6688
6689#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
6690template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6691template <class Args_01,
6692 class Args_02,
6693 class Args_03,
6694 class Args_04,
6695 class Args_05,
6696 class Args_06,
6697 class Args_07,
6698 class Args_08,
6699 class Args_09>
6700inline
6701pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6702map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6703 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6704 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6705 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6706 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6707 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6708 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6709 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6710 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6711 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
6712{
6713 int comparisonResult;
6714 BloombergLP::bslalg::RbTreeNode *insertLocation =
6715 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6716 &comparisonResult,
6717 &d_tree,
6718 this->comparator(),
6719 key);
6720 if (!comparisonResult) {
6721 return pair<iterator, bool>(iterator(insertLocation), false);
6722 }
6723
6724#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6725 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6726 std::piecewise_construct,
6727 std::forward_as_tuple(key),
6728 std::forward_as_tuple(
6729 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6730 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6731 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6732 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6733 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6734 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6735 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6736 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6737 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
6738#else
6739 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6740 key,
6741 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6742 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6743 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6744 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6745 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6746 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6747 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6748 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6749 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
6750#endif
6751
6752 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6753 insertLocation,
6754 comparisonResult < 0,
6755 node);
6756 return pair<iterator, bool>(iterator(node), true);
6757}
6758#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
6759
6760#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
6761template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6762template <class Args_01,
6763 class Args_02,
6764 class Args_03,
6765 class Args_04,
6766 class Args_05,
6767 class Args_06,
6768 class Args_07,
6769 class Args_08,
6770 class Args_09,
6771 class Args_10>
6772inline
6773pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
6774map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
6775 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6776 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6777 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
6778 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
6779 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
6780 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
6781 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
6782 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
6783 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
6784 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
6785{
6786 int comparisonResult;
6787 BloombergLP::bslalg::RbTreeNode *insertLocation =
6788 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6789 &comparisonResult,
6790 &d_tree,
6791 this->comparator(),
6792 key);
6793 if (!comparisonResult) {
6794 return pair<iterator, bool>(iterator(insertLocation), false);
6795 }
6796
6797#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6798 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6799 std::piecewise_construct,
6800 std::forward_as_tuple(key),
6801 std::forward_as_tuple(
6802 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6803 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6804 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6805 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6806 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6807 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6808 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6809 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6810 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
6811 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
6812#else
6813 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6814 key,
6815 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6816 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
6817 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
6818 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
6819 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
6820 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
6821 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
6822 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
6823 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
6824 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
6825#endif
6826
6827 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6828 insertLocation,
6829 comparisonResult < 0,
6830 node);
6831 return pair<iterator, bool>(iterator(node), true);
6832}
6833#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
6834
6835
6836#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
6837template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6838inline
6839typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6840map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
6841 const key_type& key)
6842{
6843 BloombergLP::bslalg::RbTreeNode *hintNode =
6844 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6845 int comparisonResult;
6846 BloombergLP::bslalg::RbTreeNode *insertLocation =
6847 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6848 &comparisonResult,
6849 &d_tree,
6850 this->comparator(),
6851 key,
6852 hintNode);
6853 if (!comparisonResult) {
6854 return iterator(insertLocation);
6855 }
6856
6857#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6858 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6859 std::piecewise_construct,
6860 std::forward_as_tuple(key),
6861 std::forward_as_tuple());
6862#else
6863 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6864 key,
6865 mapped_type());
6866#endif
6867
6868 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6869 insertLocation,
6870 comparisonResult < 0,
6871 node);
6872 return iterator(node);
6873}
6874#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
6875
6876#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
6877template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6878template <class Args_01>
6879inline
6880typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6881map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
6882 const key_type& key,
6883 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
6884{
6885 BloombergLP::bslalg::RbTreeNode *hintNode =
6886 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6887 int comparisonResult;
6888 BloombergLP::bslalg::RbTreeNode *insertLocation =
6889 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6890 &comparisonResult,
6891 &d_tree,
6892 this->comparator(),
6893 key,
6894 hintNode);
6895 if (!comparisonResult) {
6896 return iterator(insertLocation);
6897 }
6898
6899#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6900 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6901 std::piecewise_construct,
6902 std::forward_as_tuple(key),
6903 std::forward_as_tuple(
6904 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
6905#else
6906 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6907 key,
6908 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
6909#endif
6910
6911 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6912 insertLocation,
6913 comparisonResult < 0,
6914 node);
6915 return iterator(node);
6916}
6917#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
6918
6919#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
6920template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6921template <class Args_01,
6922 class Args_02>
6923inline
6924typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6925map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
6926 const key_type& key,
6927 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6928 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
6929{
6930 BloombergLP::bslalg::RbTreeNode *hintNode =
6931 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6932 int comparisonResult;
6933 BloombergLP::bslalg::RbTreeNode *insertLocation =
6934 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6935 &comparisonResult,
6936 &d_tree,
6937 this->comparator(),
6938 key,
6939 hintNode);
6940 if (!comparisonResult) {
6941 return iterator(insertLocation);
6942 }
6943
6944#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6945 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6946 std::piecewise_construct,
6947 std::forward_as_tuple(key),
6948 std::forward_as_tuple(
6949 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6950 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
6951#else
6952 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6953 key,
6954 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6955 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
6956#endif
6957
6958 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6959 insertLocation,
6960 comparisonResult < 0,
6961 node);
6962 return iterator(node);
6963}
6964#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
6965
6966#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
6967template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
6968template <class Args_01,
6969 class Args_02,
6970 class Args_03>
6971inline
6972typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6973map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
6974 const key_type& key,
6975 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
6976 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
6977 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
6978{
6979 BloombergLP::bslalg::RbTreeNode *hintNode =
6980 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
6981 int comparisonResult;
6982 BloombergLP::bslalg::RbTreeNode *insertLocation =
6983 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6984 &comparisonResult,
6985 &d_tree,
6986 this->comparator(),
6987 key,
6988 hintNode);
6989 if (!comparisonResult) {
6990 return iterator(insertLocation);
6991 }
6992
6993#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6994 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6995 std::piecewise_construct,
6996 std::forward_as_tuple(key),
6997 std::forward_as_tuple(
6998 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
6999 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7000 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
7001#else
7002 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7003 key,
7004 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7005 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7006 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
7007#endif
7008
7009 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7010 insertLocation,
7011 comparisonResult < 0,
7012 node);
7013 return iterator(node);
7014}
7015#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
7016
7017#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
7018template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7019template <class Args_01,
7020 class Args_02,
7021 class Args_03,
7022 class Args_04>
7023inline
7024typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7025map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7026 const key_type& key,
7027 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7028 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7029 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7030 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
7031{
7032 BloombergLP::bslalg::RbTreeNode *hintNode =
7033 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7034 int comparisonResult;
7035 BloombergLP::bslalg::RbTreeNode *insertLocation =
7036 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7037 &comparisonResult,
7038 &d_tree,
7039 this->comparator(),
7040 key,
7041 hintNode);
7042 if (!comparisonResult) {
7043 return iterator(insertLocation);
7044 }
7045
7046#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7047 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7048 std::piecewise_construct,
7049 std::forward_as_tuple(key),
7050 std::forward_as_tuple(
7051 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7052 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7053 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7054 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
7055#else
7056 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7057 key,
7058 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7059 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7060 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7061 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
7062#endif
7063
7064 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7065 insertLocation,
7066 comparisonResult < 0,
7067 node);
7068 return iterator(node);
7069}
7070#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
7071
7072#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
7073template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7074template <class Args_01,
7075 class Args_02,
7076 class Args_03,
7077 class Args_04,
7078 class Args_05>
7079inline
7080typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7081map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7082 const key_type& key,
7083 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7084 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7085 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7086 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7087 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
7088{
7089 BloombergLP::bslalg::RbTreeNode *hintNode =
7090 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7091 int comparisonResult;
7092 BloombergLP::bslalg::RbTreeNode *insertLocation =
7093 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7094 &comparisonResult,
7095 &d_tree,
7096 this->comparator(),
7097 key,
7098 hintNode);
7099 if (!comparisonResult) {
7100 return iterator(insertLocation);
7101 }
7102
7103#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7104 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7105 std::piecewise_construct,
7106 std::forward_as_tuple(key),
7107 std::forward_as_tuple(
7108 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7109 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7110 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7111 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7112 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
7113#else
7114 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7115 key,
7116 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7117 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7118 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7119 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7120 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
7121#endif
7122
7123 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7124 insertLocation,
7125 comparisonResult < 0,
7126 node);
7127 return iterator(node);
7128}
7129#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
7130
7131#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
7132template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7133template <class Args_01,
7134 class Args_02,
7135 class Args_03,
7136 class Args_04,
7137 class Args_05,
7138 class Args_06>
7139inline
7140typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7141map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7142 const key_type& key,
7143 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7144 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7145 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7146 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7147 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7148 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
7149{
7150 BloombergLP::bslalg::RbTreeNode *hintNode =
7151 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7152 int comparisonResult;
7153 BloombergLP::bslalg::RbTreeNode *insertLocation =
7154 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7155 &comparisonResult,
7156 &d_tree,
7157 this->comparator(),
7158 key,
7159 hintNode);
7160 if (!comparisonResult) {
7161 return iterator(insertLocation);
7162 }
7163
7164#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7165 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7166 std::piecewise_construct,
7167 std::forward_as_tuple(key),
7168 std::forward_as_tuple(
7169 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7170 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7171 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7172 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7173 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7174 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
7175#else
7176 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7177 key,
7178 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7179 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7180 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7181 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7182 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7183 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
7184#endif
7185
7186 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7187 insertLocation,
7188 comparisonResult < 0,
7189 node);
7190 return iterator(node);
7191}
7192#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
7193
7194#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
7195template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7196template <class Args_01,
7197 class Args_02,
7198 class Args_03,
7199 class Args_04,
7200 class Args_05,
7201 class Args_06,
7202 class Args_07>
7203inline
7204typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7205map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7206 const key_type& key,
7207 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7208 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7209 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7210 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7211 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7212 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7213 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
7214{
7215 BloombergLP::bslalg::RbTreeNode *hintNode =
7216 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7217 int comparisonResult;
7218 BloombergLP::bslalg::RbTreeNode *insertLocation =
7219 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7220 &comparisonResult,
7221 &d_tree,
7222 this->comparator(),
7223 key,
7224 hintNode);
7225 if (!comparisonResult) {
7226 return iterator(insertLocation);
7227 }
7228
7229#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7230 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7231 std::piecewise_construct,
7232 std::forward_as_tuple(key),
7233 std::forward_as_tuple(
7234 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7235 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7236 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7237 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7238 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7239 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7240 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
7241#else
7242 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7243 key,
7244 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7245 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7246 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7247 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7248 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7249 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7250 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
7251#endif
7252
7253 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7254 insertLocation,
7255 comparisonResult < 0,
7256 node);
7257 return iterator(node);
7258}
7259#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
7260
7261#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
7262template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7263template <class Args_01,
7264 class Args_02,
7265 class Args_03,
7266 class Args_04,
7267 class Args_05,
7268 class Args_06,
7269 class Args_07,
7270 class Args_08>
7271inline
7272typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7273map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7274 const key_type& key,
7275 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7276 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7277 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7278 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7279 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7280 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7281 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
7282 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
7283{
7284 BloombergLP::bslalg::RbTreeNode *hintNode =
7285 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7286 int comparisonResult;
7287 BloombergLP::bslalg::RbTreeNode *insertLocation =
7288 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7289 &comparisonResult,
7290 &d_tree,
7291 this->comparator(),
7292 key,
7293 hintNode);
7294 if (!comparisonResult) {
7295 return iterator(insertLocation);
7296 }
7297
7298#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7299 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7300 std::piecewise_construct,
7301 std::forward_as_tuple(key),
7302 std::forward_as_tuple(
7303 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7304 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7305 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7306 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7307 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7308 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7309 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7310 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
7311#else
7312 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7313 key,
7314 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7315 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7316 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7317 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7318 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7319 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7320 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7321 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
7322#endif
7323
7324 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7325 insertLocation,
7326 comparisonResult < 0,
7327 node);
7328 return iterator(node);
7329}
7330#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
7331
7332#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
7333template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7334template <class Args_01,
7335 class Args_02,
7336 class Args_03,
7337 class Args_04,
7338 class Args_05,
7339 class Args_06,
7340 class Args_07,
7341 class Args_08,
7342 class Args_09>
7343inline
7344typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7345map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7346 const key_type& key,
7347 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7348 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7349 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7350 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7351 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7352 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7353 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
7354 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
7355 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
7356{
7357 BloombergLP::bslalg::RbTreeNode *hintNode =
7358 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7359 int comparisonResult;
7360 BloombergLP::bslalg::RbTreeNode *insertLocation =
7361 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7362 &comparisonResult,
7363 &d_tree,
7364 this->comparator(),
7365 key,
7366 hintNode);
7367 if (!comparisonResult) {
7368 return iterator(insertLocation);
7369 }
7370
7371#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7372 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7373 std::piecewise_construct,
7374 std::forward_as_tuple(key),
7375 std::forward_as_tuple(
7376 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7377 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7378 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7379 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7380 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7381 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7382 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7383 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
7384 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
7385#else
7386 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7387 key,
7388 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7389 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7390 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7391 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7392 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7393 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7394 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7395 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
7396 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
7397#endif
7398
7399 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7400 insertLocation,
7401 comparisonResult < 0,
7402 node);
7403 return iterator(node);
7404}
7405#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
7406
7407#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
7408template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7409template <class Args_01,
7410 class Args_02,
7411 class Args_03,
7412 class Args_04,
7413 class Args_05,
7414 class Args_06,
7415 class Args_07,
7416 class Args_08,
7417 class Args_09,
7418 class Args_10>
7419inline
7420typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7421map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7422 const key_type& key,
7423 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7424 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7425 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7426 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7427 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7428 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7429 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
7430 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
7431 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
7432 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
7433{
7434 BloombergLP::bslalg::RbTreeNode *hintNode =
7435 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
7436 int comparisonResult;
7437 BloombergLP::bslalg::RbTreeNode *insertLocation =
7438 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7439 &comparisonResult,
7440 &d_tree,
7441 this->comparator(),
7442 key,
7443 hintNode);
7444 if (!comparisonResult) {
7445 return iterator(insertLocation);
7446 }
7447
7448#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7449 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7450 std::piecewise_construct,
7451 std::forward_as_tuple(key),
7452 std::forward_as_tuple(
7453 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7454 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7455 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7456 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7457 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7458 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7459 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7460 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
7461 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
7462 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
7463#else
7464 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7465 key,
7466 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7467 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7468 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7469 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7470 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7471 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7472 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7473 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
7474 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
7475 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
7476#endif
7477
7478 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7479 insertLocation,
7480 comparisonResult < 0,
7481 node);
7482 return iterator(node);
7483}
7484#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
7485
7486
7487#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
7488template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7489inline
7490pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7491map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7492 BloombergLP::bslmf::MovableRef<key_type> key)
7493{
7494 key_type& lvalue = key;
7495
7496 int comparisonResult;
7497 BloombergLP::bslalg::RbTreeNode *insertLocation =
7498 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7499 &comparisonResult,
7500 &d_tree,
7501 this->comparator(),
7502 lvalue);
7503 if (!comparisonResult) {
7504 return pair<iterator, bool>(iterator(insertLocation), false);
7505 }
7506
7507#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7508 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7509 std::piecewise_construct,
7510 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7511 std::forward_as_tuple());
7512#else
7513 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7514 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7515 mapped_type());
7516#endif
7517
7518 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7519 insertLocation,
7520 comparisonResult < 0,
7521 node);
7522
7523 return pair<iterator, bool>(iterator(node), true);
7524}
7525#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
7526
7527#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
7528template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7529template <class Args_01>
7530inline
7531pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7532map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7533 BloombergLP::bslmf::MovableRef<key_type> key,
7534 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
7535{
7536 key_type& lvalue = key;
7537
7538 int comparisonResult;
7539 BloombergLP::bslalg::RbTreeNode *insertLocation =
7540 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7541 &comparisonResult,
7542 &d_tree,
7543 this->comparator(),
7544 lvalue);
7545 if (!comparisonResult) {
7546 return pair<iterator, bool>(iterator(insertLocation), false);
7547 }
7548
7549#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7550 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7551 std::piecewise_construct,
7552 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7553 std::forward_as_tuple(
7554 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
7555#else
7556 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7557 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7558 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
7559#endif
7560
7561 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7562 insertLocation,
7563 comparisonResult < 0,
7564 node);
7565
7566 return pair<iterator, bool>(iterator(node), true);
7567}
7568#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
7569
7570#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
7571template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7572template <class Args_01,
7573 class Args_02>
7574inline
7575pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7576map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7577 BloombergLP::bslmf::MovableRef<key_type> key,
7578 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7579 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
7580{
7581 key_type& lvalue = key;
7582
7583 int comparisonResult;
7584 BloombergLP::bslalg::RbTreeNode *insertLocation =
7585 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7586 &comparisonResult,
7587 &d_tree,
7588 this->comparator(),
7589 lvalue);
7590 if (!comparisonResult) {
7591 return pair<iterator, bool>(iterator(insertLocation), false);
7592 }
7593
7594#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7595 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7596 std::piecewise_construct,
7597 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7598 std::forward_as_tuple(
7599 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7600 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
7601#else
7602 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7603 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7604 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7605 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
7606#endif
7607
7608 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7609 insertLocation,
7610 comparisonResult < 0,
7611 node);
7612
7613 return pair<iterator, bool>(iterator(node), true);
7614}
7615#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
7616
7617#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
7618template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7619template <class Args_01,
7620 class Args_02,
7621 class Args_03>
7622inline
7623pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7624map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7625 BloombergLP::bslmf::MovableRef<key_type> key,
7626 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7627 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7628 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
7629{
7630 key_type& lvalue = key;
7631
7632 int comparisonResult;
7633 BloombergLP::bslalg::RbTreeNode *insertLocation =
7634 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7635 &comparisonResult,
7636 &d_tree,
7637 this->comparator(),
7638 lvalue);
7639 if (!comparisonResult) {
7640 return pair<iterator, bool>(iterator(insertLocation), false);
7641 }
7642
7643#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7644 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7645 std::piecewise_construct,
7646 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7647 std::forward_as_tuple(
7648 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7649 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7650 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
7651#else
7652 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7653 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7654 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7655 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7656 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
7657#endif
7658
7659 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7660 insertLocation,
7661 comparisonResult < 0,
7662 node);
7663
7664 return pair<iterator, bool>(iterator(node), true);
7665}
7666#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
7667
7668#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
7669template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7670template <class Args_01,
7671 class Args_02,
7672 class Args_03,
7673 class Args_04>
7674inline
7675pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7676map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7677 BloombergLP::bslmf::MovableRef<key_type> key,
7678 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7679 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7680 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7681 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
7682{
7683 key_type& lvalue = key;
7684
7685 int comparisonResult;
7686 BloombergLP::bslalg::RbTreeNode *insertLocation =
7687 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7688 &comparisonResult,
7689 &d_tree,
7690 this->comparator(),
7691 lvalue);
7692 if (!comparisonResult) {
7693 return pair<iterator, bool>(iterator(insertLocation), false);
7694 }
7695
7696#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7697 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7698 std::piecewise_construct,
7699 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7700 std::forward_as_tuple(
7701 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7702 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7703 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7704 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
7705#else
7706 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7707 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7708 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7709 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7710 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7711 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
7712#endif
7713
7714 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7715 insertLocation,
7716 comparisonResult < 0,
7717 node);
7718
7719 return pair<iterator, bool>(iterator(node), true);
7720}
7721#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
7722
7723#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
7724template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7725template <class Args_01,
7726 class Args_02,
7727 class Args_03,
7728 class Args_04,
7729 class Args_05>
7730inline
7731pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7732map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7733 BloombergLP::bslmf::MovableRef<key_type> key,
7734 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7735 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7736 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7737 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7738 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
7739{
7740 key_type& lvalue = key;
7741
7742 int comparisonResult;
7743 BloombergLP::bslalg::RbTreeNode *insertLocation =
7744 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7745 &comparisonResult,
7746 &d_tree,
7747 this->comparator(),
7748 lvalue);
7749 if (!comparisonResult) {
7750 return pair<iterator, bool>(iterator(insertLocation), false);
7751 }
7752
7753#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7754 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7755 std::piecewise_construct,
7756 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7757 std::forward_as_tuple(
7758 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7759 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7760 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7761 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7762 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
7763#else
7764 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7765 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7766 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7767 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7768 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7769 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7770 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
7771#endif
7772
7773 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7774 insertLocation,
7775 comparisonResult < 0,
7776 node);
7777
7778 return pair<iterator, bool>(iterator(node), true);
7779}
7780#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
7781
7782#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
7783template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7784template <class Args_01,
7785 class Args_02,
7786 class Args_03,
7787 class Args_04,
7788 class Args_05,
7789 class Args_06>
7790inline
7791pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7792map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7793 BloombergLP::bslmf::MovableRef<key_type> key,
7794 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7795 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7796 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7797 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7798 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7799 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
7800{
7801 key_type& lvalue = key;
7802
7803 int comparisonResult;
7804 BloombergLP::bslalg::RbTreeNode *insertLocation =
7805 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7806 &comparisonResult,
7807 &d_tree,
7808 this->comparator(),
7809 lvalue);
7810 if (!comparisonResult) {
7811 return pair<iterator, bool>(iterator(insertLocation), false);
7812 }
7813
7814#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7815 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7816 std::piecewise_construct,
7817 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7818 std::forward_as_tuple(
7819 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7820 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7821 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7822 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7823 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7824 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
7825#else
7826 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7827 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7828 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7829 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7830 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7831 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7832 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7833 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
7834#endif
7835
7836 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7837 insertLocation,
7838 comparisonResult < 0,
7839 node);
7840
7841 return pair<iterator, bool>(iterator(node), true);
7842}
7843#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
7844
7845#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
7846template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7847template <class Args_01,
7848 class Args_02,
7849 class Args_03,
7850 class Args_04,
7851 class Args_05,
7852 class Args_06,
7853 class Args_07>
7854inline
7855pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7856map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7857 BloombergLP::bslmf::MovableRef<key_type> key,
7858 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7859 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7860 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7861 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7862 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7863 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7864 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
7865{
7866 key_type& lvalue = key;
7867
7868 int comparisonResult;
7869 BloombergLP::bslalg::RbTreeNode *insertLocation =
7870 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7871 &comparisonResult,
7872 &d_tree,
7873 this->comparator(),
7874 lvalue);
7875 if (!comparisonResult) {
7876 return pair<iterator, bool>(iterator(insertLocation), false);
7877 }
7878
7879#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7880 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7881 std::piecewise_construct,
7882 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7883 std::forward_as_tuple(
7884 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7885 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7886 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7887 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7888 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7889 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7890 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
7891#else
7892 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7893 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7894 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7895 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7896 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7897 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7898 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7899 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7900 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
7901#endif
7902
7903 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7904 insertLocation,
7905 comparisonResult < 0,
7906 node);
7907
7908 return pair<iterator, bool>(iterator(node), true);
7909}
7910#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
7911
7912#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
7913template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7914template <class Args_01,
7915 class Args_02,
7916 class Args_03,
7917 class Args_04,
7918 class Args_05,
7919 class Args_06,
7920 class Args_07,
7921 class Args_08>
7922inline
7923pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7924map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7925 BloombergLP::bslmf::MovableRef<key_type> key,
7926 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7927 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
7928 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
7929 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
7930 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
7931 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
7932 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
7933 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
7934{
7935 key_type& lvalue = key;
7936
7937 int comparisonResult;
7938 BloombergLP::bslalg::RbTreeNode *insertLocation =
7939 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7940 &comparisonResult,
7941 &d_tree,
7942 this->comparator(),
7943 lvalue);
7944 if (!comparisonResult) {
7945 return pair<iterator, bool>(iterator(insertLocation), false);
7946 }
7947
7948#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7949 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7950 std::piecewise_construct,
7951 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
7952 std::forward_as_tuple(
7953 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7954 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7955 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7956 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7957 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7958 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7959 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7960 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
7961#else
7962 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7963 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
7964 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
7965 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
7966 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
7967 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
7968 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
7969 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
7970 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
7971 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
7972#endif
7973
7974 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7975 insertLocation,
7976 comparisonResult < 0,
7977 node);
7978
7979 return pair<iterator, bool>(iterator(node), true);
7980}
7981#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
7982
7983#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
7984template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
7985template <class Args_01,
7986 class Args_02,
7987 class Args_03,
7988 class Args_04,
7989 class Args_05,
7990 class Args_06,
7991 class Args_07,
7992 class Args_08,
7993 class Args_09>
7994inline
7995pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
7996map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7997 BloombergLP::bslmf::MovableRef<key_type> key,
7998 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
7999 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8000 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8001 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8002 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8003 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8004 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
8005 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
8006 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
8007{
8008 key_type& lvalue = key;
8009
8010 int comparisonResult;
8011 BloombergLP::bslalg::RbTreeNode *insertLocation =
8012 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8013 &comparisonResult,
8014 &d_tree,
8015 this->comparator(),
8016 lvalue);
8017 if (!comparisonResult) {
8018 return pair<iterator, bool>(iterator(insertLocation), false);
8019 }
8020
8021#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8022 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8023 std::piecewise_construct,
8024 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8025 std::forward_as_tuple(
8026 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8027 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8028 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8029 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8030 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8031 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8032 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8033 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8034 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
8035#else
8036 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8037 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8038 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8039 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8040 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8041 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8042 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8043 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8044 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8045 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8046 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
8047#endif
8048
8049 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8050 insertLocation,
8051 comparisonResult < 0,
8052 node);
8053
8054 return pair<iterator, bool>(iterator(node), true);
8055}
8056#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
8057
8058#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
8059template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8060template <class Args_01,
8061 class Args_02,
8062 class Args_03,
8063 class Args_04,
8064 class Args_05,
8065 class Args_06,
8066 class Args_07,
8067 class Args_08,
8068 class Args_09,
8069 class Args_10>
8070inline
8071pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
8072map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8073 BloombergLP::bslmf::MovableRef<key_type> key,
8074 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8075 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8076 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8077 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8078 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8079 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8080 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
8081 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
8082 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
8083 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
8084{
8085 key_type& lvalue = key;
8086
8087 int comparisonResult;
8088 BloombergLP::bslalg::RbTreeNode *insertLocation =
8089 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8090 &comparisonResult,
8091 &d_tree,
8092 this->comparator(),
8093 lvalue);
8094 if (!comparisonResult) {
8095 return pair<iterator, bool>(iterator(insertLocation), false);
8096 }
8097
8098#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8099 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8100 std::piecewise_construct,
8101 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8102 std::forward_as_tuple(
8103 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8104 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8105 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8106 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8107 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8108 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8109 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8110 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8111 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
8112 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
8113#else
8114 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8115 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8116 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8117 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8118 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8119 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8120 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8121 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8122 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8123 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8124 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
8125 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
8126#endif
8127
8128 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8129 insertLocation,
8130 comparisonResult < 0,
8131 node);
8132
8133 return pair<iterator, bool>(iterator(node), true);
8134}
8135#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
8136
8137
8138#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
8139template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8140inline
8141typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8142map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8143 const_iterator hint,
8144 BloombergLP::bslmf::MovableRef<key_type> key)
8145{
8146 key_type& lvalue = key;
8147
8148 BloombergLP::bslalg::RbTreeNode *hintNode =
8149 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8150 int comparisonResult;
8151 BloombergLP::bslalg::RbTreeNode *insertLocation =
8152 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8153 &comparisonResult,
8154 &d_tree,
8155 this->comparator(),
8156 lvalue,
8157 hintNode);
8158 if (!comparisonResult) {
8159 return iterator(insertLocation);
8160 }
8161
8162#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8163 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8164 std::piecewise_construct,
8165 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8166 std::forward_as_tuple());
8167#else
8168 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8169 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8170 mapped_type());
8171#endif
8172
8173 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8174 insertLocation,
8175 comparisonResult < 0,
8176 node);
8177 return iterator(node);
8178}
8179#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
8180
8181#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
8182template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8183template <class Args_01>
8184inline
8185typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8186map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8187 const_iterator hint,
8188 BloombergLP::bslmf::MovableRef<key_type> key,
8189 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01)
8190{
8191 key_type& lvalue = key;
8192
8193 BloombergLP::bslalg::RbTreeNode *hintNode =
8194 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8195 int comparisonResult;
8196 BloombergLP::bslalg::RbTreeNode *insertLocation =
8197 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8198 &comparisonResult,
8199 &d_tree,
8200 this->comparator(),
8201 lvalue,
8202 hintNode);
8203 if (!comparisonResult) {
8204 return iterator(insertLocation);
8205 }
8206
8207#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8208 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8209 std::piecewise_construct,
8210 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8211 std::forward_as_tuple(
8212 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
8213#else
8214 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8215 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8216 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01)));
8217#endif
8218
8219 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8220 insertLocation,
8221 comparisonResult < 0,
8222 node);
8223 return iterator(node);
8224}
8225#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
8226
8227#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
8228template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8229template <class Args_01,
8230 class Args_02>
8231inline
8232typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8233map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8234 const_iterator hint,
8235 BloombergLP::bslmf::MovableRef<key_type> key,
8236 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8237 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02)
8238{
8239 key_type& lvalue = key;
8240
8241 BloombergLP::bslalg::RbTreeNode *hintNode =
8242 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8243 int comparisonResult;
8244 BloombergLP::bslalg::RbTreeNode *insertLocation =
8245 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8246 &comparisonResult,
8247 &d_tree,
8248 this->comparator(),
8249 lvalue,
8250 hintNode);
8251 if (!comparisonResult) {
8252 return iterator(insertLocation);
8253 }
8254
8255#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8256 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8257 std::piecewise_construct,
8258 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8259 std::forward_as_tuple(
8260 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8261 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
8262#else
8263 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8264 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8265 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8266 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02)));
8267#endif
8268
8269 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8270 insertLocation,
8271 comparisonResult < 0,
8272 node);
8273 return iterator(node);
8274}
8275#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
8276
8277#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
8278template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8279template <class Args_01,
8280 class Args_02,
8281 class Args_03>
8282inline
8283typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8284map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8285 const_iterator hint,
8286 BloombergLP::bslmf::MovableRef<key_type> key,
8287 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8288 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8289 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03)
8290{
8291 key_type& lvalue = key;
8292
8293 BloombergLP::bslalg::RbTreeNode *hintNode =
8294 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8295 int comparisonResult;
8296 BloombergLP::bslalg::RbTreeNode *insertLocation =
8297 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8298 &comparisonResult,
8299 &d_tree,
8300 this->comparator(),
8301 lvalue,
8302 hintNode);
8303 if (!comparisonResult) {
8304 return iterator(insertLocation);
8305 }
8306
8307#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8308 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8309 std::piecewise_construct,
8310 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8311 std::forward_as_tuple(
8312 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8313 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8314 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
8315#else
8316 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8317 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8318 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8319 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8320 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03)));
8321#endif
8322
8323 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8324 insertLocation,
8325 comparisonResult < 0,
8326 node);
8327 return iterator(node);
8328}
8329#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
8330
8331#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
8332template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8333template <class Args_01,
8334 class Args_02,
8335 class Args_03,
8336 class Args_04>
8337inline
8338typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8339map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8340 const_iterator hint,
8341 BloombergLP::bslmf::MovableRef<key_type> key,
8342 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8343 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8344 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8345 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04)
8346{
8347 key_type& lvalue = key;
8348
8349 BloombergLP::bslalg::RbTreeNode *hintNode =
8350 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8351 int comparisonResult;
8352 BloombergLP::bslalg::RbTreeNode *insertLocation =
8353 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8354 &comparisonResult,
8355 &d_tree,
8356 this->comparator(),
8357 lvalue,
8358 hintNode);
8359 if (!comparisonResult) {
8360 return iterator(insertLocation);
8361 }
8362
8363#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8364 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8365 std::piecewise_construct,
8366 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8367 std::forward_as_tuple(
8368 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8369 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8370 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8371 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
8372#else
8373 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8374 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8375 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8376 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8377 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8378 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04)));
8379#endif
8380
8381 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8382 insertLocation,
8383 comparisonResult < 0,
8384 node);
8385 return iterator(node);
8386}
8387#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
8388
8389#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
8390template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8391template <class Args_01,
8392 class Args_02,
8393 class Args_03,
8394 class Args_04,
8395 class Args_05>
8396inline
8397typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8398map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8399 const_iterator hint,
8400 BloombergLP::bslmf::MovableRef<key_type> key,
8401 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8402 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8403 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8404 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8405 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05)
8406{
8407 key_type& lvalue = key;
8408
8409 BloombergLP::bslalg::RbTreeNode *hintNode =
8410 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8411 int comparisonResult;
8412 BloombergLP::bslalg::RbTreeNode *insertLocation =
8413 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8414 &comparisonResult,
8415 &d_tree,
8416 this->comparator(),
8417 lvalue,
8418 hintNode);
8419 if (!comparisonResult) {
8420 return iterator(insertLocation);
8421 }
8422
8423#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8424 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8425 std::piecewise_construct,
8426 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8427 std::forward_as_tuple(
8428 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8429 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8430 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8431 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8432 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
8433#else
8434 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8435 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8436 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8437 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8438 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8439 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8440 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05)));
8441#endif
8442
8443 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8444 insertLocation,
8445 comparisonResult < 0,
8446 node);
8447 return iterator(node);
8448}
8449#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
8450
8451#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
8452template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8453template <class Args_01,
8454 class Args_02,
8455 class Args_03,
8456 class Args_04,
8457 class Args_05,
8458 class Args_06>
8459inline
8460typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8461map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8462 const_iterator hint,
8463 BloombergLP::bslmf::MovableRef<key_type> key,
8464 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8465 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8466 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8467 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8468 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8469 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06)
8470{
8471 key_type& lvalue = key;
8472
8473 BloombergLP::bslalg::RbTreeNode *hintNode =
8474 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8475 int comparisonResult;
8476 BloombergLP::bslalg::RbTreeNode *insertLocation =
8477 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8478 &comparisonResult,
8479 &d_tree,
8480 this->comparator(),
8481 lvalue,
8482 hintNode);
8483 if (!comparisonResult) {
8484 return iterator(insertLocation);
8485 }
8486
8487#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8488 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8489 std::piecewise_construct,
8490 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8491 std::forward_as_tuple(
8492 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8493 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8494 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8495 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8496 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8497 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
8498#else
8499 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8500 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8501 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8502 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8503 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8504 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8505 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8506 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06)));
8507#endif
8508
8509 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8510 insertLocation,
8511 comparisonResult < 0,
8512 node);
8513 return iterator(node);
8514}
8515#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
8516
8517#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
8518template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8519template <class Args_01,
8520 class Args_02,
8521 class Args_03,
8522 class Args_04,
8523 class Args_05,
8524 class Args_06,
8525 class Args_07>
8526inline
8527typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8528map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8529 const_iterator hint,
8530 BloombergLP::bslmf::MovableRef<key_type> key,
8531 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8532 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8533 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8534 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8535 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8536 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8537 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07)
8538{
8539 key_type& lvalue = key;
8540
8541 BloombergLP::bslalg::RbTreeNode *hintNode =
8542 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8543 int comparisonResult;
8544 BloombergLP::bslalg::RbTreeNode *insertLocation =
8545 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8546 &comparisonResult,
8547 &d_tree,
8548 this->comparator(),
8549 lvalue,
8550 hintNode);
8551 if (!comparisonResult) {
8552 return iterator(insertLocation);
8553 }
8554
8555#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8556 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8557 std::piecewise_construct,
8558 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8559 std::forward_as_tuple(
8560 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8561 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8562 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8563 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8564 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8565 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8566 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
8567#else
8568 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8569 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8570 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8571 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8572 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8573 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8574 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8575 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8576 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07)));
8577#endif
8578
8579 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8580 insertLocation,
8581 comparisonResult < 0,
8582 node);
8583 return iterator(node);
8584}
8585#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
8586
8587#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
8588template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8589template <class Args_01,
8590 class Args_02,
8591 class Args_03,
8592 class Args_04,
8593 class Args_05,
8594 class Args_06,
8595 class Args_07,
8596 class Args_08>
8597inline
8598typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8599map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8600 const_iterator hint,
8601 BloombergLP::bslmf::MovableRef<key_type> key,
8602 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8603 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8604 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8605 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8606 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8607 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8608 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
8609 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08)
8610{
8611 key_type& lvalue = key;
8612
8613 BloombergLP::bslalg::RbTreeNode *hintNode =
8614 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8615 int comparisonResult;
8616 BloombergLP::bslalg::RbTreeNode *insertLocation =
8617 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8618 &comparisonResult,
8619 &d_tree,
8620 this->comparator(),
8621 lvalue,
8622 hintNode);
8623 if (!comparisonResult) {
8624 return iterator(insertLocation);
8625 }
8626
8627#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8628 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8629 std::piecewise_construct,
8630 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8631 std::forward_as_tuple(
8632 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8633 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8634 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8635 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8636 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8637 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8638 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8639 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
8640#else
8641 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8642 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8643 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8644 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8645 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8646 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8647 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8648 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8649 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8650 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08)));
8651#endif
8652
8653 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8654 insertLocation,
8655 comparisonResult < 0,
8656 node);
8657 return iterator(node);
8658}
8659#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
8660
8661#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
8662template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8663template <class Args_01,
8664 class Args_02,
8665 class Args_03,
8666 class Args_04,
8667 class Args_05,
8668 class Args_06,
8669 class Args_07,
8670 class Args_08,
8671 class Args_09>
8672inline
8673typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8674map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8675 const_iterator hint,
8676 BloombergLP::bslmf::MovableRef<key_type> key,
8677 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8678 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8679 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8680 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8681 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8682 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8683 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
8684 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
8685 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09)
8686{
8687 key_type& lvalue = key;
8688
8689 BloombergLP::bslalg::RbTreeNode *hintNode =
8690 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8691 int comparisonResult;
8692 BloombergLP::bslalg::RbTreeNode *insertLocation =
8693 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8694 &comparisonResult,
8695 &d_tree,
8696 this->comparator(),
8697 lvalue,
8698 hintNode);
8699 if (!comparisonResult) {
8700 return iterator(insertLocation);
8701 }
8702
8703#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8704 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8705 std::piecewise_construct,
8706 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8707 std::forward_as_tuple(
8708 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8709 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8710 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8711 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8712 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8713 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8714 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8715 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8716 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
8717#else
8718 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8719 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8720 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8721 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8722 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8723 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8724 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8725 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8726 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8727 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8728 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09)));
8729#endif
8730
8731 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8732 insertLocation,
8733 comparisonResult < 0,
8734 node);
8735 return iterator(node);
8736}
8737#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
8738
8739#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
8740template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8741template <class Args_01,
8742 class Args_02,
8743 class Args_03,
8744 class Args_04,
8745 class Args_05,
8746 class Args_06,
8747 class Args_07,
8748 class Args_08,
8749 class Args_09,
8750 class Args_10>
8751inline
8752typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8753map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8754 const_iterator hint,
8755 BloombergLP::bslmf::MovableRef<key_type> key,
8756 BSLS_COMPILERFEATURES_FORWARD_REF(Args_01) args_01,
8757 BSLS_COMPILERFEATURES_FORWARD_REF(Args_02) args_02,
8758 BSLS_COMPILERFEATURES_FORWARD_REF(Args_03) args_03,
8759 BSLS_COMPILERFEATURES_FORWARD_REF(Args_04) args_04,
8760 BSLS_COMPILERFEATURES_FORWARD_REF(Args_05) args_05,
8761 BSLS_COMPILERFEATURES_FORWARD_REF(Args_06) args_06,
8762 BSLS_COMPILERFEATURES_FORWARD_REF(Args_07) args_07,
8763 BSLS_COMPILERFEATURES_FORWARD_REF(Args_08) args_08,
8764 BSLS_COMPILERFEATURES_FORWARD_REF(Args_09) args_09,
8765 BSLS_COMPILERFEATURES_FORWARD_REF(Args_10) args_10)
8766{
8767 key_type& lvalue = key;
8768
8769 BloombergLP::bslalg::RbTreeNode *hintNode =
8770 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8771 int comparisonResult;
8772 BloombergLP::bslalg::RbTreeNode *insertLocation =
8773 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8774 &comparisonResult,
8775 &d_tree,
8776 this->comparator(),
8777 lvalue,
8778 hintNode);
8779 if (!comparisonResult) {
8780 return iterator(insertLocation);
8781 }
8782
8783#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8784 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8785 std::piecewise_construct,
8786 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8787 std::forward_as_tuple(
8788 BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8789 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8790 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8791 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8792 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8793 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8794 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8795 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8796 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
8797 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
8798#else
8799 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8800 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8801 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args_01, args_01),
8802 BSLS_COMPILERFEATURES_FORWARD(Args_02, args_02),
8803 BSLS_COMPILERFEATURES_FORWARD(Args_03, args_03),
8804 BSLS_COMPILERFEATURES_FORWARD(Args_04, args_04),
8805 BSLS_COMPILERFEATURES_FORWARD(Args_05, args_05),
8806 BSLS_COMPILERFEATURES_FORWARD(Args_06, args_06),
8807 BSLS_COMPILERFEATURES_FORWARD(Args_07, args_07),
8808 BSLS_COMPILERFEATURES_FORWARD(Args_08, args_08),
8809 BSLS_COMPILERFEATURES_FORWARD(Args_09, args_09),
8810 BSLS_COMPILERFEATURES_FORWARD(Args_10, args_10)));
8811#endif
8812
8813 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8814 insertLocation,
8815 comparisonResult < 0,
8816 node);
8817 return iterator(node);
8818}
8819#endif // BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
8820
8821#else
8822// The generated code below is a workaround for the absence of perfect
8823// forwarding in some compilers.
8824template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8825template <class... Args>
8826inline
8827pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
8828map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const key_type& key,
8830{
8831 int comparisonResult;
8832 BloombergLP::bslalg::RbTreeNode *insertLocation =
8833 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8834 &comparisonResult,
8835 &d_tree,
8836 this->comparator(),
8837 key);
8838 if (!comparisonResult) {
8839 return pair<iterator, bool>(iterator(insertLocation), false);
8840 }
8841
8842#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8843 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8844 std::piecewise_construct,
8845 std::forward_as_tuple(key),
8846 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8847#else
8848 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8849 key,
8850 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8851#endif
8852
8853 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8854 insertLocation,
8855 comparisonResult < 0,
8856 node);
8857 return pair<iterator, bool>(iterator(node), true);
8858}
8859
8860template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8861template <class... Args>
8862inline
8863typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8864map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
8865 const key_type& key,
8867{
8868 BloombergLP::bslalg::RbTreeNode *hintNode =
8869 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8870 int comparisonResult;
8871 BloombergLP::bslalg::RbTreeNode *insertLocation =
8872 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8873 &comparisonResult,
8874 &d_tree,
8875 this->comparator(),
8876 key,
8877 hintNode);
8878 if (!comparisonResult) {
8879 return iterator(insertLocation);
8880 }
8881
8882#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8883 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8884 std::piecewise_construct,
8885 std::forward_as_tuple(key),
8886 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8887#else
8888 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8889 key,
8890 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8891#endif
8892
8893 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8894 insertLocation,
8895 comparisonResult < 0,
8896 node);
8897 return iterator(node);
8898}
8899
8900template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8901template <class... Args>
8902inline
8903pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator, bool>
8904map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8905 BloombergLP::bslmf::MovableRef<key_type> key,
8907{
8908 key_type& lvalue = key;
8909
8910 int comparisonResult;
8911 BloombergLP::bslalg::RbTreeNode *insertLocation =
8912 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8913 &comparisonResult,
8914 &d_tree,
8915 this->comparator(),
8916 lvalue);
8917 if (!comparisonResult) {
8918 return pair<iterator, bool>(iterator(insertLocation), false);
8919 }
8920
8921#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8922 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8923 std::piecewise_construct,
8924 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8925 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8926#else
8927 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8928 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8929 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8930#endif
8931
8932 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8933 insertLocation,
8934 comparisonResult < 0,
8935 node);
8936
8937 return pair<iterator, bool>(iterator(node), true);
8938}
8939
8940template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8941template <class... Args>
8942inline
8943typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8944map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8945 const_iterator hint,
8946 BloombergLP::bslmf::MovableRef<key_type> key,
8948{
8949 key_type& lvalue = key;
8950
8951 BloombergLP::bslalg::RbTreeNode *hintNode =
8952 const_cast<BloombergLP::bslalg::RbTreeNode *>(hint.node());
8953 int comparisonResult;
8954 BloombergLP::bslalg::RbTreeNode *insertLocation =
8955 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8956 &comparisonResult,
8957 &d_tree,
8958 this->comparator(),
8959 lvalue,
8960 hintNode);
8961 if (!comparisonResult) {
8962 return iterator(insertLocation);
8963 }
8964
8965#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8966 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8967 std::piecewise_construct,
8968 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(key_type, key)),
8969 std::forward_as_tuple(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8970#else
8971 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8972 BSLS_COMPILERFEATURES_FORWARD(key_type, key),
8973 mapped_type(BSLS_COMPILERFEATURES_FORWARD(Args, args)...));
8974#endif
8975
8976 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8977 insertLocation,
8978 comparisonResult < 0,
8979 node);
8980 return iterator(node);
8981}
8982// }}} END GENERATED CODE
8983#endif
8984
8985template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
8986inline
8987void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::clear() BSLS_KEYWORD_NOEXCEPT
8988{
8989 BSLS_ASSERT_SAFE(d_tree.firstNode());
8990
8991 if (d_tree.rootNode()) {
8992 BSLS_ASSERT_SAFE( 0 < d_tree.numNodes());
8993 BSLS_ASSERT_SAFE(d_tree.firstNode() != d_tree.sentinel());
8994
8995 BloombergLP::bslalg::RbTreeUtil::deleteTree(&d_tree, &nodeFactory());
8996 }
8997#if defined(BSLS_ASSERT_SAFE_IS_USED)
8998 else {
8999 BSLS_ASSERT_SAFE( 0 == d_tree.numNodes());
9000 BSLS_ASSERT_SAFE(d_tree.firstNode() == d_tree.sentinel());
9001 }
9002#endif
9003}
9004
9005// ACCESSORS
9006template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9007inline
9008typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::allocator_type
9009map<KEY, VALUE, COMPARATOR, ALLOCATOR>::get_allocator() const
9011{
9012 return nodeFactory().allocator();
9013}
9014
9015template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9016inline
9017typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9018map<KEY, VALUE, COMPARATOR, ALLOCATOR>::begin() const BSLS_KEYWORD_NOEXCEPT
9019{
9020 return cbegin();
9021}
9022
9023template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9024inline
9025typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9026map<KEY, VALUE, COMPARATOR, ALLOCATOR>::end() const BSLS_KEYWORD_NOEXCEPT
9027{
9028 return cend();
9029}
9030
9031template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9032inline
9033typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9034map<KEY, VALUE, COMPARATOR, ALLOCATOR>::rbegin() const BSLS_KEYWORD_NOEXCEPT
9035{
9036 return crbegin();
9037}
9038
9039template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9040inline
9041typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9042map<KEY, VALUE, COMPARATOR, ALLOCATOR>::rend() const BSLS_KEYWORD_NOEXCEPT
9043{
9044 return crend();
9045}
9046
9047template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9048inline
9049typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9050map<KEY, VALUE, COMPARATOR, ALLOCATOR>::cbegin() const BSLS_KEYWORD_NOEXCEPT
9051{
9052 return const_iterator(d_tree.firstNode());
9053}
9054
9055template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9056inline
9057typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9058map<KEY, VALUE, COMPARATOR, ALLOCATOR>::cend() const BSLS_KEYWORD_NOEXCEPT
9059{
9060 return const_iterator(d_tree.sentinel());
9061}
9062
9063template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9064inline
9065typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9066map<KEY, VALUE, COMPARATOR, ALLOCATOR>::crbegin() const BSLS_KEYWORD_NOEXCEPT
9067{
9068 return const_reverse_iterator(end());
9069}
9070
9071template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9072inline
9073typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9074map<KEY, VALUE, COMPARATOR, ALLOCATOR>::crend() const BSLS_KEYWORD_NOEXCEPT
9075{
9076 return const_reverse_iterator(begin());
9077}
9078
9079template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9080inline
9081bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::contains(
9082 const key_type& key) const
9083{
9084 return find(key) != end();
9085}
9086
9087// capacity:
9088template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9089inline
9090bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::empty() const
9092{
9093 return 0 == d_tree.numNodes();
9094}
9095
9096template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9097inline
9098typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
9099map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size() const BSLS_KEYWORD_NOEXCEPT
9100{
9101 return d_tree.numNodes();
9102}
9103
9104template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9105inline
9106typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
9107map<KEY, VALUE, COMPARATOR, ALLOCATOR>::max_size() const BSLS_KEYWORD_NOEXCEPT
9108{
9109 return AllocatorTraits::max_size(get_allocator());
9110}
9111
9112template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9113typename add_lvalue_reference<const VALUE>::type
9114map<KEY, VALUE, COMPARATOR, ALLOCATOR>::at(
9115 const key_type& key) const
9116{
9117 const BloombergLP::bslalg::RbTreeNode *node =
9118 BloombergLP::bslalg::RbTreeUtil::find(d_tree,
9119 this->comparator(),
9120 key);
9121 if (d_tree.sentinel() == node) {
9122 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
9123 "map<...>::at(key_type): invalid key value");
9124 }
9125 return toNode(node)->value().second;
9126}
9127
9128template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9129inline
9130typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_compare
9131map<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_comp() const
9132{
9133 return comparator().keyComparator();
9134}
9135
9136template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9137inline
9138typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare
9139map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_comp() const
9140{
9141 return value_compare(key_comp());
9142}
9143
9144} // close namespace bsl
9145
9146// FREE OPERATORS
9147template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9148inline
9151{
9152 return BloombergLP::bslalg::RangeCompare::equal(lhs.begin(),
9153 lhs.end(),
9154 lhs.size(),
9155 rhs.begin(),
9156 rhs.end(),
9157 rhs.size());
9158}
9159
9160#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
9161template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9162inline
9165{
9166 return !(lhs == rhs);
9167}
9168#endif
9169
9170#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
9171
9172template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9173inline
9174BloombergLP::bslalg::SynthThreeWayUtil::Result<bsl::pair<const KEY, VALUE>>
9175bsl::operator<=>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
9176 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs)
9177{
9178 return bsl::lexicographical_compare_three_way(
9179 lhs.begin(),
9180 lhs.end(),
9181 rhs.begin(),
9182 rhs.end(),
9183 BloombergLP::bslalg::SynthThreeWayUtil::compare);
9184}
9185
9186#else
9187
9188template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9189inline
9192{
9193 return 0 > BloombergLP::bslalg::RangeCompare::lexicographical(lhs.begin(),
9194 lhs.end(),
9195 lhs.size(),
9196 rhs.begin(),
9197 rhs.end(),
9198 rhs.size());
9199}
9200
9201template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9202inline
9205{
9206 return rhs < lhs;
9207}
9208
9209template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9210inline
9213{
9214 return !(rhs < lhs);
9215}
9216
9217template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9218inline
9221{
9222 return !(lhs < rhs);
9223}
9224
9225#endif // BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
9226
9227// FREE FUNCTIONS
9228template <class KEY,
9229 class VALUE,
9230 class COMPARATOR,
9231 class ALLOCATOR,
9232 class PREDICATE>
9233inline
9235bsl::erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate)
9236{
9237 return BloombergLP::bslstl::AlgorithmUtil::containerEraseIf(m, predicate);
9238}
9239
9240template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9241inline
9245{
9246 a.swap(b);
9247}
9248
9249// ============================================================================
9250// TYPE TRAITS
9251// ============================================================================
9252
9253// Type traits for STL *ordered* containers:
9254//: o An ordered container defines STL iterators.
9255//: o An ordered container uses 'bslma' allocators if the (template parameter)
9256//: type 'ALLOCATOR' is convertible from 'bslma::Allocator *'.
9257
9258
9259
9260namespace bslalg {
9261
9262template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9263struct HasStlIterators<bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR> >
9265{
9266};
9267
9268} // close namespace bslalg
9269
9270namespace bslma {
9271
9272template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
9273struct UsesBslmaAllocator<bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR> >
9274 : bsl::is_convertible<Allocator *, ALLOCATOR>
9275{
9276};
9277
9278} // close namespace bslma
9279
9280
9281
9282#else // if ! defined(DEFINED_BSLSTL_MAP_H)
9283# error Not valid except when included from bslstl_map.h
9284#endif // ! defined(COMPILING_BSLSTL_MAP_H)
9285
9286#endif // ! defined(INCLUDED_BSLSTL_MAP_CPP03)
9287
9288// ----------------------------------------------------------------------------
9289// Copyright 2019 Bloomberg Finance L.P.
9290//
9291// Licensed under the Apache License, Version 2.0 (the "License");
9292// you may not use this file except in compliance with the License.
9293// You may obtain a copy of the License at
9294//
9295// http://www.apache.org/licenses/LICENSE-2.0
9296//
9297// Unless required by applicable law or agreed to in writing, software
9298// distributed under the License is distributed on an "AS IS" BASIS,
9299// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9300// See the License for the specific language governing permissions and
9301// limitations under the License.
9302// ----------------------------- END-OF-FILE ----------------------------------
9303
9304/** @} */
9305/** @} */
9306/** @} */
Definition bslma_bslallocator.h:580
value_compare(COMPARATOR comparator)
Definition bslstl_map.h:2328
value_type second_argument_type
Definition bslstl_map.h:768
COMPARATOR comp
Definition bslstl_map.h:743
bool operator()(const value_type &x, const value_type &y) const
Definition bslstl_map.h:2337
value_type first_argument_type
Definition bslstl_map.h:763
value_compare & operator=(const value_compare &rhs)=default
friend class map
Definition bslstl_map.h:739
bool result_type
Definition bslstl_map.h:758
Definition bslstl_map.h:619
value_type & reference
Definition bslstl_map.h:713
iterator erase(const_iterator position)
Definition bslstl_map.h:3166
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3428
const_reverse_iterator crend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3493
map &operator=(BloombergLP::bslmf::MovableRef< map > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits add_lvalue_reference< VALUE >::type operator[](const key_type &key)
Definition bslstl_map.h:2680
bool contains(const key_type &key) const
Definition bslstl_map.h:3500
BloombergLP::bslstl::TreeIterator< const value_type, Node, difference_type > const_iterator
Definition bslstl_map.h:724
reverse_iterator rend() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:2775
pair< iterator, iterator > equal_range(const key_type &key)
Definition bslstl_map.h:1651
iterator upper_bound(const key_type &key)
Definition bslstl_map.h:1612
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:2759
map()
Definition bslstl_map.h:2438
~map()
Destroy this object.
Definition bslstl_map.h:2611
const_reverse_iterator crbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3485
reverse_iterator rbegin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:2767
iterator lower_bound(const key_type &key)
Definition bslstl_map.h:1575
size_type count(const key_type &key) const
Definition bslstl_map.h:1839
const value_type & const_reference
Definition bslstl_map.h:714
KEY key_type
Definition bslstl_map.h:708
AllocatorTraits::const_pointer const_pointer
Definition bslstl_map.h:719
add_lvalue_reference< VALUE >::type at(const key_type &key)
Definition bslstl_map.h:2737
pair< iterator, bool > emplace(Args &&... args)
bsl::reverse_iterator< iterator > reverse_iterator
Definition bslstl_map.h:725
iterator find(const key_type &key)
Definition bslstl_map.h:1542
void swap(map &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits pair< iterator, bool > try_emplace(const KEY &key, Args &&... args)
Definition bslstl_map.h:1416
ALLOCATOR allocator_type
Definition bslstl_map.h:712
map & operator=(const map &rhs)
Definition bslstl_map.h:2620
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3509
pair< iterator, bool > insert_or_assign(const KEY &key, BDE_OTHER_TYPE &&obj)
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this map.
Definition bslstl_map.h:3518
pair< iterator, bool > insert(const value_type &value)
Definition bslstl_map.h:2783
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:2751
VALUE mapped_type
Definition bslstl_map.h:709
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3406
value_compare value_comp() const
Definition bslstl_map.h:3558
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3469
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3526
bsl::reverse_iterator< const_iterator > const_reverse_iterator
Definition bslstl_map.h:726
AllocatorTraits::size_type size_type
Definition bslstl_map.h:716
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_map.h:3134
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3477
BloombergLP::bslstl::TreeIterator< value_type, Node, difference_type > iterator
Definition bslstl_map.h:722
pair< const KEY, VALUE > value_type
Definition bslstl_map.h:710
AllocatorTraits::pointer pointer
Definition bslstl_map.h:718
AllocatorTraits::difference_type difference_type
Definition bslstl_map.h:717
key_compare key_comp() const
Definition bslstl_map.h:3550
COMPARATOR key_compare
Definition bslstl_map.h:711
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
#define BSLS_PERFORMANCEHINT_PREDICT_LIKELY(expr)
Definition bsls_performancehint.h:451
#define BSLS_PERFORMANCEHINT_UNLIKELY_HINT
Definition bsls_performancehint.h:484
#define BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY(expr)
Definition bsls_performancehint.h:452
void swap(OptionValue &a, OptionValue &b)
Definition bdlb_printmethods.h:283
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
T::const_iterator cend(const T &container)
Definition bslstl_iterator.h:1611
bool operator<(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
T::const_reverse_iterator crbegin(const T &container)
Definition bslstl_iterator.h:1597
bool operator>(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
bool operator>=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
bool operator<=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4126
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
bool operator==(const memory_resource &a, const memory_resource &b)
T::const_iterator cbegin(const T &container)
Definition bslstl_iterator.h:1553
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
deque< VALUE_TYPE, ALLOCATOR >::size_type erase_if(deque< VALUE_TYPE, ALLOCATOR > &deq, PREDICATE predicate)
Definition bslstl_deque.h:4135
bool operator!=(const memory_resource &a, const memory_resource &b)
T::const_reverse_iterator crend(const T &container)
Definition bslstl_iterator.h:1654
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:129
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR >::type const_pointer
Definition bslma_allocatortraits.h:1152
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR >::type size_type
Definition bslma_allocatortraits.h:1165
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR >::type pointer
Definition bslma_allocatortraits.h:1149
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR >::type difference_type
Definition bslma_allocatortraits.h:1162
Definition bslmf_enableif.h:525
Definition bslmf_isconvertible.h:867
t_TYPE type
Definition bslmf_typeidentity.h:216