11#ifndef INCLUDED_BSLSTL_MAP_CPP03
12#define INCLUDED_BSLSTL_MAP_CPP03
63#ifdef COMPILING_BSLSTL_MAP_H
87 class COMPARATOR = std::less<KEY>,
88 class ALLOCATOR = allocator<pair<const KEY, VALUE> > >
95 typedef pair<const KEY, VALUE> ValueType;
99 typedef BloombergLP::bslstl::MapComparator<KEY, VALUE, COMPARATOR>
104 typedef BloombergLP::bslstl::TreeNode<ValueType> Node;
108 typedef BloombergLP::bslstl::TreeNodePool<ValueType, ALLOCATOR>
117 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
128 class DataWrapper :
public Comparator {
135 DataWrapper(
const DataWrapper&);
136 DataWrapper& operator=(
const DataWrapper&);
144 DataWrapper(
const COMPARATOR& comparator,
145 const ALLOCATOR& basicAllocator);
153 BloombergLP::bslmf::MovableRef<DataWrapper> original);
159 NodeFactory& nodeFactory();
165 const NodeFactory& nodeFactory()
const;
169 DataWrapper d_compAndAlloc;
173 BloombergLP::bslalg::RbTreeAnchor d_tree;
191 typedef BloombergLP::bslstl::TreeIterator<
193 typedef BloombergLP::bslstl::TreeIterator<
207 class value_compare {
270 static Node *toNode(BloombergLP::bslalg::RbTreeNode *node);
276 static const Node *toNode(
const BloombergLP::bslalg::RbTreeNode *node);
282 NodeFactory& nodeFactory();
286 Comparator& comparator();
293 void quickSwapExchangeAllocators(
map& other);
302 void quickSwapRetainAllocators(
map& other);
308 template <
class INPUT_ITERATOR,
class SENTINEL>
309 void constructFromRange(INPUT_ITERATOR first, SENTINEL last);
311#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
312 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
322 template <
class INPUT_ITERATOR,
class SENTINEL>
323 void constructFromRange(INPUT_ITERATOR first,
329 template <
class INPUT_ITERATOR,
class SENTINEL>
330 void insertFromRange(INPUT_ITERATOR first,
333#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
334 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
342 template <
class INPUT_ITERATOR,
class SENTINEL>
343 void insertFromRange(INPUT_ITERATOR first,
352 const NodeFactory& nodeFactory()
const;
356 const Comparator& comparator()
const;
373 explicit map(
const COMPARATOR& comparator,
374 const ALLOCATOR& basicAllocator = ALLOCATOR())
375 : d_compAndAlloc(comparator, basicAllocator)
392 explicit map(
const ALLOCATOR& basicAllocator);
412 map(BloombergLP::bslmf::MovableRef<map> original);
424 const typename type_identity<ALLOCATOR>::type& basicAllocator);
439 map(BloombergLP::bslmf::MovableRef<map> original,
440 const typename type_identity<ALLOCATOR>::type& basicAllocator);
472 template <
class INPUT_ITERATOR>
473 map(INPUT_ITERATOR first,
475 const COMPARATOR& comparator = COMPARATOR(),
476 const ALLOCATOR& basicAllocator = ALLOCATOR());
477 template <
class INPUT_ITERATOR>
478 map(INPUT_ITERATOR first,
480 const ALLOCATOR& basicAllocator);
501 template <
class RANGE>
505 const COMPARATOR& comparator = COMPARATOR(),
506 const ALLOCATOR& basicAllocator = ALLOCATOR())
507 : d_compAndAlloc(comparator, basicAllocator)
512#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
513 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
514 if constexpr (ranges::sized_range<RANGE>) {
515 constructFromRange(bsl::ranges::begin(range),
516 bsl::ranges::end (range),
517 bsl::ranges::size (range));
521 constructFromRange(bsl::ranges::begin(range),
522 bsl::ranges::end (range));
526 template <
class RANGE>
530 const ALLOCATOR& basicAllocator)
531 : d_compAndAlloc(COMPARATOR(), basicAllocator)
539 nodeFactory().allocator());
540 quickSwapRetainAllocators(other);
543#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
563 map(std::initializer_list<value_type> values,
564 const COMPARATOR& comparator = COMPARATOR(),
565 const ALLOCATOR& basicAllocator = ALLOCATOR());
566 map(std::initializer_list<value_type> values,
567 const ALLOCATOR& basicAllocator);
588 AllocatorTraits::is_always_equal::value &&
589 std::is_nothrow_move_assignable<COMPARATOR>::value);
605#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
614 map&
operator=(std::initializer_list<value_type> values);
638 BloombergLP::bslmf::MovableRef<key_type> key);
643 template <
class LOOKUP_KEY>
645 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
671 template <
class LOOKUP_KEY>
673 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
676 at(
const LOOKUP_KEY& key) {
681 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
682 "map<...>::at(LOOKUP_KEY): invalid key value");
734#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
735 template <
class ALT_VALUE_TYPE>
737#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
738 template <
class ALT_VALUE_TYPE>
739 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
740 pair<iterator, bool> >::type
755 template <
class ALT_VALUE_TYPE>
756 typename enable_if<std::is_constructible<
value_type,
757 ALT_VALUE_TYPE&&>::value,
758 pair<iterator, bool> >::type
802 BloombergLP::bslmf::MovableRef<value_type> value);
804#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
805 template <
class ALT_VALUE_TYPE>
807#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
808 template <
class ALT_VALUE_TYPE>
809 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
830 template <
class ALT_VALUE_TYPE>
831 typename enable_if<std::is_constructible<
value_type,
832 ALT_VALUE_TYPE&&>::value,
861 template <
class INPUT_ITERATOR>
862 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
874 template <
class RANGE>
880#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
881 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
882 if constexpr (ranges::sized_range<RANGE>) {
883 insertFromRange(bsl::ranges::begin(range),
884 bsl::ranges::end (range),
885 bsl::ranges::size (range));
889 insertFromRange(bsl::ranges::begin(range),
890 bsl::ranges::end (range));
894#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
909#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
916 void insert(std::initializer_list<value_type> values);
922 template <
class BDE_OTHER_TYPE>
926 template <
class BDE_OTHER_TYPE>
928 BloombergLP::bslmf::MovableRef<KEY> key,
931 template<
class LOOKUP_KEY,
class BDE_OTHER_TYPE>
933 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
935 pair<iterator, bool> >::type
940 typedef pair<iterator, bool> Result;
942 int comparisonResult;
943 BloombergLP::bslalg::RbTreeNode *insertLocation =
944 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
950 if (!comparisonResult) {
953 return Result(
iterator(insertLocation),
false);
956 BloombergLP::bslalg::RbTreeNode *node =
957 nodeFactory().emplaceIntoNewNode(
961 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
963 comparisonResult < 0,
966 return Result(
iterator(node),
true);
969 template <
class BDE_OTHER_TYPE>
974 template <
class BDE_OTHER_TYPE>
976 BloombergLP::bslmf::MovableRef<KEY> key,
979 template<
class LOOKUP_KEY,
class BDE_OTHER_TYPE>
981 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
989 BloombergLP::bslalg::RbTreeNode *hintNode =
990 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
992 int comparisonResult;
993 BloombergLP::bslalg::RbTreeNode *insertLocation =
994 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1001 if (!comparisonResult) {
1007 BloombergLP::bslalg::RbTreeNode *node =
1008 nodeFactory().emplaceIntoNewNode(
1012 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1014 comparisonResult < 0,
1021#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1024#ifndef BSLSTL_MAP_VARIADIC_LIMIT
1025#define BSLSTL_MAP_VARIADIC_LIMIT 10
1027#ifndef BSLSTL_MAP_VARIADIC_LIMIT_C
1028#define BSLSTL_MAP_VARIADIC_LIMIT_C BSLSTL_MAP_VARIADIC_LIMIT
1030#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1035#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1036 template <
class Args_01>
1041#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1042 template <
class Args_01,
1049#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1050 template <
class Args_01,
1059#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1060 template <
class Args_01,
1071#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1072 template <
class Args_01,
1085#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1086 template <
class Args_01,
1101#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1102 template <
class Args_01,
1119#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1120 template <
class Args_01,
1139#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1140 template <
class Args_01,
1161#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1162 template <
class Args_01,
1186#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 0
1190#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 1
1191 template <
class Args_01>
1196#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 2
1197 template <
class Args_01,
1204#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 3
1205 template <
class Args_01,
1214#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 4
1215 template <
class Args_01,
1226#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 5
1227 template <
class Args_01,
1240#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 6
1241 template <
class Args_01,
1256#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 7
1257 template <
class Args_01,
1274#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 8
1275 template <
class Args_01,
1294#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 9
1295 template <
class Args_01,
1316#if BSLSTL_MAP_VARIADIC_LIMIT_C >= 10
1317 template <
class Args_01,
1343 template <
class... Args>
1347 template <
class... Args>
1372 template <
class t_KEY>
1374 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1403 AllocatorTraits::is_always_equal::value &&
1404 bsl::is_nothrow_swappable<COMPARATOR>::value);
1423#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1426#ifndef BSLSTL_MAP_VARIADIC_LIMIT
1427#define BSLSTL_MAP_VARIADIC_LIMIT 10
1429#ifndef BSLSTL_MAP_VARIADIC_LIMIT_D
1430#define BSLSTL_MAP_VARIADIC_LIMIT_D BSLSTL_MAP_VARIADIC_LIMIT
1432#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
1436#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
1437 template <
class Args_01>
1442#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
1443 template <
class Args_01,
1450#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
1451 template <
class Args_01,
1460#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
1461 template <
class Args_01,
1472#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
1473 template <
class Args_01,
1486#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
1487 template <
class Args_01,
1502#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
1503 template <
class Args_01,
1520#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
1521 template <
class Args_01,
1540#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
1541 template <
class Args_01,
1562#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
1563 template <
class Args_01,
1586#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
1587 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key);
1590#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
1591 template <
class Args_01>
1592 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1596#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
1597 template <
class Args_01,
1599 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1604#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
1605 template <
class Args_01,
1608 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1614#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
1615 template <
class Args_01,
1619 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1626#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
1627 template <
class Args_01,
1632 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1640#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
1641 template <
class Args_01,
1647 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1656#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
1657 template <
class Args_01,
1664 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1674#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
1675 template <
class Args_01,
1683 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1694#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
1695 template <
class Args_01,
1704 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1716#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
1717 template <
class Args_01,
1727 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
1740#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
1741 template<
class LOOKUP_KEY>
1743 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1744 LOOKUP_KEY>::value &&
1749 pair<iterator, bool> >::type
1753 const LOOKUP_KEY& lvalue = key;
1755 int comparisonResult;
1756 BloombergLP::bslalg::RbTreeNode *insertLocation =
1757 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1762 if (!comparisonResult) {
1763 return pair<iterator, bool>(
1767 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1768 BloombergLP::bslalg::RbTreeNode *node =
1769 nodeFactory().emplaceIntoNewNode(
1770 std::piecewise_construct,
1771 std::forward_as_tuple(
1774 std::forward_as_tuple());
1776 BloombergLP::bslalg::RbTreeNode *node =
1777 nodeFactory().emplaceIntoNewNode(
1782 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1784 comparisonResult < 0,
1787 return pair<iterator, bool>(
iterator(node),
true);
1791#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
1792 template<
class LOOKUP_KEY,
class Args_01>
1794 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1795 LOOKUP_KEY>::value &&
1800 pair<iterator, bool> >::type
1805 const LOOKUP_KEY& lvalue = key;
1807 int comparisonResult;
1808 BloombergLP::bslalg::RbTreeNode *insertLocation =
1809 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1814 if (!comparisonResult) {
1815 return pair<iterator, bool>(
1819 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1820 BloombergLP::bslalg::RbTreeNode *node =
1821 nodeFactory().emplaceIntoNewNode(
1822 std::piecewise_construct,
1823 std::forward_as_tuple(
1826 std::forward_as_tuple(
1830 BloombergLP::bslalg::RbTreeNode *node =
1831 nodeFactory().emplaceIntoNewNode(
1837 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1839 comparisonResult < 0,
1842 return pair<iterator, bool>(
iterator(node),
true);
1846#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
1847 template<
class LOOKUP_KEY,
class Args_01,
1850 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1851 LOOKUP_KEY>::value &&
1856 pair<iterator, bool> >::type
1862 const LOOKUP_KEY& lvalue = key;
1864 int comparisonResult;
1865 BloombergLP::bslalg::RbTreeNode *insertLocation =
1866 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1871 if (!comparisonResult) {
1872 return pair<iterator, bool>(
1876 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1877 BloombergLP::bslalg::RbTreeNode *node =
1878 nodeFactory().emplaceIntoNewNode(
1879 std::piecewise_construct,
1880 std::forward_as_tuple(
1883 std::forward_as_tuple(
1889 BloombergLP::bslalg::RbTreeNode *node =
1890 nodeFactory().emplaceIntoNewNode(
1897 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1899 comparisonResult < 0,
1902 return pair<iterator, bool>(
iterator(node),
true);
1906#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
1907 template<
class LOOKUP_KEY,
class Args_01,
1911 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1912 LOOKUP_KEY>::value &&
1917 pair<iterator, bool> >::type
1924 const LOOKUP_KEY& lvalue = key;
1926 int comparisonResult;
1927 BloombergLP::bslalg::RbTreeNode *insertLocation =
1928 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1933 if (!comparisonResult) {
1934 return pair<iterator, bool>(
1938 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1939 BloombergLP::bslalg::RbTreeNode *node =
1940 nodeFactory().emplaceIntoNewNode(
1941 std::piecewise_construct,
1942 std::forward_as_tuple(
1945 std::forward_as_tuple(
1953 BloombergLP::bslalg::RbTreeNode *node =
1954 nodeFactory().emplaceIntoNewNode(
1962 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1964 comparisonResult < 0,
1967 return pair<iterator, bool>(
iterator(node),
true);
1971#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
1972 template<
class LOOKUP_KEY,
class Args_01,
1977 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1978 LOOKUP_KEY>::value &&
1983 pair<iterator, bool> >::type
1991 const LOOKUP_KEY& lvalue = key;
1993 int comparisonResult;
1994 BloombergLP::bslalg::RbTreeNode *insertLocation =
1995 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2000 if (!comparisonResult) {
2001 return pair<iterator, bool>(
2005 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2006 BloombergLP::bslalg::RbTreeNode *node =
2007 nodeFactory().emplaceIntoNewNode(
2008 std::piecewise_construct,
2009 std::forward_as_tuple(
2012 std::forward_as_tuple(
2022 BloombergLP::bslalg::RbTreeNode *node =
2023 nodeFactory().emplaceIntoNewNode(
2032 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2034 comparisonResult < 0,
2037 return pair<iterator, bool>(
iterator(node),
true);
2041#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
2042 template<
class LOOKUP_KEY,
class Args_01,
2048 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2049 LOOKUP_KEY>::value &&
2054 pair<iterator, bool> >::type
2063 const LOOKUP_KEY& lvalue = key;
2065 int comparisonResult;
2066 BloombergLP::bslalg::RbTreeNode *insertLocation =
2067 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2072 if (!comparisonResult) {
2073 return pair<iterator, bool>(
2077 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2078 BloombergLP::bslalg::RbTreeNode *node =
2079 nodeFactory().emplaceIntoNewNode(
2080 std::piecewise_construct,
2081 std::forward_as_tuple(
2084 std::forward_as_tuple(
2096 BloombergLP::bslalg::RbTreeNode *node =
2097 nodeFactory().emplaceIntoNewNode(
2107 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2109 comparisonResult < 0,
2112 return pair<iterator, bool>(
iterator(node),
true);
2116#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
2117 template<
class LOOKUP_KEY,
class Args_01,
2124 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2125 LOOKUP_KEY>::value &&
2130 pair<iterator, bool> >::type
2140 const LOOKUP_KEY& lvalue = key;
2142 int comparisonResult;
2143 BloombergLP::bslalg::RbTreeNode *insertLocation =
2144 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2149 if (!comparisonResult) {
2150 return pair<iterator, bool>(
2154 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2155 BloombergLP::bslalg::RbTreeNode *node =
2156 nodeFactory().emplaceIntoNewNode(
2157 std::piecewise_construct,
2158 std::forward_as_tuple(
2161 std::forward_as_tuple(
2175 BloombergLP::bslalg::RbTreeNode *node =
2176 nodeFactory().emplaceIntoNewNode(
2187 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2189 comparisonResult < 0,
2192 return pair<iterator, bool>(
iterator(node),
true);
2196#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
2197 template<
class LOOKUP_KEY,
class Args_01,
2205 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2206 LOOKUP_KEY>::value &&
2211 pair<iterator, bool> >::type
2222 const LOOKUP_KEY& lvalue = key;
2224 int comparisonResult;
2225 BloombergLP::bslalg::RbTreeNode *insertLocation =
2226 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2231 if (!comparisonResult) {
2232 return pair<iterator, bool>(
2236 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2237 BloombergLP::bslalg::RbTreeNode *node =
2238 nodeFactory().emplaceIntoNewNode(
2239 std::piecewise_construct,
2240 std::forward_as_tuple(
2243 std::forward_as_tuple(
2259 BloombergLP::bslalg::RbTreeNode *node =
2260 nodeFactory().emplaceIntoNewNode(
2272 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2274 comparisonResult < 0,
2277 return pair<iterator, bool>(
iterator(node),
true);
2281#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
2282 template<
class LOOKUP_KEY,
class Args_01,
2291 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2292 LOOKUP_KEY>::value &&
2297 pair<iterator, bool> >::type
2309 const LOOKUP_KEY& lvalue = key;
2311 int comparisonResult;
2312 BloombergLP::bslalg::RbTreeNode *insertLocation =
2313 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2318 if (!comparisonResult) {
2319 return pair<iterator, bool>(
2323 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2324 BloombergLP::bslalg::RbTreeNode *node =
2325 nodeFactory().emplaceIntoNewNode(
2326 std::piecewise_construct,
2327 std::forward_as_tuple(
2330 std::forward_as_tuple(
2348 BloombergLP::bslalg::RbTreeNode *node =
2349 nodeFactory().emplaceIntoNewNode(
2362 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2364 comparisonResult < 0,
2367 return pair<iterator, bool>(
iterator(node),
true);
2371#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
2372 template<
class LOOKUP_KEY,
class Args_01,
2382 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2383 LOOKUP_KEY>::value &&
2388 pair<iterator, bool> >::type
2401 const LOOKUP_KEY& lvalue = key;
2403 int comparisonResult;
2404 BloombergLP::bslalg::RbTreeNode *insertLocation =
2405 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2410 if (!comparisonResult) {
2411 return pair<iterator, bool>(
2415 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2416 BloombergLP::bslalg::RbTreeNode *node =
2417 nodeFactory().emplaceIntoNewNode(
2418 std::piecewise_construct,
2419 std::forward_as_tuple(
2422 std::forward_as_tuple(
2442 BloombergLP::bslalg::RbTreeNode *node =
2443 nodeFactory().emplaceIntoNewNode(
2457 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2459 comparisonResult < 0,
2462 return pair<iterator, bool>(
iterator(node),
true);
2466#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
2467 template<
class LOOKUP_KEY,
class Args_01,
2478 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2479 LOOKUP_KEY>::value &&
2484 pair<iterator, bool> >::type
2498 const LOOKUP_KEY& lvalue = key;
2500 int comparisonResult;
2501 BloombergLP::bslalg::RbTreeNode *insertLocation =
2502 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2507 if (!comparisonResult) {
2508 return pair<iterator, bool>(
2512 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2513 BloombergLP::bslalg::RbTreeNode *node =
2514 nodeFactory().emplaceIntoNewNode(
2515 std::piecewise_construct,
2516 std::forward_as_tuple(
2519 std::forward_as_tuple(
2541 BloombergLP::bslalg::RbTreeNode *node =
2542 nodeFactory().emplaceIntoNewNode(
2557 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2559 comparisonResult < 0,
2562 return pair<iterator, bool>(
iterator(node),
true);
2567#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
2571#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
2572 template<
class Args_01>
2577#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
2578 template<
class Args_01,
2585#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
2586 template<
class Args_01,
2595#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
2596 template<
class Args_01,
2607#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
2608 template<
class Args_01,
2621#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
2622 template<
class Args_01,
2637#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
2638 template<
class Args_01,
2655#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
2656 template<
class Args_01,
2675#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
2676 template<
class Args_01,
2697#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
2698 template<
class Args_01,
2721#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
2723 BloombergLP::bslmf::MovableRef<KEY> key);
2726#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
2727 template <
class Args_01>
2729 BloombergLP::bslmf::MovableRef<KEY> key,
2733#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
2734 template <
class Args_01,
2737 BloombergLP::bslmf::MovableRef<KEY> key,
2742#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
2743 template <
class Args_01,
2747 BloombergLP::bslmf::MovableRef<KEY> key,
2753#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
2754 template <
class Args_01,
2759 BloombergLP::bslmf::MovableRef<KEY> key,
2766#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
2767 template <
class Args_01,
2773 BloombergLP::bslmf::MovableRef<KEY> key,
2781#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
2782 template <
class Args_01,
2789 BloombergLP::bslmf::MovableRef<KEY> key,
2798#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
2799 template <
class Args_01,
2807 BloombergLP::bslmf::MovableRef<KEY> key,
2817#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
2818 template <
class Args_01,
2827 BloombergLP::bslmf::MovableRef<KEY> key,
2838#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
2839 template <
class Args_01,
2849 BloombergLP::bslmf::MovableRef<KEY> key,
2861#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
2862 template <
class Args_01,
2873 BloombergLP::bslmf::MovableRef<KEY> key,
2886#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 0
2887 template<
class LOOKUP_KEY>
2889 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2896 const LOOKUP_KEY& lvalue = key;
2898 BloombergLP::bslalg::RbTreeNode *hintNode =
2899 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2901 int comparisonResult;
2902 BloombergLP::bslalg::RbTreeNode *insertLocation =
2903 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2910 if (!comparisonResult) {
2914 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2915 BloombergLP::bslalg::RbTreeNode *node =
2916 nodeFactory().emplaceIntoNewNode(
2917 std::piecewise_construct,
2918 std::forward_as_tuple(
2921 std::forward_as_tuple());
2923 BloombergLP::bslalg::RbTreeNode *node =
2924 nodeFactory().emplaceIntoNewNode(
2929 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2931 comparisonResult < 0,
2938#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 1
2939 template<
class LOOKUP_KEY,
class Args_01>
2941 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2949 const LOOKUP_KEY& lvalue = key;
2951 BloombergLP::bslalg::RbTreeNode *hintNode =
2952 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2954 int comparisonResult;
2955 BloombergLP::bslalg::RbTreeNode *insertLocation =
2956 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
2963 if (!comparisonResult) {
2967 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
2968 BloombergLP::bslalg::RbTreeNode *node =
2969 nodeFactory().emplaceIntoNewNode(
2970 std::piecewise_construct,
2971 std::forward_as_tuple(
2974 std::forward_as_tuple(
2978 BloombergLP::bslalg::RbTreeNode *node =
2979 nodeFactory().emplaceIntoNewNode(
2985 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2987 comparisonResult < 0,
2994#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 2
2995 template<
class LOOKUP_KEY,
class Args_01,
2998 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3007 const LOOKUP_KEY& lvalue = key;
3009 BloombergLP::bslalg::RbTreeNode *hintNode =
3010 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3012 int comparisonResult;
3013 BloombergLP::bslalg::RbTreeNode *insertLocation =
3014 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3021 if (!comparisonResult) {
3025 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3026 BloombergLP::bslalg::RbTreeNode *node =
3027 nodeFactory().emplaceIntoNewNode(
3028 std::piecewise_construct,
3029 std::forward_as_tuple(
3032 std::forward_as_tuple(
3038 BloombergLP::bslalg::RbTreeNode *node =
3039 nodeFactory().emplaceIntoNewNode(
3046 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3048 comparisonResult < 0,
3055#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 3
3056 template<
class LOOKUP_KEY,
class Args_01,
3060 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3070 const LOOKUP_KEY& lvalue = key;
3072 BloombergLP::bslalg::RbTreeNode *hintNode =
3073 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3075 int comparisonResult;
3076 BloombergLP::bslalg::RbTreeNode *insertLocation =
3077 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3084 if (!comparisonResult) {
3088 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3089 BloombergLP::bslalg::RbTreeNode *node =
3090 nodeFactory().emplaceIntoNewNode(
3091 std::piecewise_construct,
3092 std::forward_as_tuple(
3095 std::forward_as_tuple(
3103 BloombergLP::bslalg::RbTreeNode *node =
3104 nodeFactory().emplaceIntoNewNode(
3112 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3114 comparisonResult < 0,
3121#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 4
3122 template<
class LOOKUP_KEY,
class Args_01,
3127 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3138 const LOOKUP_KEY& lvalue = key;
3140 BloombergLP::bslalg::RbTreeNode *hintNode =
3141 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3143 int comparisonResult;
3144 BloombergLP::bslalg::RbTreeNode *insertLocation =
3145 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3152 if (!comparisonResult) {
3156 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3157 BloombergLP::bslalg::RbTreeNode *node =
3158 nodeFactory().emplaceIntoNewNode(
3159 std::piecewise_construct,
3160 std::forward_as_tuple(
3163 std::forward_as_tuple(
3173 BloombergLP::bslalg::RbTreeNode *node =
3174 nodeFactory().emplaceIntoNewNode(
3183 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3185 comparisonResult < 0,
3192#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 5
3193 template<
class LOOKUP_KEY,
class Args_01,
3199 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3211 const LOOKUP_KEY& lvalue = key;
3213 BloombergLP::bslalg::RbTreeNode *hintNode =
3214 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3216 int comparisonResult;
3217 BloombergLP::bslalg::RbTreeNode *insertLocation =
3218 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3225 if (!comparisonResult) {
3229 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3230 BloombergLP::bslalg::RbTreeNode *node =
3231 nodeFactory().emplaceIntoNewNode(
3232 std::piecewise_construct,
3233 std::forward_as_tuple(
3236 std::forward_as_tuple(
3248 BloombergLP::bslalg::RbTreeNode *node =
3249 nodeFactory().emplaceIntoNewNode(
3259 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3261 comparisonResult < 0,
3268#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 6
3269 template<
class LOOKUP_KEY,
class Args_01,
3276 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3289 const LOOKUP_KEY& lvalue = key;
3291 BloombergLP::bslalg::RbTreeNode *hintNode =
3292 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3294 int comparisonResult;
3295 BloombergLP::bslalg::RbTreeNode *insertLocation =
3296 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3303 if (!comparisonResult) {
3307 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3308 BloombergLP::bslalg::RbTreeNode *node =
3309 nodeFactory().emplaceIntoNewNode(
3310 std::piecewise_construct,
3311 std::forward_as_tuple(
3314 std::forward_as_tuple(
3328 BloombergLP::bslalg::RbTreeNode *node =
3329 nodeFactory().emplaceIntoNewNode(
3340 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3342 comparisonResult < 0,
3349#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 7
3350 template<
class LOOKUP_KEY,
class Args_01,
3358 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3372 const LOOKUP_KEY& lvalue = key;
3374 BloombergLP::bslalg::RbTreeNode *hintNode =
3375 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3377 int comparisonResult;
3378 BloombergLP::bslalg::RbTreeNode *insertLocation =
3379 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3386 if (!comparisonResult) {
3390 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3391 BloombergLP::bslalg::RbTreeNode *node =
3392 nodeFactory().emplaceIntoNewNode(
3393 std::piecewise_construct,
3394 std::forward_as_tuple(
3397 std::forward_as_tuple(
3413 BloombergLP::bslalg::RbTreeNode *node =
3414 nodeFactory().emplaceIntoNewNode(
3426 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3428 comparisonResult < 0,
3435#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 8
3436 template<
class LOOKUP_KEY,
class Args_01,
3445 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3460 const LOOKUP_KEY& lvalue = key;
3462 BloombergLP::bslalg::RbTreeNode *hintNode =
3463 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3465 int comparisonResult;
3466 BloombergLP::bslalg::RbTreeNode *insertLocation =
3467 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3474 if (!comparisonResult) {
3478 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3479 BloombergLP::bslalg::RbTreeNode *node =
3480 nodeFactory().emplaceIntoNewNode(
3481 std::piecewise_construct,
3482 std::forward_as_tuple(
3485 std::forward_as_tuple(
3503 BloombergLP::bslalg::RbTreeNode *node =
3504 nodeFactory().emplaceIntoNewNode(
3517 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3519 comparisonResult < 0,
3526#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 9
3527 template<
class LOOKUP_KEY,
class Args_01,
3537 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3553 const LOOKUP_KEY& lvalue = key;
3555 BloombergLP::bslalg::RbTreeNode *hintNode =
3556 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3558 int comparisonResult;
3559 BloombergLP::bslalg::RbTreeNode *insertLocation =
3560 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3567 if (!comparisonResult) {
3571 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3572 BloombergLP::bslalg::RbTreeNode *node =
3573 nodeFactory().emplaceIntoNewNode(
3574 std::piecewise_construct,
3575 std::forward_as_tuple(
3578 std::forward_as_tuple(
3598 BloombergLP::bslalg::RbTreeNode *node =
3599 nodeFactory().emplaceIntoNewNode(
3613 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3615 comparisonResult < 0,
3622#if BSLSTL_MAP_VARIADIC_LIMIT_D >= 10
3623 template<
class LOOKUP_KEY,
class Args_01,
3634 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3651 const LOOKUP_KEY& lvalue = key;
3653 BloombergLP::bslalg::RbTreeNode *hintNode =
3654 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3656 int comparisonResult;
3657 BloombergLP::bslalg::RbTreeNode *insertLocation =
3658 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3665 if (!comparisonResult) {
3669 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3670 BloombergLP::bslalg::RbTreeNode *node =
3671 nodeFactory().emplaceIntoNewNode(
3672 std::piecewise_construct,
3673 std::forward_as_tuple(
3676 std::forward_as_tuple(
3698 BloombergLP::bslalg::RbTreeNode *node =
3699 nodeFactory().emplaceIntoNewNode(
3714 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3716 comparisonResult < 0,
3726 template <
class... Args>
3729 template <
class... Args>
3730 pair<iterator, bool>
try_emplace(BloombergLP::bslmf::MovableRef<KEY> key,
3732 template<
class LOOKUP_KEY,
class... Args>
3734 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3735 LOOKUP_KEY>::value &&
3740 pair<iterator, bool> >::type
3745 const LOOKUP_KEY& lvalue = key;
3747 int comparisonResult;
3748 BloombergLP::bslalg::RbTreeNode *insertLocation =
3749 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3754 if (!comparisonResult) {
3755 return pair<iterator, bool>(
3759 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3760 BloombergLP::bslalg::RbTreeNode *node =
3761 nodeFactory().emplaceIntoNewNode(
3762 std::piecewise_construct,
3763 std::forward_as_tuple(
3769 BloombergLP::bslalg::RbTreeNode *node =
3770 nodeFactory().emplaceIntoNewNode(
3775 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3777 comparisonResult < 0,
3780 return pair<iterator, bool>(
iterator(node),
true);
3783 template<
class... Args>
3786 template <
class... Args>
3788 BloombergLP::bslmf::MovableRef<KEY> key,
3790 template<
class LOOKUP_KEY,
class... Args>
3792 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3800 const LOOKUP_KEY& lvalue = key;
3802 BloombergLP::bslalg::RbTreeNode *hintNode =
3803 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3805 int comparisonResult;
3806 BloombergLP::bslalg::RbTreeNode *insertLocation =
3807 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3814 if (!comparisonResult) {
3818 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3819 BloombergLP::bslalg::RbTreeNode *node =
3820 nodeFactory().emplaceIntoNewNode(
3821 std::piecewise_construct,
3822 std::forward_as_tuple(
3828 BloombergLP::bslalg::RbTreeNode *node =
3829 nodeFactory().emplaceIntoNewNode(
3834 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3836 comparisonResult < 0,
3861 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
3862 d_tree, this->comparator(), key));
3869 template <
class LOOKUP_KEY>
3871 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3874 find(
const LOOKUP_KEY& key)
3878 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
3879 d_tree, this->comparator(), key));
3895 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
3896 d_tree, this->comparator(), key));
3908 template <
class LOOKUP_KEY>
3910 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3917 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
3918 d_tree, this->comparator(), key));
3934 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3935 d_tree, this->comparator(), key));
3947 template <
class LOOKUP_KEY>
3949 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
3956 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
3957 d_tree, this->comparator(), key));
3977 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
3980 return pair<iterator, iterator>(startIt, endIt);
3997 template <
class LOOKUP_KEY>
3999 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4001 pair<iterator, iterator> >::type
4008 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
4016 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
4020 return pair<iterator, iterator>(startIt, endIt);
4077 template <class LOOKUP_KEY>
4078 typename
bsl::enable_if<
4079 BloombergLP::
bslmf::IsTransparentPredicate<COMPARATOR,
4082 contains(const LOOKUP_KEY& key)
const
4110 typename add_lvalue_reference<const VALUE>::type
at(const
key_type& key)
4120 template <class LOOKUP_KEY>
4121 typename
bsl::enable_if<
4122 BloombergLP::
bslmf::IsTransparentPredicate<COMPARATOR,
4124 typename add_lvalue_reference<const VALUE>::type>::type
4125 at(const LOOKUP_KEY& key)
const {
4129 if (iter ==
end()) {
4130 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
4131 "map<...>::at(LOOKUP_KEY) const: invalid key value");
4133 return iter->second;
4164 d_tree, this->comparator(), key));
4171 template <
class LOOKUP_KEY>
4173 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4176 find(
const LOOKUP_KEY& key)
const
4181 d_tree, this->comparator(), key));
4192 return (
find(key) !=
end()) ? 1 : 0;
4202 template <
class LOOKUP_KEY>
4204 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4207 count(
const LOOKUP_KEY& key)
const
4214 while (it !=
end() && !comparator()(key, *it.node())) {
4234 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
4235 d_tree, this->comparator(), key));
4247 template <
class LOOKUP_KEY>
4249 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4257 BloombergLP::bslalg::RbTreeUtil::lowerBound(d_tree,
4275 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
4276 d_tree, this->comparator(), key));
4288 template <
class LOOKUP_KEY>
4290 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4297 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
4298 d_tree, this->comparator(), key));
4318 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
4321 return pair<const_iterator, const_iterator>(startIt, endIt);
4338 template <
class LOOKUP_KEY>
4340 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
4342 pair<const_iterator, const_iterator> >::type
4349 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
4357 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
4361 return pair<const_iterator, const_iterator>(startIt, endIt);
4367#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
4377 class INPUT_ITERATOR,
4378 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4380 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4381 class COMPARATOR = std::less<KEY>,
4383 BloombergLP::bslstl::IteratorUtil::IterToAlloc_t<INPUT_ITERATOR>>,
4384 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
4385 class = bsl::enable_if_t<
bsl::IsStdAllocator_v<ALLOCATOR>>
4389 COMPARATOR = COMPARATOR(),
4390 ALLOCATOR = ALLOCATOR())
4391-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
4400 class INPUT_ITERATOR,
4403 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4405 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4406 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
4407 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4409map(INPUT_ITERATOR, INPUT_ITERATOR, COMPARATOR, ALLOC *)
4410-> map<KEY, VALUE, COMPARATOR>;
4417 class INPUT_ITERATOR,
4419 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4421 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4422 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4424map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR)
4425-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
4432 class INPUT_ITERATOR,
4434 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
4436 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
4437 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
4438 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4440map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
4452 class COMPARATOR = std::less<KEY>,
4453 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4454 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
4455 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4457map(std::initializer_list<pair<const KEY, VALUE>>,
4458 COMPARATOR = COMPARATOR(),
4459 ALLOCATOR = ALLOCATOR())
4460-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
4473 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4474 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4476map(std::initializer_list<pair<const KEY, VALUE>>, COMPARATOR, ALLOC *)
4477-> map<KEY, VALUE, COMPARATOR>;
4488 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
4490map(std::initializer_list<pair<const KEY, VALUE>>, ALLOCATOR)
4491-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
4501 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
4502 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
4504map(std::initializer_list<pair<const KEY, VALUE>>, ALLOC *)
4518template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4519bool operator==(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4520 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4522#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
4523template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4524bool operator!=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4525 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4536#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
4542template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4543BloombergLP::bslalg::SynthThreeWayUtil::Result<pair<const KEY, VALUE>>
4544operator<=>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4545 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4549template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4550bool operator<(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4551 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4564template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4565bool operator>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4566 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4575template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4576bool operator<=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4577 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4586template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4587bool operator>=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4588 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
4608typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
4609erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate);
4629template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4630void
swap(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& a,
4631 map<KEY, VALUE, COMPARATOR, ALLOCATOR>& b)
4643template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
4645map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
4646 const COMPARATOR& comparator,
4647 const ALLOCATOR& basicAllocator)
4648:
::bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(comparator)
4649, d_pool(basicAllocator)
4653template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4655map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
4656 BloombergLP::bslmf::MovableRef<DataWrapper> original)
4657: ::
bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(
4658 MoveUtil::access(original).keyComparator())
4659, d_pool(MoveUtil::move(MoveUtil::access(original).d_pool))
4663template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4665typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4666map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
4672template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4674const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4675map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
const
4685template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4687map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::value_compare(
4688 COMPARATOR comparator)
4694template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4696bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::operator()(
4697 const value_type& x,
4698 const value_type& y)
const
4700 return comp(x.first, y.first);
4708template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4710typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
4711map<KEY, VALUE, COMPARATOR, ALLOCATOR>::toNode(
4712 BloombergLP::bslalg::RbTreeNode *node)
4714 return static_cast<Node *
>(node);
4717template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4719const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
4720map<KEY, VALUE, COMPARATOR, ALLOCATOR>::toNode(
4721 const BloombergLP::bslalg::RbTreeNode *node)
4723 return static_cast<const Node *
>(node);
4727template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4729typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4730map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
4732 return d_compAndAlloc.nodeFactory();
4735template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4737typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
4738map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
4740 return d_compAndAlloc;
4743template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4745void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapExchangeAllocators(
4748 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
4749 nodeFactory().swapExchangeAllocators(other.nodeFactory());
4757 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
4758 comparator().swap(other.comparator());
4762template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4764void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapRetainAllocators(
4767 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
4768 nodeFactory().swapRetainAllocators(other.nodeFactory());
4772 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
4773 comparator().swap(other.comparator());
4777template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4778template <
class INPUT_ITERATOR,
class SENTINEL>
4781map<KEY, VALUE, COMPARATOR, ALLOCATOR>::constructFromRange(
4782 INPUT_ITERATOR first,
4785 if (first == last) {
4790 BloombergLP::bslstl::IteratorUtil::
4791 canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()) {
4792 const size_type numElements =
static_cast<size_type
>(
4793 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
4794 nodeFactory().reserveNodes(numElements);
4797 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
4808 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
4810 while (++first != last) {
4812 const value_type& value = *first;
4813 if (this->comparator()(value.first, *prevNode)) {
4816 insertFromRange(++first, last);
4820 if (this->comparator()(*prevNode, value.first)) {
4821 BloombergLP::bslalg::RbTreeNode *node =
4822 nodeFactory().emplaceIntoNewNode(value);
4823 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4834#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
4835 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
4837template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4838template <
class INPUT_ITERATOR,
class SENTINEL>
4841map<KEY, VALUE, COMPARATOR, ALLOCATOR>::constructFromRange(
4842 INPUT_ITERATOR first,
4848 !BloombergLP::bslstl::IteratorUtil
4849 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
4850 || numElements ==
static_cast<size_type
>(
4851 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
4853 if (first == last) {
4857 if (0 < numElements) {
4858 nodeFactory().reserveNodes(numElements);
4861 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
4871 insert(*first); --numElements;
4872 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
4874 while (++first != last) {
4876 const value_type& value = *first;
4877 if (this->comparator()(value.first, *prevNode)) {
4879 insert(value); --numElements;
4880 insertFromRange(++first, last, numElements);
4884 if (this->comparator()(*prevNode, value.first)) {
4885 BloombergLP::bslalg::RbTreeNode *node =
4886 nodeFactory().emplaceIntoNewNode(value);
4887 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
4901template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4902template <
class INPUT_ITERATOR,
class SENTINEL>
4904void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insertFromRange(
4905 INPUT_ITERATOR first,
4924 while (first != last) {
4926 if (BloombergLP::bslstl::IteratorUtil
4927 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
4929 !nodeFactory().hasFreeNodes())) {
4930 const size_type numElements =
static_cast<size_type
>(
4931 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
4933 nodeFactory().reserveNodes(numElements);
4941#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
4942 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
4944template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4945template <
class INPUT_ITERATOR,
class SENTINEL>
4947void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insertFromRange(
4948 INPUT_ITERATOR first,
4953 !BloombergLP::bslstl::IteratorUtil
4954 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
4955 || numElements ==
static_cast<size_type
>(
4956 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
4958 while (first != last) {
4961 !nodeFactory().hasFreeNodes())) {
4962 nodeFactory().reserveNodes(numElements);
4974template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4976const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
4977map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
const
4979 return d_compAndAlloc.nodeFactory();
4982template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4984const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
4985map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
const
4987 return d_compAndAlloc;
4991template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4993map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map()
4994: d_compAndAlloc(COMPARATOR(), ALLOCATOR())
4999template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5001map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
const ALLOCATOR& basicAllocator)
5002: d_compAndAlloc(COMPARATOR(), basicAllocator)
5007template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5009map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
const map& original)
5010: d_compAndAlloc(original.comparator().keyComparator(),
5011 AllocatorTraits::select_on_container_copy_construction(
5012 original.nodeFactory().allocator()))
5015 if (0 < original.size()) {
5016 nodeFactory().reserveNodes(original.size());
5017 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
5023template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5025map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
5026 BloombergLP::bslmf::MovableRef<map> original)
5027: d_compAndAlloc(MoveUtil::move(MoveUtil::access(original).d_compAndAlloc))
5030 map& lvalue = original;
5031 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
5034template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5036map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
const map& original,
5037 const typename type_identity<ALLOCATOR>::type& basicAllocator)
5038: d_compAndAlloc(original.comparator().keyComparator(), basicAllocator)
5041 if (0 < original.size()) {
5042 nodeFactory().reserveNodes(original.size());
5043 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
5049template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5051map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
5052 BloombergLP::bslmf::MovableRef<map> original,
5053 const typename type_identity<ALLOCATOR>::type& basicAllocator)
5054: d_compAndAlloc(MoveUtil::access(original).comparator().keyComparator(),
5058 map& lvalue = original;
5061 nodeFactory().allocator() == lvalue.nodeFactory().allocator())) {
5062 d_compAndAlloc.nodeFactory().adopt(
5063 MoveUtil::move(lvalue.d_compAndAlloc.nodeFactory()));
5064 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
5066 else if (0 < lvalue.size()) {
5067 nodeFactory().reserveNodes(lvalue.size());
5068 BloombergLP::bslalg::RbTreeUtil::moveTree(&d_tree,
5071 &lvalue.nodeFactory());
5075template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5076template <
class INPUT_ITERATOR>
5078map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(INPUT_ITERATOR first,
5079 INPUT_ITERATOR last,
5080 const COMPARATOR& comparator,
5081 const ALLOCATOR& basicAllocator)
5082: d_compAndAlloc(comparator, basicAllocator)
5085 constructFromRange(first, last);
5088template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5089template <
class INPUT_ITERATOR>
5091map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(INPUT_ITERATOR first,
5092 INPUT_ITERATOR last,
5093 const ALLOCATOR& basicAllocator)
5094: d_compAndAlloc(COMPARATOR(), basicAllocator)
5097 map other(first, last, COMPARATOR(), nodeFactory().allocator());
5098 quickSwapRetainAllocators(other);
5101#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5102template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5104map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
5105 std::initializer_list<value_type> values,
5106 const COMPARATOR& comparator,
5107 const ALLOCATOR& basicAllocator)
5108: map(values.
begin(), values.
end(), comparator, basicAllocator)
5112template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5114map<KEY, VALUE, COMPARATOR, ALLOCATOR>::map(
5115 std::initializer_list<value_type> values,
5116 const ALLOCATOR& basicAllocator)
5117: map(values.
begin(), values.
end(), COMPARATOR(), basicAllocator)
5122template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5124map<KEY, VALUE, COMPARATOR, ALLOCATOR>::~map()
5130template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5132map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
5133map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
const map& rhs)
5136 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
5137 map other(rhs,
rhs.nodeFactory().allocator());
5138 quickSwapExchangeAllocators(other);
5141 map other(rhs, nodeFactory().allocator());
5142 quickSwapRetainAllocators(other);
5148template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5150map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
5151map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
5152 BloombergLP::bslmf::MovableRef<map> rhs)
5154 AllocatorTraits::is_always_equal::value &&
5155 std::is_nothrow_move_assignable<COMPARATOR>::value)
5160 if (nodeFactory().allocator() == lvalue.nodeFactory().allocator()) {
5161 map other(MoveUtil::move(lvalue));
5162 quickSwapRetainAllocators(other);
5165 AllocatorTraits::propagate_on_container_move_assignment::value) {
5166 map other(MoveUtil::move(lvalue));
5167 quickSwapExchangeAllocators(other);
5170 map other(MoveUtil::move(lvalue), nodeFactory().allocator());
5171 quickSwapRetainAllocators(other);
5177#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5178template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5180map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
5181map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
5182 std::initializer_list<value_type> values)
5185 insert(values.begin(), values.end());
5190template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5192typename add_lvalue_reference<VALUE>::type
5193map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator[](
const key_type& key)
5195 iterator iter = lower_bound(key);
5196 if (iter ==
end() || this->comparator()(key, *iter.node())) {
5197#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
5198 iter = emplace_hint(iter,
5199 std::piecewise_construct,
5200 std::forward_as_tuple(key),
5201 std::forward_as_tuple());
5203 BloombergLP::bsls::ObjectBuffer<VALUE> temp;
5205 ALLOCATOR alloc = nodeFactory().allocator();
5207 AllocatorTraits::construct(alloc, temp.address());
5209 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
5215 iter = emplace_hint(iter, key, temp.object());
5218 return iter->second;
5221template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5223typename add_lvalue_reference<VALUE>::type
5224map<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator[](
5225 BloombergLP::bslmf::MovableRef<key_type> key)
5227 key_type& lvalue = key;
5229 iterator iter = lower_bound(lvalue);
5230 if (iter ==
end() || this->comparator()(lvalue, *iter.node())) {
5231#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
5232 iter = emplace_hint(
5234 std::piecewise_construct,
5236 std::forward_as_tuple());
5238 BloombergLP::bsls::ObjectBuffer<VALUE> temp;
5240 ALLOCATOR alloc = nodeFactory().allocator();
5242 AllocatorTraits::construct(alloc, temp.address());
5244 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
5250 iter = emplace_hint(iter, lvalue, temp.object());
5253 return iter->second;
5256template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5257typename add_lvalue_reference<VALUE>::type
5258map<KEY, VALUE, COMPARATOR, ALLOCATOR>::at(
const key_type& key)
5260 BloombergLP::bslalg::RbTreeNode *node =
5261 BloombergLP::bslalg::RbTreeUtil::find(d_tree, this->comparator(), key);
5262 if (d_tree.sentinel() == node) {
5263 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
5264 "map<...>::at(key_type): invalid key value");
5266 return toNode(node)->value().second;
5269template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5271typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5274 return iterator(d_tree.firstNode());
5277template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5279typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5282 return iterator(d_tree.sentinel());
5285template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5287typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
5290 return reverse_iterator(
end());
5293template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5295typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
5298 return reverse_iterator(
begin());
5301template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5303pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5304map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
const value_type& value)
5306 int comparisonResult;
5307 BloombergLP::bslalg::RbTreeNode *insertLocation =
5308 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5313 if (!comparisonResult) {
5314 return pair<iterator, bool>(iterator(insertLocation),
false);
5317 BloombergLP::bslalg::RbTreeNode *node =
5318 nodeFactory().emplaceIntoNewNode(value);
5319 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5321 comparisonResult < 0,
5323 return pair<iterator, bool>(iterator(node),
true);
5326template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5328pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5329map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
5330 BloombergLP::bslmf::MovableRef<value_type> value)
5332 value_type& lvalue = value;
5334 int comparisonResult;
5335 BloombergLP::bslalg::RbTreeNode *insertLocation =
5336 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5341 if (!comparisonResult) {
5342 return pair<iterator, bool>(iterator(insertLocation),
false);
5345 BloombergLP::bslalg::RbTreeNode *node =
5346 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
5347 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5349 comparisonResult < 0,
5351 return pair<iterator, bool>(iterator(node),
true);
5354template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5355template <
class INPUT_ITERATOR>
5357void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(INPUT_ITERATOR first,
5358 INPUT_ITERATOR last)
5360 insertFromRange(first, last);
5363#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
5364template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5366void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator first,
5367 const_iterator last)
5369 while (first != last) {
5376template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5378typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5379map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator hint,
5380 const value_type& value)
5382 BloombergLP::bslalg::RbTreeNode *hintNode =
5383 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
5384 int comparisonResult;
5385 BloombergLP::bslalg::RbTreeNode *insertLocation =
5386 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5392 if (!comparisonResult) {
5393 return iterator(insertLocation);
5396 BloombergLP::bslalg::RbTreeNode *node =
5397 nodeFactory().emplaceIntoNewNode(value);
5398 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5400 comparisonResult < 0,
5402 return iterator(node);
5405template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5407typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5408map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
5409 const_iterator hint,
5410 BloombergLP::bslmf::MovableRef<value_type> value)
5412 value_type& lvalue = value;
5414 BloombergLP::bslalg::RbTreeNode *hintNode =
5415 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
5416 int comparisonResult;
5417 BloombergLP::bslalg::RbTreeNode *insertLocation =
5418 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5424 if (!comparisonResult) {
5425 return iterator(insertLocation);
5428 BloombergLP::bslalg::RbTreeNode *node =
5429 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
5431 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5433 comparisonResult < 0,
5435 return iterator(node);
5438#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5439template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5441void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
5442 std::initializer_list<value_type> values)
5444 insert(values.begin(), values.end());
5451template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5452template <
class BDE_OTHER_TYPE>
5454pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5455map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(
const key_type& key,
5458 int comparisonResult;
5459 BloombergLP::bslalg::RbTreeNode *insertLocation =
5460 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5466 if (!comparisonResult) {
5467 iterator(insertLocation)->second =
5469 return pair<iterator, bool>(iterator(insertLocation),
false);
5472 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5475 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5477 comparisonResult < 0,
5480 return pair<iterator, bool>(iterator(node),
true);
5483template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5484template <
class BDE_OTHER_TYPE>
5486typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5487map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(const_iterator hint,
5488 const key_type& key,
5491 BloombergLP::bslalg::RbTreeNode *hintNode =
5492 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
5493 int comparisonResult;
5494 BloombergLP::bslalg::RbTreeNode *insertLocation =
5495 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5502 if (!comparisonResult) {
5503 iterator(insertLocation)->second =
5505 return iterator(insertLocation);
5508 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5511 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5513 comparisonResult < 0,
5516 return iterator(node);
5519template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5520template <
class BDE_OTHER_TYPE>
5522pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5523map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(
5524 BloombergLP::bslmf::MovableRef<key_type> key,
5527 int comparisonResult;
5528 BloombergLP::bslalg::RbTreeNode *insertLocation =
5529 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5535 if (!comparisonResult) {
5536 iterator(insertLocation)->second =
5538 return pair<iterator, bool>(iterator(insertLocation),
false);
5541 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5545 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5547 comparisonResult < 0,
5550 return pair<iterator, bool>(iterator(node),
true);
5553template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5554template <
class BDE_OTHER_TYPE>
5556typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
5557map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert_or_assign(
5558 const_iterator hint,
5559 BloombergLP::bslmf::MovableRef<key_type> key,
5562 BloombergLP::bslalg::RbTreeNode *hintNode =
5563 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
5564 int comparisonResult;
5565 BloombergLP::bslalg::RbTreeNode *insertLocation =
5566 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5573 if (!comparisonResult) {
5574 iterator(insertLocation)->second =
5576 return iterator(insertLocation);
5579 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5583 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5585 comparisonResult < 0,
5588 return iterator(node);
5592#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
5595#ifndef BSLSTL_MAP_VARIADIC_LIMIT
5596#define BSLSTL_MAP_VARIADIC_LIMIT 10
5598#ifndef BSLSTL_MAP_VARIADIC_LIMIT_F
5599#define BSLSTL_MAP_VARIADIC_LIMIT_F BSLSTL_MAP_VARIADIC_LIMIT
5602#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
5603template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5605pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5606map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5609 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5611 int comparisonResult;
5612 BloombergLP::bslalg::RbTreeNode *insertLocation =
5613 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5617 static_cast<const Node *
>(node)->value().first);
5618 if (!comparisonResult) {
5619 nodeFactory().deleteNode(node);
5620 return pair<iterator, bool>(iterator(insertLocation),
false);
5623 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5625 comparisonResult < 0,
5627 return pair<iterator, bool>(iterator(node),
true);
5631#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
5632template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5633template <
class Args_01>
5635pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5636map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5639 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5641 int comparisonResult;
5642 BloombergLP::bslalg::RbTreeNode *insertLocation =
5643 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5647 static_cast<const Node *
>(node)->value().first);
5648 if (!comparisonResult) {
5649 nodeFactory().deleteNode(node);
5650 return pair<iterator, bool>(iterator(insertLocation),
false);
5653 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5655 comparisonResult < 0,
5657 return pair<iterator, bool>(iterator(node),
true);
5661#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
5662template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5663template <
class Args_01,
5666pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5667map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5671 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5674 int comparisonResult;
5675 BloombergLP::bslalg::RbTreeNode *insertLocation =
5676 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5680 static_cast<const Node *
>(node)->value().first);
5681 if (!comparisonResult) {
5682 nodeFactory().deleteNode(node);
5683 return pair<iterator, bool>(iterator(insertLocation),
false);
5686 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5688 comparisonResult < 0,
5690 return pair<iterator, bool>(iterator(node),
true);
5694#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
5695template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5696template <
class Args_01,
5700pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5701map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5706 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5710 int comparisonResult;
5711 BloombergLP::bslalg::RbTreeNode *insertLocation =
5712 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5716 static_cast<const Node *
>(node)->value().first);
5717 if (!comparisonResult) {
5718 nodeFactory().deleteNode(node);
5719 return pair<iterator, bool>(iterator(insertLocation),
false);
5722 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5724 comparisonResult < 0,
5726 return pair<iterator, bool>(iterator(node),
true);
5730#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
5731template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5732template <
class Args_01,
5737pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5738map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5744 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5749 int comparisonResult;
5750 BloombergLP::bslalg::RbTreeNode *insertLocation =
5751 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5755 static_cast<const Node *
>(node)->value().first);
5756 if (!comparisonResult) {
5757 nodeFactory().deleteNode(node);
5758 return pair<iterator, bool>(iterator(insertLocation),
false);
5761 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5763 comparisonResult < 0,
5765 return pair<iterator, bool>(iterator(node),
true);
5769#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
5770template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5771template <
class Args_01,
5777pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5778map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5785 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5791 int comparisonResult;
5792 BloombergLP::bslalg::RbTreeNode *insertLocation =
5793 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5797 static_cast<const Node *
>(node)->value().first);
5798 if (!comparisonResult) {
5799 nodeFactory().deleteNode(node);
5800 return pair<iterator, bool>(iterator(insertLocation),
false);
5803 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5805 comparisonResult < 0,
5807 return pair<iterator, bool>(iterator(node),
true);
5811#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
5812template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5813template <
class Args_01,
5820pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5821map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5829 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5836 int comparisonResult;
5837 BloombergLP::bslalg::RbTreeNode *insertLocation =
5838 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5842 static_cast<const Node *
>(node)->value().first);
5843 if (!comparisonResult) {
5844 nodeFactory().deleteNode(node);
5845 return pair<iterator, bool>(iterator(insertLocation),
false);
5848 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5850 comparisonResult < 0,
5852 return pair<iterator, bool>(iterator(node),
true);
5856#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
5857template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5858template <
class Args_01,
5866pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5867map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5876 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5884 int comparisonResult;
5885 BloombergLP::bslalg::RbTreeNode *insertLocation =
5886 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5890 static_cast<const Node *
>(node)->value().first);
5891 if (!comparisonResult) {
5892 nodeFactory().deleteNode(node);
5893 return pair<iterator, bool>(iterator(insertLocation),
false);
5896 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5898 comparisonResult < 0,
5900 return pair<iterator, bool>(iterator(node),
true);
5904#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
5905template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5906template <
class Args_01,
5915pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5916map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5926 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5935 int comparisonResult;
5936 BloombergLP::bslalg::RbTreeNode *insertLocation =
5937 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5941 static_cast<const Node *
>(node)->value().first);
5942 if (!comparisonResult) {
5943 nodeFactory().deleteNode(node);
5944 return pair<iterator, bool>(iterator(insertLocation),
false);
5947 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
5949 comparisonResult < 0,
5951 return pair<iterator, bool>(iterator(node),
true);
5955#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
5956template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
5957template <
class Args_01,
5967pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
5968map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
5979 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
5989 int comparisonResult;
5990 BloombergLP::bslalg::RbTreeNode *insertLocation =
5991 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
5995 static_cast<const Node *
>(node)->value().first);
5996 if (!comparisonResult) {
5997 nodeFactory().deleteNode(node);
5998 return pair<iterator, bool>(iterator(insertLocation),
false);
6001 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6003 comparisonResult < 0,
6005 return pair<iterator, bool>(iterator(node),
true);
6009#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
6010template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6011template <
class Args_01,
6022pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6023map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
6035 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6046 int comparisonResult;
6047 BloombergLP::bslalg::RbTreeNode *insertLocation =
6048 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6052 static_cast<const Node *
>(node)->value().first);
6053 if (!comparisonResult) {
6054 nodeFactory().deleteNode(node);
6055 return pair<iterator, bool>(iterator(insertLocation),
false);
6058 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6060 comparisonResult < 0,
6062 return pair<iterator, bool>(iterator(node),
true);
6067#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 0
6068template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6070typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6071map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint)
6073 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6075 BloombergLP::bslalg::RbTreeNode *hintNode =
6076 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6077 int comparisonResult;
6078 BloombergLP::bslalg::RbTreeNode *insertLocation =
6079 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6083 static_cast<const Node *
>(node)->value().first,
6085 if (!comparisonResult) {
6086 nodeFactory().deleteNode(node);
6087 return iterator(insertLocation);
6090 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6092 comparisonResult < 0,
6094 return iterator(node);
6098#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 1
6099template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6100template <
class Args_01>
6102typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6103map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6106 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6108 BloombergLP::bslalg::RbTreeNode *hintNode =
6109 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6110 int comparisonResult;
6111 BloombergLP::bslalg::RbTreeNode *insertLocation =
6112 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6116 static_cast<const Node *
>(node)->value().first,
6118 if (!comparisonResult) {
6119 nodeFactory().deleteNode(node);
6120 return iterator(insertLocation);
6123 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6125 comparisonResult < 0,
6127 return iterator(node);
6131#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 2
6132template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6133template <
class Args_01,
6136typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6137map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6141 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6144 BloombergLP::bslalg::RbTreeNode *hintNode =
6145 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6146 int comparisonResult;
6147 BloombergLP::bslalg::RbTreeNode *insertLocation =
6148 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6152 static_cast<const Node *
>(node)->value().first,
6154 if (!comparisonResult) {
6155 nodeFactory().deleteNode(node);
6156 return iterator(insertLocation);
6159 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6161 comparisonResult < 0,
6163 return iterator(node);
6167#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 3
6168template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6169template <
class Args_01,
6173typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6174map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6179 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6183 BloombergLP::bslalg::RbTreeNode *hintNode =
6184 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6185 int comparisonResult;
6186 BloombergLP::bslalg::RbTreeNode *insertLocation =
6187 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6191 static_cast<const Node *
>(node)->value().first,
6193 if (!comparisonResult) {
6194 nodeFactory().deleteNode(node);
6195 return iterator(insertLocation);
6198 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6200 comparisonResult < 0,
6202 return iterator(node);
6206#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 4
6207template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6208template <
class Args_01,
6213typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6214map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6220 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6225 BloombergLP::bslalg::RbTreeNode *hintNode =
6226 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6227 int comparisonResult;
6228 BloombergLP::bslalg::RbTreeNode *insertLocation =
6229 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6233 static_cast<const Node *
>(node)->value().first,
6235 if (!comparisonResult) {
6236 nodeFactory().deleteNode(node);
6237 return iterator(insertLocation);
6240 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6242 comparisonResult < 0,
6244 return iterator(node);
6248#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 5
6249template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6250template <
class Args_01,
6256typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6257map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6264 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6270 BloombergLP::bslalg::RbTreeNode *hintNode =
6271 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6272 int comparisonResult;
6273 BloombergLP::bslalg::RbTreeNode *insertLocation =
6274 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6278 static_cast<const Node *
>(node)->value().first,
6280 if (!comparisonResult) {
6281 nodeFactory().deleteNode(node);
6282 return iterator(insertLocation);
6285 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6287 comparisonResult < 0,
6289 return iterator(node);
6293#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 6
6294template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6295template <
class Args_01,
6302typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6303map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6311 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6318 BloombergLP::bslalg::RbTreeNode *hintNode =
6319 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6320 int comparisonResult;
6321 BloombergLP::bslalg::RbTreeNode *insertLocation =
6322 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6326 static_cast<const Node *
>(node)->value().first,
6328 if (!comparisonResult) {
6329 nodeFactory().deleteNode(node);
6330 return iterator(insertLocation);
6333 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6335 comparisonResult < 0,
6337 return iterator(node);
6341#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 7
6342template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6343template <
class Args_01,
6351typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6352map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6361 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6369 BloombergLP::bslalg::RbTreeNode *hintNode =
6370 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6371 int comparisonResult;
6372 BloombergLP::bslalg::RbTreeNode *insertLocation =
6373 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6377 static_cast<const Node *
>(node)->value().first,
6379 if (!comparisonResult) {
6380 nodeFactory().deleteNode(node);
6381 return iterator(insertLocation);
6384 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6386 comparisonResult < 0,
6388 return iterator(node);
6392#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 8
6393template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6394template <
class Args_01,
6403typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6404map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6414 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6423 BloombergLP::bslalg::RbTreeNode *hintNode =
6424 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6425 int comparisonResult;
6426 BloombergLP::bslalg::RbTreeNode *insertLocation =
6427 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6431 static_cast<const Node *
>(node)->value().first,
6433 if (!comparisonResult) {
6434 nodeFactory().deleteNode(node);
6435 return iterator(insertLocation);
6438 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6440 comparisonResult < 0,
6442 return iterator(node);
6446#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 9
6447template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6448template <
class Args_01,
6458typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6459map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6470 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6480 BloombergLP::bslalg::RbTreeNode *hintNode =
6481 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6482 int comparisonResult;
6483 BloombergLP::bslalg::RbTreeNode *insertLocation =
6484 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6488 static_cast<const Node *
>(node)->value().first,
6490 if (!comparisonResult) {
6491 nodeFactory().deleteNode(node);
6492 return iterator(insertLocation);
6495 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6497 comparisonResult < 0,
6499 return iterator(node);
6503#if BSLSTL_MAP_VARIADIC_LIMIT_F >= 10
6504template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6505template <
class Args_01,
6516typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6517map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6529 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6540 BloombergLP::bslalg::RbTreeNode *hintNode =
6541 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6542 int comparisonResult;
6543 BloombergLP::bslalg::RbTreeNode *insertLocation =
6544 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6548 static_cast<const Node *
>(node)->value().first,
6550 if (!comparisonResult) {
6551 nodeFactory().deleteNode(node);
6552 return iterator(insertLocation);
6555 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6557 comparisonResult < 0,
6559 return iterator(node);
6567template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6568template <
class... Args>
6570pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6571map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
6574 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6576 int comparisonResult;
6577 BloombergLP::bslalg::RbTreeNode *insertLocation =
6578 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6582 static_cast<const Node *
>(node)->value().first);
6583 if (!comparisonResult) {
6584 nodeFactory().deleteNode(node);
6585 return pair<iterator, bool>(iterator(insertLocation),
false);
6588 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6590 comparisonResult < 0,
6592 return pair<iterator, bool>(iterator(node),
true);
6595template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6596template <
class... Args>
6598typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6599map<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
6602 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6604 BloombergLP::bslalg::RbTreeNode *hintNode =
6605 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
6606 int comparisonResult;
6607 BloombergLP::bslalg::RbTreeNode *insertLocation =
6608 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6612 static_cast<const Node *
>(node)->value().first,
6614 if (!comparisonResult) {
6615 nodeFactory().deleteNode(node);
6616 return iterator(insertLocation);
6619 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6621 comparisonResult < 0,
6623 return iterator(node);
6629template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6631typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6632map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator position)
6636 BloombergLP::bslalg::RbTreeNode *node =
6637 const_cast<BloombergLP::bslalg::RbTreeNode *
>(position.node());
6638 BloombergLP::bslalg::RbTreeNode *result =
6639 BloombergLP::bslalg::RbTreeUtil::next(node);
6640 BloombergLP::bslalg::RbTreeUtil::remove(&d_tree, node);
6641 nodeFactory().deleteNode(node);
6642 return iterator(result);
6645template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6647typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6648map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(iterator position)
6650 return erase(const_iterator(position));
6653template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6655typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
6656map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(
const key_type& key)
6658 const_iterator it = find(key);
6666template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6668typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
6669map<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator first,
6670 const_iterator last)
6672 while (first != last) {
6673 first =
erase(first);
6675 return iterator(last.node());
6678template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6680void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::swap(map& other)
6682 AllocatorTraits::is_always_equal::value &&
6683 bsl::is_nothrow_swappable<COMPARATOR>::value)
6685 if (AllocatorTraits::propagate_on_container_swap::value) {
6686 quickSwapExchangeAllocators(other);
6693 nodeFactory().allocator() == other.nodeFactory().allocator())) {
6694 quickSwapRetainAllocators(other);
6699 map toOtherCopy(MoveUtil::move(*
this),
6700 other.nodeFactory().allocator());
6701 map toThisCopy(MoveUtil::move(other), nodeFactory().allocator());
6703 this->quickSwapRetainAllocators(toThisCopy);
6704 other.quickSwapRetainAllocators(toOtherCopy);
6709#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6712#ifndef BSLSTL_MAP_VARIADIC_LIMIT
6713#define BSLSTL_MAP_VARIADIC_LIMIT 10
6715#ifndef BSLSTL_MAP_VARIADIC_LIMIT_G
6716#define BSLSTL_MAP_VARIADIC_LIMIT_G BSLSTL_MAP_VARIADIC_LIMIT
6718#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 0
6719template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6721pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6722map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key)
6724 int comparisonResult;
6725 BloombergLP::bslalg::RbTreeNode *insertLocation =
6726 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6731 if (!comparisonResult) {
6732 return pair<iterator, bool>(iterator(insertLocation),
false);
6735#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6736 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6737 std::piecewise_construct,
6738 std::forward_as_tuple(key),
6739 std::forward_as_tuple());
6741 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6746 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6748 comparisonResult < 0,
6750 return pair<iterator, bool>(iterator(node),
true);
6754#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 1
6755template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6756template <
class Args_01>
6758pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6759map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
6762 int comparisonResult;
6763 BloombergLP::bslalg::RbTreeNode *insertLocation =
6764 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6769 if (!comparisonResult) {
6770 return pair<iterator, bool>(iterator(insertLocation),
false);
6773#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6774 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6775 std::piecewise_construct,
6776 std::forward_as_tuple(key),
6777 std::forward_as_tuple(
6780 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6785 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6787 comparisonResult < 0,
6789 return pair<iterator, bool>(iterator(node),
true);
6793#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 2
6794template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6795template <
class Args_01,
6798pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6799map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
6803 int comparisonResult;
6804 BloombergLP::bslalg::RbTreeNode *insertLocation =
6805 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6810 if (!comparisonResult) {
6811 return pair<iterator, bool>(iterator(insertLocation),
false);
6814#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6815 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6816 std::piecewise_construct,
6817 std::forward_as_tuple(key),
6818 std::forward_as_tuple(
6822 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6828 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6830 comparisonResult < 0,
6832 return pair<iterator, bool>(iterator(node),
true);
6836#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 3
6837template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6838template <
class Args_01,
6842pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6843map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
6848 int comparisonResult;
6849 BloombergLP::bslalg::RbTreeNode *insertLocation =
6850 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6855 if (!comparisonResult) {
6856 return pair<iterator, bool>(iterator(insertLocation),
false);
6859#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6860 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6861 std::piecewise_construct,
6862 std::forward_as_tuple(key),
6863 std::forward_as_tuple(
6868 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6875 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6877 comparisonResult < 0,
6879 return pair<iterator, bool>(iterator(node),
true);
6883#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 4
6884template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6885template <
class Args_01,
6890pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6891map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
6897 int comparisonResult;
6898 BloombergLP::bslalg::RbTreeNode *insertLocation =
6899 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6904 if (!comparisonResult) {
6905 return pair<iterator, bool>(iterator(insertLocation),
false);
6908#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6909 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6910 std::piecewise_construct,
6911 std::forward_as_tuple(key),
6912 std::forward_as_tuple(
6918 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6926 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6928 comparisonResult < 0,
6930 return pair<iterator, bool>(iterator(node),
true);
6934#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 5
6935template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6936template <
class Args_01,
6942pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6943map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
6950 int comparisonResult;
6951 BloombergLP::bslalg::RbTreeNode *insertLocation =
6952 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
6957 if (!comparisonResult) {
6958 return pair<iterator, bool>(iterator(insertLocation),
false);
6961#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
6962 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6963 std::piecewise_construct,
6964 std::forward_as_tuple(key),
6965 std::forward_as_tuple(
6972 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
6981 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
6983 comparisonResult < 0,
6985 return pair<iterator, bool>(iterator(node),
true);
6989#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 6
6990template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
6991template <
class Args_01,
6998pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
6999map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
7007 int comparisonResult;
7008 BloombergLP::bslalg::RbTreeNode *insertLocation =
7009 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7014 if (!comparisonResult) {
7015 return pair<iterator, bool>(iterator(insertLocation),
false);
7018#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7019 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7020 std::piecewise_construct,
7021 std::forward_as_tuple(key),
7022 std::forward_as_tuple(
7030 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7040 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7042 comparisonResult < 0,
7044 return pair<iterator, bool>(iterator(node),
true);
7048#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 7
7049template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7050template <
class Args_01,
7058pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
7059map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
7068 int comparisonResult;
7069 BloombergLP::bslalg::RbTreeNode *insertLocation =
7070 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7075 if (!comparisonResult) {
7076 return pair<iterator, bool>(iterator(insertLocation),
false);
7079#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7080 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7081 std::piecewise_construct,
7082 std::forward_as_tuple(key),
7083 std::forward_as_tuple(
7092 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7103 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7105 comparisonResult < 0,
7107 return pair<iterator, bool>(iterator(node),
true);
7111#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 8
7112template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7113template <
class Args_01,
7122pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
7123map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
7133 int comparisonResult;
7134 BloombergLP::bslalg::RbTreeNode *insertLocation =
7135 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7140 if (!comparisonResult) {
7141 return pair<iterator, bool>(iterator(insertLocation),
false);
7144#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7145 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7146 std::piecewise_construct,
7147 std::forward_as_tuple(key),
7148 std::forward_as_tuple(
7158 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7170 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7172 comparisonResult < 0,
7174 return pair<iterator, bool>(iterator(node),
true);
7178#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 9
7179template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7180template <
class Args_01,
7190pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
7191map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
7202 int comparisonResult;
7203 BloombergLP::bslalg::RbTreeNode *insertLocation =
7204 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7209 if (!comparisonResult) {
7210 return pair<iterator, bool>(iterator(insertLocation),
false);
7213#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7214 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7215 std::piecewise_construct,
7216 std::forward_as_tuple(key),
7217 std::forward_as_tuple(
7228 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7241 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7243 comparisonResult < 0,
7245 return pair<iterator, bool>(iterator(node),
true);
7249#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 10
7250template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7251template <
class Args_01,
7262pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
7263map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
7275 int comparisonResult;
7276 BloombergLP::bslalg::RbTreeNode *insertLocation =
7277 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7282 if (!comparisonResult) {
7283 return pair<iterator, bool>(iterator(insertLocation),
false);
7286#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7287 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7288 std::piecewise_construct,
7289 std::forward_as_tuple(key),
7290 std::forward_as_tuple(
7302 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7316 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7318 comparisonResult < 0,
7320 return pair<iterator, bool>(iterator(node),
true);
7325#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 0
7326template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7328typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7329map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7330 const key_type& key)
7332 BloombergLP::bslalg::RbTreeNode *hintNode =
7333 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7334 int comparisonResult;
7335 BloombergLP::bslalg::RbTreeNode *insertLocation =
7336 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7342 if (!comparisonResult) {
7343 return iterator(insertLocation);
7346#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7347 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7348 std::piecewise_construct,
7349 std::forward_as_tuple(key),
7350 std::forward_as_tuple());
7352 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7357 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7359 comparisonResult < 0,
7361 return iterator(node);
7365#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 1
7366template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7367template <
class Args_01>
7369typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7370map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7371 const key_type& key,
7374 BloombergLP::bslalg::RbTreeNode *hintNode =
7375 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7376 int comparisonResult;
7377 BloombergLP::bslalg::RbTreeNode *insertLocation =
7378 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7384 if (!comparisonResult) {
7385 return iterator(insertLocation);
7388#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7389 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7390 std::piecewise_construct,
7391 std::forward_as_tuple(key),
7392 std::forward_as_tuple(
7395 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7400 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7402 comparisonResult < 0,
7404 return iterator(node);
7408#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 2
7409template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7410template <
class Args_01,
7413typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7414map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7415 const key_type& key,
7419 BloombergLP::bslalg::RbTreeNode *hintNode =
7420 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7421 int comparisonResult;
7422 BloombergLP::bslalg::RbTreeNode *insertLocation =
7423 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7429 if (!comparisonResult) {
7430 return iterator(insertLocation);
7433#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7434 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7435 std::piecewise_construct,
7436 std::forward_as_tuple(key),
7437 std::forward_as_tuple(
7441 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7447 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7449 comparisonResult < 0,
7451 return iterator(node);
7455#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 3
7456template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7457template <
class Args_01,
7461typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7462map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7463 const key_type& key,
7468 BloombergLP::bslalg::RbTreeNode *hintNode =
7469 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7470 int comparisonResult;
7471 BloombergLP::bslalg::RbTreeNode *insertLocation =
7472 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7478 if (!comparisonResult) {
7479 return iterator(insertLocation);
7482#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7483 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7484 std::piecewise_construct,
7485 std::forward_as_tuple(key),
7486 std::forward_as_tuple(
7491 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7498 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7500 comparisonResult < 0,
7502 return iterator(node);
7506#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 4
7507template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7508template <
class Args_01,
7513typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7514map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7515 const key_type& key,
7521 BloombergLP::bslalg::RbTreeNode *hintNode =
7522 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7523 int comparisonResult;
7524 BloombergLP::bslalg::RbTreeNode *insertLocation =
7525 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7531 if (!comparisonResult) {
7532 return iterator(insertLocation);
7535#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7536 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7537 std::piecewise_construct,
7538 std::forward_as_tuple(key),
7539 std::forward_as_tuple(
7545 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7553 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7555 comparisonResult < 0,
7557 return iterator(node);
7561#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 5
7562template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7563template <
class Args_01,
7569typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7570map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7571 const key_type& key,
7578 BloombergLP::bslalg::RbTreeNode *hintNode =
7579 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7580 int comparisonResult;
7581 BloombergLP::bslalg::RbTreeNode *insertLocation =
7582 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7588 if (!comparisonResult) {
7589 return iterator(insertLocation);
7592#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7593 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7594 std::piecewise_construct,
7595 std::forward_as_tuple(key),
7596 std::forward_as_tuple(
7603 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7612 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7614 comparisonResult < 0,
7616 return iterator(node);
7620#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 6
7621template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7622template <
class Args_01,
7629typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7630map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7631 const key_type& key,
7639 BloombergLP::bslalg::RbTreeNode *hintNode =
7640 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7641 int comparisonResult;
7642 BloombergLP::bslalg::RbTreeNode *insertLocation =
7643 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7649 if (!comparisonResult) {
7650 return iterator(insertLocation);
7653#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7654 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7655 std::piecewise_construct,
7656 std::forward_as_tuple(key),
7657 std::forward_as_tuple(
7665 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7675 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7677 comparisonResult < 0,
7679 return iterator(node);
7683#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 7
7684template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7685template <
class Args_01,
7693typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7694map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7695 const key_type& key,
7704 BloombergLP::bslalg::RbTreeNode *hintNode =
7705 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7706 int comparisonResult;
7707 BloombergLP::bslalg::RbTreeNode *insertLocation =
7708 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7714 if (!comparisonResult) {
7715 return iterator(insertLocation);
7718#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7719 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7720 std::piecewise_construct,
7721 std::forward_as_tuple(key),
7722 std::forward_as_tuple(
7731 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7742 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7744 comparisonResult < 0,
7746 return iterator(node);
7750#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 8
7751template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7752template <
class Args_01,
7761typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7762map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7763 const key_type& key,
7773 BloombergLP::bslalg::RbTreeNode *hintNode =
7774 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7775 int comparisonResult;
7776 BloombergLP::bslalg::RbTreeNode *insertLocation =
7777 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7783 if (!comparisonResult) {
7784 return iterator(insertLocation);
7787#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7788 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7789 std::piecewise_construct,
7790 std::forward_as_tuple(key),
7791 std::forward_as_tuple(
7801 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7813 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7815 comparisonResult < 0,
7817 return iterator(node);
7821#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 9
7822template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7823template <
class Args_01,
7833typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7834map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7835 const key_type& key,
7846 BloombergLP::bslalg::RbTreeNode *hintNode =
7847 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7848 int comparisonResult;
7849 BloombergLP::bslalg::RbTreeNode *insertLocation =
7850 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7856 if (!comparisonResult) {
7857 return iterator(insertLocation);
7860#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7861 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7862 std::piecewise_construct,
7863 std::forward_as_tuple(key),
7864 std::forward_as_tuple(
7875 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7888 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7890 comparisonResult < 0,
7892 return iterator(node);
7896#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 10
7897template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7898template <
class Args_01,
7909typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
7910map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
7911 const key_type& key,
7923 BloombergLP::bslalg::RbTreeNode *hintNode =
7924 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
7925 int comparisonResult;
7926 BloombergLP::bslalg::RbTreeNode *insertLocation =
7927 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7933 if (!comparisonResult) {
7934 return iterator(insertLocation);
7937#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7938 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7939 std::piecewise_construct,
7940 std::forward_as_tuple(key),
7941 std::forward_as_tuple(
7953 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7967 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
7969 comparisonResult < 0,
7971 return iterator(node);
7976#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 0
7977template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
7979pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
7980map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
7981 BloombergLP::bslmf::MovableRef<key_type> key)
7983 key_type& lvalue = key;
7985 int comparisonResult;
7986 BloombergLP::bslalg::RbTreeNode *insertLocation =
7987 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
7992 if (!comparisonResult) {
7993 return pair<iterator, bool>(iterator(insertLocation),
false);
7996#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
7997 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
7998 std::piecewise_construct,
8000 std::forward_as_tuple());
8002 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8007 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8009 comparisonResult < 0,
8012 return pair<iterator, bool>(iterator(node),
true);
8016#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 1
8017template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8018template <
class Args_01>
8020pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8021map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8022 BloombergLP::bslmf::MovableRef<key_type> key,
8025 key_type& lvalue = key;
8027 int comparisonResult;
8028 BloombergLP::bslalg::RbTreeNode *insertLocation =
8029 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8034 if (!comparisonResult) {
8035 return pair<iterator, bool>(iterator(insertLocation),
false);
8038#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8039 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8040 std::piecewise_construct,
8042 std::forward_as_tuple(
8045 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8050 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8052 comparisonResult < 0,
8055 return pair<iterator, bool>(iterator(node),
true);
8059#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 2
8060template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8061template <
class Args_01,
8064pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8065map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8066 BloombergLP::bslmf::MovableRef<key_type> key,
8070 key_type& lvalue = key;
8072 int comparisonResult;
8073 BloombergLP::bslalg::RbTreeNode *insertLocation =
8074 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8079 if (!comparisonResult) {
8080 return pair<iterator, bool>(iterator(insertLocation),
false);
8083#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8084 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8085 std::piecewise_construct,
8087 std::forward_as_tuple(
8091 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8097 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8099 comparisonResult < 0,
8102 return pair<iterator, bool>(iterator(node),
true);
8106#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 3
8107template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8108template <
class Args_01,
8112pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8113map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8114 BloombergLP::bslmf::MovableRef<key_type> key,
8119 key_type& lvalue = key;
8121 int comparisonResult;
8122 BloombergLP::bslalg::RbTreeNode *insertLocation =
8123 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8128 if (!comparisonResult) {
8129 return pair<iterator, bool>(iterator(insertLocation),
false);
8132#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8133 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8134 std::piecewise_construct,
8136 std::forward_as_tuple(
8141 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8148 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8150 comparisonResult < 0,
8153 return pair<iterator, bool>(iterator(node),
true);
8157#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 4
8158template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8159template <
class Args_01,
8164pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8165map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8166 BloombergLP::bslmf::MovableRef<key_type> key,
8172 key_type& lvalue = key;
8174 int comparisonResult;
8175 BloombergLP::bslalg::RbTreeNode *insertLocation =
8176 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8181 if (!comparisonResult) {
8182 return pair<iterator, bool>(iterator(insertLocation),
false);
8185#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8186 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8187 std::piecewise_construct,
8189 std::forward_as_tuple(
8195 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8203 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8205 comparisonResult < 0,
8208 return pair<iterator, bool>(iterator(node),
true);
8212#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 5
8213template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8214template <
class Args_01,
8220pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8221map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8222 BloombergLP::bslmf::MovableRef<key_type> key,
8229 key_type& lvalue = key;
8231 int comparisonResult;
8232 BloombergLP::bslalg::RbTreeNode *insertLocation =
8233 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8238 if (!comparisonResult) {
8239 return pair<iterator, bool>(iterator(insertLocation),
false);
8242#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8243 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8244 std::piecewise_construct,
8246 std::forward_as_tuple(
8253 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8262 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8264 comparisonResult < 0,
8267 return pair<iterator, bool>(iterator(node),
true);
8271#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 6
8272template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8273template <
class Args_01,
8280pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8281map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8282 BloombergLP::bslmf::MovableRef<key_type> key,
8290 key_type& lvalue = key;
8292 int comparisonResult;
8293 BloombergLP::bslalg::RbTreeNode *insertLocation =
8294 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8299 if (!comparisonResult) {
8300 return pair<iterator, bool>(iterator(insertLocation),
false);
8303#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8304 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8305 std::piecewise_construct,
8307 std::forward_as_tuple(
8315 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8325 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8327 comparisonResult < 0,
8330 return pair<iterator, bool>(iterator(node),
true);
8334#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 7
8335template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8336template <
class Args_01,
8344pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8345map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8346 BloombergLP::bslmf::MovableRef<key_type> key,
8355 key_type& lvalue = key;
8357 int comparisonResult;
8358 BloombergLP::bslalg::RbTreeNode *insertLocation =
8359 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8364 if (!comparisonResult) {
8365 return pair<iterator, bool>(iterator(insertLocation),
false);
8368#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8369 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8370 std::piecewise_construct,
8372 std::forward_as_tuple(
8381 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8392 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8394 comparisonResult < 0,
8397 return pair<iterator, bool>(iterator(node),
true);
8401#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 8
8402template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8403template <
class Args_01,
8412pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8413map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8414 BloombergLP::bslmf::MovableRef<key_type> key,
8424 key_type& lvalue = key;
8426 int comparisonResult;
8427 BloombergLP::bslalg::RbTreeNode *insertLocation =
8428 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8433 if (!comparisonResult) {
8434 return pair<iterator, bool>(iterator(insertLocation),
false);
8437#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8438 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8439 std::piecewise_construct,
8441 std::forward_as_tuple(
8451 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8463 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8465 comparisonResult < 0,
8468 return pair<iterator, bool>(iterator(node),
true);
8472#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 9
8473template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8474template <
class Args_01,
8484pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8485map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8486 BloombergLP::bslmf::MovableRef<key_type> key,
8497 key_type& lvalue = key;
8499 int comparisonResult;
8500 BloombergLP::bslalg::RbTreeNode *insertLocation =
8501 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8506 if (!comparisonResult) {
8507 return pair<iterator, bool>(iterator(insertLocation),
false);
8510#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8511 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8512 std::piecewise_construct,
8514 std::forward_as_tuple(
8525 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8538 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8540 comparisonResult < 0,
8543 return pair<iterator, bool>(iterator(node),
true);
8547#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 10
8548template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8549template <
class Args_01,
8560pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
8561map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8562 BloombergLP::bslmf::MovableRef<key_type> key,
8574 key_type& lvalue = key;
8576 int comparisonResult;
8577 BloombergLP::bslalg::RbTreeNode *insertLocation =
8578 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8583 if (!comparisonResult) {
8584 return pair<iterator, bool>(iterator(insertLocation),
false);
8587#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8588 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8589 std::piecewise_construct,
8591 std::forward_as_tuple(
8603 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8617 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8619 comparisonResult < 0,
8622 return pair<iterator, bool>(iterator(node),
true);
8627#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 0
8628template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8630typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8631map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8632 const_iterator hint,
8633 BloombergLP::bslmf::MovableRef<key_type> key)
8635 key_type& lvalue = key;
8637 BloombergLP::bslalg::RbTreeNode *hintNode =
8638 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8639 int comparisonResult;
8640 BloombergLP::bslalg::RbTreeNode *insertLocation =
8641 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8647 if (!comparisonResult) {
8648 return iterator(insertLocation);
8651#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8652 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8653 std::piecewise_construct,
8655 std::forward_as_tuple());
8657 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8662 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8664 comparisonResult < 0,
8666 return iterator(node);
8670#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 1
8671template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8672template <
class Args_01>
8674typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8675map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8676 const_iterator hint,
8677 BloombergLP::bslmf::MovableRef<key_type> key,
8680 key_type& lvalue = key;
8682 BloombergLP::bslalg::RbTreeNode *hintNode =
8683 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8684 int comparisonResult;
8685 BloombergLP::bslalg::RbTreeNode *insertLocation =
8686 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8692 if (!comparisonResult) {
8693 return iterator(insertLocation);
8696#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8697 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8698 std::piecewise_construct,
8700 std::forward_as_tuple(
8703 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8708 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8710 comparisonResult < 0,
8712 return iterator(node);
8716#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 2
8717template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8718template <
class Args_01,
8721typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8722map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8723 const_iterator hint,
8724 BloombergLP::bslmf::MovableRef<key_type> key,
8728 key_type& lvalue = key;
8730 BloombergLP::bslalg::RbTreeNode *hintNode =
8731 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8732 int comparisonResult;
8733 BloombergLP::bslalg::RbTreeNode *insertLocation =
8734 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8740 if (!comparisonResult) {
8741 return iterator(insertLocation);
8744#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8745 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8746 std::piecewise_construct,
8748 std::forward_as_tuple(
8752 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8758 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8760 comparisonResult < 0,
8762 return iterator(node);
8766#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 3
8767template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8768template <
class Args_01,
8772typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8773map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8774 const_iterator hint,
8775 BloombergLP::bslmf::MovableRef<key_type> key,
8780 key_type& lvalue = key;
8782 BloombergLP::bslalg::RbTreeNode *hintNode =
8783 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8784 int comparisonResult;
8785 BloombergLP::bslalg::RbTreeNode *insertLocation =
8786 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8792 if (!comparisonResult) {
8793 return iterator(insertLocation);
8796#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8797 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8798 std::piecewise_construct,
8800 std::forward_as_tuple(
8805 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8812 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8814 comparisonResult < 0,
8816 return iterator(node);
8820#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 4
8821template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8822template <
class Args_01,
8827typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8828map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8829 const_iterator hint,
8830 BloombergLP::bslmf::MovableRef<key_type> key,
8836 key_type& lvalue = key;
8838 BloombergLP::bslalg::RbTreeNode *hintNode =
8839 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8840 int comparisonResult;
8841 BloombergLP::bslalg::RbTreeNode *insertLocation =
8842 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8848 if (!comparisonResult) {
8849 return iterator(insertLocation);
8852#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8853 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8854 std::piecewise_construct,
8856 std::forward_as_tuple(
8862 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8870 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8872 comparisonResult < 0,
8874 return iterator(node);
8878#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 5
8879template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8880template <
class Args_01,
8886typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8887map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8888 const_iterator hint,
8889 BloombergLP::bslmf::MovableRef<key_type> key,
8896 key_type& lvalue = key;
8898 BloombergLP::bslalg::RbTreeNode *hintNode =
8899 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8900 int comparisonResult;
8901 BloombergLP::bslalg::RbTreeNode *insertLocation =
8902 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8908 if (!comparisonResult) {
8909 return iterator(insertLocation);
8912#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8913 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8914 std::piecewise_construct,
8916 std::forward_as_tuple(
8923 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8932 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
8934 comparisonResult < 0,
8936 return iterator(node);
8940#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 6
8941template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
8942template <
class Args_01,
8949typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
8950map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
8951 const_iterator hint,
8952 BloombergLP::bslmf::MovableRef<key_type> key,
8960 key_type& lvalue = key;
8962 BloombergLP::bslalg::RbTreeNode *hintNode =
8963 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
8964 int comparisonResult;
8965 BloombergLP::bslalg::RbTreeNode *insertLocation =
8966 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
8972 if (!comparisonResult) {
8973 return iterator(insertLocation);
8976#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
8977 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8978 std::piecewise_construct,
8980 std::forward_as_tuple(
8988 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
8998 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9000 comparisonResult < 0,
9002 return iterator(node);
9006#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 7
9007template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9008template <
class Args_01,
9016typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9017map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9018 const_iterator hint,
9019 BloombergLP::bslmf::MovableRef<key_type> key,
9028 key_type& lvalue = key;
9030 BloombergLP::bslalg::RbTreeNode *hintNode =
9031 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9032 int comparisonResult;
9033 BloombergLP::bslalg::RbTreeNode *insertLocation =
9034 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9040 if (!comparisonResult) {
9041 return iterator(insertLocation);
9044#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9045 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9046 std::piecewise_construct,
9048 std::forward_as_tuple(
9057 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9068 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9070 comparisonResult < 0,
9072 return iterator(node);
9076#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 8
9077template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9078template <
class Args_01,
9087typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9088map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9089 const_iterator hint,
9090 BloombergLP::bslmf::MovableRef<key_type> key,
9100 key_type& lvalue = key;
9102 BloombergLP::bslalg::RbTreeNode *hintNode =
9103 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9104 int comparisonResult;
9105 BloombergLP::bslalg::RbTreeNode *insertLocation =
9106 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9112 if (!comparisonResult) {
9113 return iterator(insertLocation);
9116#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9117 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9118 std::piecewise_construct,
9120 std::forward_as_tuple(
9130 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9142 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9144 comparisonResult < 0,
9146 return iterator(node);
9150#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 9
9151template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9152template <
class Args_01,
9162typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9163map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9164 const_iterator hint,
9165 BloombergLP::bslmf::MovableRef<key_type> key,
9176 key_type& lvalue = key;
9178 BloombergLP::bslalg::RbTreeNode *hintNode =
9179 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9180 int comparisonResult;
9181 BloombergLP::bslalg::RbTreeNode *insertLocation =
9182 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9188 if (!comparisonResult) {
9189 return iterator(insertLocation);
9192#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9193 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9194 std::piecewise_construct,
9196 std::forward_as_tuple(
9207 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9220 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9222 comparisonResult < 0,
9224 return iterator(node);
9228#if BSLSTL_MAP_VARIADIC_LIMIT_G >= 10
9229template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9230template <
class Args_01,
9241typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9242map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9243 const_iterator hint,
9244 BloombergLP::bslmf::MovableRef<key_type> key,
9256 key_type& lvalue = key;
9258 BloombergLP::bslalg::RbTreeNode *hintNode =
9259 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9260 int comparisonResult;
9261 BloombergLP::bslalg::RbTreeNode *insertLocation =
9262 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9268 if (!comparisonResult) {
9269 return iterator(insertLocation);
9272#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9273 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9274 std::piecewise_construct,
9276 std::forward_as_tuple(
9288 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9302 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9304 comparisonResult < 0,
9306 return iterator(node);
9313template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9314template <
class... Args>
9316pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
9317map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
const key_type& key,
9320 int comparisonResult;
9321 BloombergLP::bslalg::RbTreeNode *insertLocation =
9322 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9327 if (!comparisonResult) {
9328 return pair<iterator, bool>(iterator(insertLocation),
false);
9331#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9332 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9333 std::piecewise_construct,
9334 std::forward_as_tuple(key),
9337 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9342 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9344 comparisonResult < 0,
9346 return pair<iterator, bool>(iterator(node),
true);
9349template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9350template <
class... Args>
9352typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9353map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(const_iterator hint,
9354 const key_type& key,
9357 BloombergLP::bslalg::RbTreeNode *hintNode =
9358 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9359 int comparisonResult;
9360 BloombergLP::bslalg::RbTreeNode *insertLocation =
9361 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9367 if (!comparisonResult) {
9368 return iterator(insertLocation);
9371#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9372 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9373 std::piecewise_construct,
9374 std::forward_as_tuple(key),
9377 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9382 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9384 comparisonResult < 0,
9386 return iterator(node);
9389template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9390template <
class... Args>
9392pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
9393map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9394 BloombergLP::bslmf::MovableRef<key_type> key,
9397 key_type& lvalue = key;
9399 int comparisonResult;
9400 BloombergLP::bslalg::RbTreeNode *insertLocation =
9401 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9406 if (!comparisonResult) {
9407 return pair<iterator, bool>(iterator(insertLocation),
false);
9410#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9411 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9412 std::piecewise_construct,
9416 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9421 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9423 comparisonResult < 0,
9426 return pair<iterator, bool>(iterator(node),
true);
9429template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9430template <
class... Args>
9432typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
9433map<KEY, VALUE, COMPARATOR, ALLOCATOR>::try_emplace(
9434 const_iterator hint,
9435 BloombergLP::bslmf::MovableRef<key_type> key,
9438 key_type& lvalue = key;
9440 BloombergLP::bslalg::RbTreeNode *hintNode =
9441 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
9442 int comparisonResult;
9443 BloombergLP::bslalg::RbTreeNode *insertLocation =
9444 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
9450 if (!comparisonResult) {
9451 return iterator(insertLocation);
9454#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
9455 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9456 std::piecewise_construct,
9460 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
9465 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
9467 comparisonResult < 0,
9469 return iterator(node);
9474template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9480 if (d_tree.rootNode()) {
9484 BloombergLP::bslalg::RbTreeUtil::deleteTree(&d_tree, &nodeFactory());
9486#if defined(BSLS_ASSERT_SAFE_IS_USED)
9495template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9497typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::allocator_type
9498map<KEY, VALUE, COMPARATOR, ALLOCATOR>::get_allocator() const
9501 return nodeFactory().allocator();
9504template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9506typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9512template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9514typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9520template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9522typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9528template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9530typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9536template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9538typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9541 return const_iterator(d_tree.firstNode());
9544template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9546typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
9549 return const_iterator(d_tree.sentinel());
9552template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9554typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9557 return const_reverse_iterator(
end());
9560template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9562typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
9565 return const_reverse_iterator(
begin());
9568template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9570bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::contains(
9571 const key_type& key)
const
9573 return find(key) !=
end();
9577template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9579bool map<KEY, VALUE, COMPARATOR, ALLOCATOR>::empty() const
9582 return 0 == d_tree.numNodes();
9585template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9587typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
9590 return d_tree.numNodes();
9593template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9595typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
9598 return AllocatorTraits::max_size(get_allocator());
9601template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9602typename add_lvalue_reference<const VALUE>::type
9603map<KEY, VALUE, COMPARATOR, ALLOCATOR>::at(
9604 const key_type& key)
const
9606 const BloombergLP::bslalg::RbTreeNode *node =
9607 BloombergLP::bslalg::RbTreeUtil::find(d_tree,
9610 if (d_tree.sentinel() == node) {
9611 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
9612 "map<...>::at(key_type): invalid key value");
9614 return toNode(node)->value().second;
9617template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9619typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_compare
9620map<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_comp()
const
9622 return comparator().keyComparator();
9625template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9627typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare
9628map<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_comp()
const
9630 return value_compare(key_comp());
9636template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9641 return BloombergLP::bslalg::RangeCompare::equal(
lhs.begin(),
9649#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
9650template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9659#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
9661template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9663BloombergLP::bslalg::SynthThreeWayUtil::Result<bsl::pair<const KEY, VALUE>>
9664bsl::operator<=>(
const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
9665 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs)
9667 return bsl::lexicographical_compare_three_way(
9672 BloombergLP::bslalg::SynthThreeWayUtil::compare);
9677template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9682 return 0 > BloombergLP::bslalg::RangeCompare::lexicographical(
lhs.begin(),
9690template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9698template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9706template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9724bsl::erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate)
9726 return BloombergLP::bslstl::AlgorithmUtil::containerEraseIf(m, predicate);
9729template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9751template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9752struct HasStlIterators<
bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR> >
9761template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
9762struct UsesBslmaAllocator<
bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR> >
9772# error Not valid except when included from bslstl_map.h
Definition bslma_bslallocator.h:588
value_compare(COMPARATOR comparator)
Definition bslstl_map.h:2715
value_type second_argument_type
Definition bslstl_map.h:803
COMPARATOR comp
Definition bslstl_map.h:778
bool operator()(const value_type &x, const value_type &y) const
Definition bslstl_map.h:2724
value_type first_argument_type
Definition bslstl_map.h:798
value_compare & operator=(const value_compare &rhs)=default
friend class map
Definition bslstl_map.h:774
bool result_type
Definition bslstl_map.h:793
Definition bslstl_map.h:653
value_type & reference
Definition bslstl_map.h:747
iterator erase(const_iterator position)
Definition bslstl_map.h:3687
void insert_range(BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
Definition bslstl_map.h:1449
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3949
const_reverse_iterator crend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4014
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:3221
bool contains(const key_type &key) const
Definition bslstl_map.h:4021
BloombergLP::bslstl::TreeIterator< const value_type, Node, difference_type > const_iterator
Definition bslstl_map.h:758
reverse_iterator rend() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3324
pair< iterator, iterator > equal_range(const key_type &key)
Definition bslstl_map.h:1999
iterator upper_bound(const key_type &key)
Definition bslstl_map.h:1958
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3308
map()
Definition bslstl_map.h:3021
~map()
Destroy this object.
Definition bslstl_map.h:3152
const_reverse_iterator crbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4006
reverse_iterator rbegin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3316
iterator lower_bound(const key_type &key)
Definition bslstl_map.h:1919
size_type count(const key_type &key) const
Definition bslstl_map.h:2216
const value_type & const_reference
Definition bslstl_map.h:748
KEY key_type
Definition bslstl_map.h:742
AllocatorTraits::const_pointer const_pointer
Definition bslstl_map.h:753
add_lvalue_reference< VALUE >::type at(const key_type &key)
Definition bslstl_map.h:3286
pair< iterator, bool > emplace(Args &&... args)
bsl::reverse_iterator< iterator > reverse_iterator
Definition bslstl_map.h:759
iterator find(const key_type &key)
Definition bslstl_map.h:1885
void swap(map &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits pair< iterator, bool > try_emplace(const KEY &key, Args &&... args)
Definition bslstl_map.h:1758
ALLOCATOR allocator_type
Definition bslstl_map.h:746
map & operator=(const map &rhs)
Definition bslstl_map.h:3161
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4030
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:4039
pair< iterator, bool > insert(const value_type &value)
Definition bslstl_map.h:3332
iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3300
VALUE mapped_type
Definition bslstl_map.h:743
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3927
value_compare value_comp() const
Definition bslstl_map.h:4079
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3990
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4047
bsl::reverse_iterator< const_iterator > const_reverse_iterator
Definition bslstl_map.h:760
AllocatorTraits::size_type size_type
Definition bslstl_map.h:750
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_map.h:3655
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3998
BloombergLP::bslstl::TreeIterator< value_type, Node, difference_type > iterator
Definition bslstl_map.h:756
pair< const KEY, VALUE > value_type
Definition bslstl_map.h:744
AllocatorTraits::pointer pointer
Definition bslstl_map.h:752
AllocatorTraits::difference_type difference_type
Definition bslstl_map.h:751
key_compare key_comp() const
Definition bslstl_map.h:4071
COMPARATOR key_compare
Definition bslstl_map.h:745
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1917
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2343
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2349
#define BSLS_KEYWORD_CONSTEXPR_CPP17
Definition bsls_keyword.h:639
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:674
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:676
#define BSLSTL_MAP_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
Definition bslstl_map.h:613
void swap(OptionValue &a, OptionValue &b)
Definition bdlat_valuetypefunctions.h:939
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
T::const_iterator cend(const T &container)
Definition bslstl_iterator.h:1709
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:1695
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)
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4424
T::iterator begin(T &container)
Definition bslstl_iterator.h:1593
const from_range_t from_range
bool operator==(const memory_resource &a, const memory_resource &b)
T::const_iterator cbegin(const T &container)
Definition bslstl_iterator.h:1651
ALLOCATOR & lhs
Definition bslstl_string.h:3917
T::iterator end(T &container)
Definition bslstl_iterator.h:1621
deque< VALUE_TYPE, ALLOCATOR >::size_type erase_if(deque< VALUE_TYPE, ALLOCATOR > &deq, PREDICATE predicate)
Definition bslstl_deque.h:4433
bool operator!=(const memory_resource &a, const memory_resource &b)
T::const_reverse_iterator crend(const T &container)
Definition bslstl_iterator.h:1752
Definition bdlc_flathashmap.h:2218
Definition baljsn_encoder_testtypes.h:76
Definition bdlbb_blob.h:579
t_TYPE & type
This typedef defines the return type of this meta function.
Definition bslmf_addlvaluereference.h:131
Definition bslma_allocatortraits.h:1089
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR >::type const_pointer
Definition bslma_allocatortraits.h:1183
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR >::type size_type
Definition bslma_allocatortraits.h:1196
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR >::type pointer
Definition bslma_allocatortraits.h:1180
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR >::type difference_type
Definition bslma_allocatortraits.h:1193
Definition bslmf_enableif.h:530
Definition bslstl_ranges.h:301
Definition bslmf_isconvertible.h:875