8#ifndef INCLUDED_BSLSTL_MAP
9#define INCLUDED_BSLSTL_MAP
541#include <bslscm_version.h>
588#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
589# include <initializer_list>
592#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
597#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
601#ifdef BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER
602#include <type_traits>
603 #ifndef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
604 #error Rvalue references curiously absent despite native 'type_traits'.
608#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
609 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
610# define BSLSTL_MAP_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T) \
611 requires ::BloombergLP::bslmf::ContainerCompatibleRange<R, T>
613# define BSLSTL_MAP_REQUIRES_CONTAINER_COMPATIBLE_RANGE(R, T)
616#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
622# define COMPILING_BSLSTL_MAP_H
624# undef COMPILING_BSLSTL_MAP_H
651 class COMPARATOR = std::less<KEY>,
652 class ALLOCATOR = allocator<pair<const KEY, VALUE> > >
663 typedef BloombergLP::bslstl::MapComparator<KEY, VALUE, COMPARATOR>
668 typedef BloombergLP::bslstl::TreeNode<ValueType> Node;
672 typedef BloombergLP::bslstl::TreeNodePool<ValueType, ALLOCATOR>
681 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
692 class DataWrapper :
public Comparator {
699 DataWrapper(
const DataWrapper&);
700 DataWrapper& operator=(
const DataWrapper&);
708 DataWrapper(
const COMPARATOR& comparator,
709 const ALLOCATOR& basicAllocator);
717 BloombergLP::bslmf::MovableRef<DataWrapper> original);
723 NodeFactory& nodeFactory();
729 const NodeFactory& nodeFactory()
const;
733 DataWrapper d_compAndAlloc;
737 BloombergLP::bslalg::RbTreeAnchor d_tree;
755 typedef BloombergLP::bslstl::TreeIterator<
757 typedef BloombergLP::bslstl::TreeIterator<
785 value_compare(COMPARATOR comparator);
834 static Node *toNode(BloombergLP::bslalg::RbTreeNode *node);
840 static const Node *toNode(
const BloombergLP::bslalg::RbTreeNode *node);
846 NodeFactory& nodeFactory();
850 Comparator& comparator();
857 void quickSwapExchangeAllocators(
map& other);
866 void quickSwapRetainAllocators(
map& other);
872 template <
class INPUT_ITERATOR,
class SENTINEL>
873 void constructFromRange(INPUT_ITERATOR first, SENTINEL last);
875#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
876 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
886 template <
class INPUT_ITERATOR,
class SENTINEL>
887 void constructFromRange(INPUT_ITERATOR first,
893 template <
class INPUT_ITERATOR,
class SENTINEL>
894 void insertFromRange(INPUT_ITERATOR first,
897#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
898 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
906 template <
class INPUT_ITERATOR,
class SENTINEL>
907 void insertFromRange(INPUT_ITERATOR first,
916 const NodeFactory& nodeFactory()
const;
920 const Comparator& comparator()
const;
937 explicit map(
const COMPARATOR& comparator,
938 const ALLOCATOR& basicAllocator = ALLOCATOR())
939 : d_compAndAlloc(comparator, basicAllocator)
956 explicit map(
const ALLOCATOR& basicAllocator);
976 map(BloombergLP::bslmf::MovableRef<map> original);
988 const typename type_identity<ALLOCATOR>::type& basicAllocator);
1003 map(BloombergLP::bslmf::MovableRef<map> original,
1004 const typename type_identity<ALLOCATOR>::type& basicAllocator);
1036 template <
class INPUT_ITERATOR>
1038 INPUT_ITERATOR last,
1039 const COMPARATOR& comparator = COMPARATOR(),
1040 const ALLOCATOR& basicAllocator = ALLOCATOR());
1041 template <
class INPUT_ITERATOR>
1043 INPUT_ITERATOR last,
1044 const ALLOCATOR& basicAllocator);
1065 template <
class RANGE>
1069 const COMPARATOR& comparator = COMPARATOR(),
1070 const ALLOCATOR& basicAllocator = ALLOCATOR())
1071 : d_compAndAlloc(comparator, basicAllocator)
1076#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
1077 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
1078 if constexpr (ranges::sized_range<RANGE>) {
1079 constructFromRange(bsl::ranges::begin(range),
1080 bsl::ranges::end (range),
1081 bsl::ranges::size (range));
1085 constructFromRange(bsl::ranges::begin(range),
1086 bsl::ranges::end (range));
1090 template <
class RANGE>
1094 const ALLOCATOR& basicAllocator)
1095 : d_compAndAlloc(COMPARATOR(), basicAllocator)
1104 quickSwapRetainAllocators(other);
1107#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1127 map(std::initializer_list<value_type> values,
1128 const COMPARATOR& comparator = COMPARATOR(),
1129 const ALLOCATOR& basicAllocator = ALLOCATOR());
1130 map(std::initializer_list<value_type> values,
1131 const ALLOCATOR& basicAllocator);
1152 AllocatorTraits::is_always_equal::value &&
1153 std::is_nothrow_move_assignable<COMPARATOR>::value);
1169#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1178 map&
operator=(std::initializer_list<value_type> values);
1202 BloombergLP::bslmf::MovableRef<key_type> key);
1204#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1215 template <
class LOOKUP_KEY>
1217 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1244 template <
class LOOKUP_KEY>
1246 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1249 at(
const LOOKUP_KEY& key) {
1253 if (iter ==
end()) {
1254 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
1255 "map<...>::at(LOOKUP_KEY): invalid key value");
1257 return iter->second;
1307#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1308 template <
class ALT_VALUE_TYPE>
1310#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1311 template <
class ALT_VALUE_TYPE>
1328 template <
class ALT_VALUE_TYPE>
1330 ALT_VALUE_TYPE&&>::value,
1375 BloombergLP::bslmf::MovableRef<value_type> value);
1377#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1378 template <
class ALT_VALUE_TYPE>
1380#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
1381 template <
class ALT_VALUE_TYPE>
1403 template <
class ALT_VALUE_TYPE>
1405 ALT_VALUE_TYPE&&>::value,
1434 template <
class INPUT_ITERATOR>
1435 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
1447 template <
class RANGE>
1453#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
1454 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
1455 if constexpr (ranges::sized_range<RANGE>) {
1456 insertFromRange(bsl::ranges::begin(range),
1457 bsl::ranges::end (range),
1458 bsl::ranges::size (range));
1462 insertFromRange(bsl::ranges::begin(range),
1463 bsl::ranges::end (range));
1467#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1482#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1489 void insert(std::initializer_list<value_type> values);
1492#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1501 template <
class BDE_OTHER_TYPE>
1503 BDE_OTHER_TYPE&& obj);
1505 template <
class BDE_OTHER_TYPE>
1507 BloombergLP::bslmf::MovableRef<KEY> key,
1508 BDE_OTHER_TYPE&& obj);
1518 template<
class LOOKUP_KEY,
class BDE_OTHER_TYPE>
1520 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1529 int comparisonResult;
1530 BloombergLP::bslalg::RbTreeNode *insertLocation =
1531 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1537 if (!comparisonResult) {
1540 return Result(
iterator(insertLocation),
false);
1544 BloombergLP::bslalg::RbTreeNode *node =
1545 nodeFactory().emplaceIntoNewNode(
1549 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1551 comparisonResult < 0,
1554 return Result(
iterator(node),
true);
1565 template <
class BDE_OTHER_TYPE>
1568 BDE_OTHER_TYPE&& obj);
1579 template <
class BDE_OTHER_TYPE>
1581 BloombergLP::bslmf::MovableRef<KEY> key,
1582 BDE_OTHER_TYPE&& obj);
1593 template<
class LOOKUP_KEY,
class BDE_OTHER_TYPE>
1595 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1600 BDE_OTHER_TYPE&& obj)
1604 BloombergLP::bslalg::RbTreeNode *hintNode =
1605 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
1607 int comparisonResult;
1608 BloombergLP::bslalg::RbTreeNode *insertLocation =
1609 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1616 if (!comparisonResult) {
1623 BloombergLP::bslalg::RbTreeNode *node =
1624 nodeFactory().emplaceIntoNewNode(
1628 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1630 comparisonResult < 0,
1637#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1652 template <
class... Args>
1674 template <
class... Args>
1697 template <
class t_KEY>
1699 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1728 AllocatorTraits::is_always_equal::value &&
1729 bsl::is_nothrow_swappable<COMPARATOR>::value);
1748#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1757 template <
class... Args>
1759 template <
class... Args>
1762 template<
class LOOKUP_KEY,
class... Args>
1764 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1765 LOOKUP_KEY>::value &&
1773 const LOOKUP_KEY& lvalue = key;
1775 int comparisonResult;
1776 BloombergLP::bslalg::RbTreeNode *insertLocation =
1777 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1782 if (!comparisonResult) {
1787 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1788 BloombergLP::bslalg::RbTreeNode *node =
1789 nodeFactory().emplaceIntoNewNode(
1790 std::piecewise_construct,
1791 std::forward_as_tuple(std::forward<LOOKUP_KEY>(key)),
1792 std::forward_as_tuple(std::forward<Args>(args)...));
1794 BloombergLP::bslalg::RbTreeNode *node =
1795 nodeFactory().emplaceIntoNewNode(
1796 std::forward<LOOKUP_KEY>(key),
1800 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1802 comparisonResult < 0,
1817 template<
class... Args>
1819 template <
class... Args>
1821 BloombergLP::bslmf::MovableRef<KEY> key,
1823 template<
class LOOKUP_KEY,
class... Args>
1825 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1832 const LOOKUP_KEY& lvalue = key;
1834 BloombergLP::bslalg::RbTreeNode *hintNode =
1835 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
1837 int comparisonResult;
1838 BloombergLP::bslalg::RbTreeNode *insertLocation =
1839 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
1846 if (!comparisonResult) {
1850 #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
1851 BloombergLP::bslalg::RbTreeNode *node =
1852 nodeFactory().emplaceIntoNewNode(
1853 std::piecewise_construct,
1854 std::forward_as_tuple(std::forward<LOOKUP_KEY>(key)),
1855 std::forward_as_tuple(std::forward<Args>(args)...));
1857 BloombergLP::bslalg::RbTreeNode *node =
1858 nodeFactory().emplaceIntoNewNode(
1859 std::forward<LOOKUP_KEY>(key),
1863 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1865 comparisonResult < 0,
1889 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
1890 d_tree, this->comparator(), key));
1897 template <
class LOOKUP_KEY>
1899 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1906 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
1907 d_tree, this->comparator(), key));
1923 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
1924 d_tree, this->comparator(), key));
1936 template <
class LOOKUP_KEY>
1938 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1945 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
1946 d_tree, this->comparator(), key));
1962 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
1963 d_tree, this->comparator(), key));
1975 template <
class LOOKUP_KEY>
1977 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1984 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
1985 d_tree, this->comparator(), key));
2005 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2025 template <
class LOOKUP_KEY>
2027 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2036 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2044 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2105 template <class LOOKUP_KEY>
2107 BloombergLP::
bslmf::IsTransparentPredicate<COMPARATOR,
2148 template <class LOOKUP_KEY>
2150 BloombergLP::
bslmf::IsTransparentPredicate<COMPARATOR,
2153 at(const LOOKUP_KEY& key)
const {
2157 if (iter ==
end()) {
2158 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
2159 "map<...>::at(LOOKUP_KEY) const: invalid key value");
2161 return iter->second;
2192 d_tree, this->comparator(), key));
2199 template <
class LOOKUP_KEY>
2201 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2209 d_tree, this->comparator(), key));
2220 return (
find(key) !=
end()) ? 1 : 0;
2230 template <
class LOOKUP_KEY>
2232 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2242 while (it !=
end() && !comparator()(key, *it.node())) {
2262 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
2263 d_tree, this->comparator(), key));
2275 template <
class LOOKUP_KEY>
2277 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2285 BloombergLP::bslalg::RbTreeUtil::lowerBound(d_tree,
2303 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
2304 d_tree, this->comparator(), key));
2316 template <
class LOOKUP_KEY>
2318 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2325 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
2326 d_tree, this->comparator(), key));
2346 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2366 template <
class LOOKUP_KEY>
2368 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
2377 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2385 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
2395#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2405 class INPUT_ITERATOR,
2406 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
2408 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
2409 class COMPARATOR = std::less<KEY>,
2411 BloombergLP::bslstl::IteratorUtil::IterToAlloc_t<INPUT_ITERATOR>>,
2412 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
2413 class = bsl::enable_if_t<
bsl::IsStdAllocator_v<ALLOCATOR>>
2417 COMPARATOR = COMPARATOR(),
2418 ALLOCATOR = ALLOCATOR())
2419-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
2428 class INPUT_ITERATOR,
2431 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
2433 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
2434 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
2435 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2437map(INPUT_ITERATOR, INPUT_ITERATOR, COMPARATOR, ALLOC *)
2438-> map<KEY, VALUE, COMPARATOR>;
2445 class INPUT_ITERATOR,
2447 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
2449 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
2450 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
2452map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR)
2453-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
2460 class INPUT_ITERATOR,
2462 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
2464 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
2465 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
2466 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2468map(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
2480 class COMPARATOR = std::less<KEY>,
2481 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
2482 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
2483 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
2485map(std::initializer_list<pair<const KEY, VALUE>>,
2486 COMPARATOR = COMPARATOR(),
2487 ALLOCATOR = ALLOCATOR())
2488-> map<KEY, VALUE, COMPARATOR, ALLOCATOR>;
2501 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
2502 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2504map(std::initializer_list<pair<const KEY, VALUE>>, COMPARATOR, ALLOC *)
2505-> map<KEY, VALUE, COMPARATOR>;
2516 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
2518map(std::initializer_list<pair<const KEY, VALUE>>, ALLOCATOR)
2519-> map<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
2529 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
2530 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
2532map(std::initializer_list<pair<const KEY, VALUE>>, ALLOC *)
2546template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2547bool operator==(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2548 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2550#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2551template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2552bool operator!=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2553 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2564#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
2570template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2571BloombergLP::bslalg::SynthThreeWayUtil::Result<pair<const KEY, VALUE>>
2572operator<=>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2573 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2577template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2578bool operator<(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2579 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2592template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2593bool operator>(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2594 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2603template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2604bool operator<=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2605 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2614template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2615bool operator>=(const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2616 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
2636typename
map<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
2637erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate);
2657template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2658void swap(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& a,
2659 map<KEY, VALUE, COMPARATOR, ALLOCATOR>& b)
2671template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
2673map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
2674 const COMPARATOR& comparator,
2675 const ALLOCATOR& basicAllocator)
2676:
::bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(comparator)
2677, d_pool(basicAllocator)
2681template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2683map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
2684 BloombergLP::bslmf::MovableRef<DataWrapper> original)
2685: ::
bsl::map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(
2686 MoveUtil::access(original).keyComparator())
2687, d_pool(MoveUtil::move(MoveUtil::access(original).d_pool))
2691template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2693typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
2694map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
2700template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2702const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
2703map<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
const
2713template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2716 COMPARATOR comparator)
2722template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2736template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2738typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
2740 BloombergLP::bslalg::RbTreeNode *node)
2742 return static_cast<Node *
>(node);
2745template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2747const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Node *
2749 const BloombergLP::bslalg::RbTreeNode *node)
2751 return static_cast<const Node *
>(node);
2755template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2757typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
2758map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
2760 return d_compAndAlloc.nodeFactory();
2763template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2765typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
2766map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
2768 return d_compAndAlloc;
2771template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2773void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapExchangeAllocators(
2776 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
2777 nodeFactory().swapExchangeAllocators(other.nodeFactory());
2785 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
2786 comparator().swap(other.comparator());
2790template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2792void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapRetainAllocators(
2795 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
2796 nodeFactory().swapRetainAllocators(other.nodeFactory());
2800 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
2801 comparator().swap(other.comparator());
2805template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2806template <
class INPUT_ITERATOR,
class SENTINEL>
2809map<KEY, VALUE, COMPARATOR, ALLOCATOR>::constructFromRange(
2810 INPUT_ITERATOR first,
2813 if (first == last) {
2818 BloombergLP::bslstl::IteratorUtil::
2819 canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()) {
2821 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
2822 nodeFactory().reserveNodes(numElements);
2825 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
2836 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
2838 while (++first != last) {
2841 if (this->comparator()(value.first, *prevNode)) {
2844 insertFromRange(++first, last);
2848 if (this->comparator()(*prevNode, value.first)) {
2849 BloombergLP::bslalg::RbTreeNode *node =
2850 nodeFactory().emplaceIntoNewNode(value);
2851 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2862#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
2863 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
2865template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2866template <
class INPUT_ITERATOR,
class SENTINEL>
2869map<KEY, VALUE, COMPARATOR, ALLOCATOR>::constructFromRange(
2870 INPUT_ITERATOR first,
2876 !BloombergLP::bslstl::IteratorUtil
2877 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
2878 || numElements ==
static_cast<size_type>(
2879 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
2881 if (first == last) {
2885 if (0 < numElements) {
2886 nodeFactory().reserveNodes(numElements);
2889 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
2899 insert(*first); --numElements;
2900 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
2902 while (++first != last) {
2905 if (this->comparator()(value.first, *prevNode)) {
2907 insert(value); --numElements;
2908 insertFromRange(++first, last, numElements);
2912 if (this->comparator()(*prevNode, value.first)) {
2913 BloombergLP::bslalg::RbTreeNode *node =
2914 nodeFactory().emplaceIntoNewNode(value);
2915 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2929template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2930template <
class INPUT_ITERATOR,
class SENTINEL>
2932void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insertFromRange(
2933 INPUT_ITERATOR first,
2952 while (first != last) {
2954 if (BloombergLP::bslstl::IteratorUtil
2955 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
2957 !nodeFactory().hasFreeNodes())) {
2959 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last));
2961 nodeFactory().reserveNodes(numElements);
2969#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS) \
2970 && defined(BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES)
2972template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2973template <
class INPUT_ITERATOR,
class SENTINEL>
2975void map<KEY, VALUE, COMPARATOR, ALLOCATOR>::insertFromRange(
2976 INPUT_ITERATOR first,
2981 !BloombergLP::bslstl::IteratorUtil
2982 ::canCalculateInsertDistance<INPUT_ITERATOR, SENTINEL>()
2983 || numElements ==
static_cast<size_type>(
2984 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last))));
2986 while (first != last) {
2989 !nodeFactory().hasFreeNodes())) {
2990 nodeFactory().reserveNodes(numElements);
3002template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3004const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
3005map<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
const
3007 return d_compAndAlloc.nodeFactory();
3010template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3012const typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
3013map<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
const
3015 return d_compAndAlloc;
3019template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3022: d_compAndAlloc(COMPARATOR(), ALLOCATOR())
3027template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3030: d_compAndAlloc(COMPARATOR(), basicAllocator)
3035template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3038: d_compAndAlloc(original.comparator().keyComparator(),
3043 if (0 < original.
size()) {
3044 nodeFactory().reserveNodes(original.
size());
3045 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
3051template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3054 BloombergLP::bslmf::MovableRef<map> original)
3055: d_compAndAlloc(MoveUtil::move(MoveUtil::access(original).d_compAndAlloc))
3058 map& lvalue = original;
3059 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
3062template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3065 const typename type_identity<ALLOCATOR>::type& basicAllocator)
3066: d_compAndAlloc(original.comparator().keyComparator(), basicAllocator)
3069 if (0 < original.
size()) {
3070 nodeFactory().reserveNodes(original.
size());
3071 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
3077template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3080 BloombergLP::bslmf::MovableRef<map> original,
3081 const typename type_identity<ALLOCATOR>::type& basicAllocator)
3082: d_compAndAlloc(MoveUtil::access(original).comparator().keyComparator(),
3086 map& lvalue = original;
3089 nodeFactory().
allocator() == lvalue.nodeFactory().allocator())) {
3090 d_compAndAlloc.nodeFactory().adopt(
3091 MoveUtil::move(lvalue.d_compAndAlloc.nodeFactory()));
3092 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
3094 else if (0 < lvalue.
size()) {
3095 nodeFactory().reserveNodes(lvalue.
size());
3096 BloombergLP::bslalg::RbTreeUtil::moveTree(&d_tree,
3099 &lvalue.nodeFactory());
3103template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3104template <
class INPUT_ITERATOR>
3107 INPUT_ITERATOR last,
3108 const COMPARATOR& comparator,
3109 const ALLOCATOR& basicAllocator)
3110: d_compAndAlloc(comparator, basicAllocator)
3113 constructFromRange(first, last);
3116template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3117template <
class INPUT_ITERATOR>
3120 INPUT_ITERATOR last,
3121 const ALLOCATOR& basicAllocator)
3122: d_compAndAlloc(COMPARATOR(), basicAllocator)
3125 map other(first, last, COMPARATOR(), nodeFactory().
allocator());
3126 quickSwapRetainAllocators(other);
3129#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3130template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3133 std::initializer_list<value_type> values,
3134 const COMPARATOR& comparator,
3135 const ALLOCATOR& basicAllocator)
3136:
map(values.
begin(), values.
end(), comparator, basicAllocator)
3140template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3143 std::initializer_list<value_type> values,
3144 const ALLOCATOR& basicAllocator)
3145: map(values.begin(), values.end(), COMPARATOR(), basicAllocator)
3150template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3158template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3164 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
3165 map other(
rhs,
rhs.nodeFactory().allocator());
3166 quickSwapExchangeAllocators(other);
3170 quickSwapRetainAllocators(other);
3176template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3180 BloombergLP::bslmf::MovableRef<map>
rhs)
3182 AllocatorTraits::is_always_equal::value &&
3183 std::is_nothrow_move_assignable<COMPARATOR>::value)
3188 if (nodeFactory().
allocator() == lvalue.nodeFactory().allocator()) {
3189 map other(MoveUtil::move(lvalue));
3190 quickSwapRetainAllocators(other);
3193 AllocatorTraits::propagate_on_container_move_assignment::value) {
3194 map other(MoveUtil::move(lvalue));
3195 quickSwapExchangeAllocators(other);
3198 map other(MoveUtil::move(lvalue), nodeFactory().allocator());
3199 quickSwapRetainAllocators(other);
3205#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3206template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3208map<KEY, VALUE, COMPARATOR, ALLOCATOR>&
3210 std::initializer_list<value_type> values)
3213 insert(values.begin(), values.end());
3218template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3224 if (iter ==
end() || this->comparator()(key, *iter.node())) {
3225#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3226 iter = emplace_hint(iter,
3227 std::piecewise_construct,
3228 std::forward_as_tuple(key),
3229 std::forward_as_tuple());
3231 BloombergLP::bsls::ObjectBuffer<VALUE> temp;
3233 ALLOCATOR alloc = nodeFactory().allocator();
3235 AllocatorTraits::construct(alloc, temp.address());
3237 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
3243 iter = emplace_hint(iter, key, temp.object());
3246 return iter->second;
3249template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3253 BloombergLP::bslmf::MovableRef<key_type> key)
3257 iterator iter = lower_bound(lvalue);
3258 if (iter ==
end() || this->comparator()(lvalue, *iter.node())) {
3259#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3260 iter = emplace_hint(
3262 std::piecewise_construct,
3264 std::forward_as_tuple());
3266 BloombergLP::bsls::ObjectBuffer<VALUE> temp;
3268 ALLOCATOR alloc = nodeFactory().allocator();
3270 AllocatorTraits::construct(alloc, temp.address());
3272 BloombergLP::bslma::DestructorGuard<VALUE> guard(temp.address());
3278 iter = emplace_hint(iter, lvalue, temp.object());
3281 return iter->second;
3284template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3288 BloombergLP::bslalg::RbTreeNode *node =
3289 BloombergLP::bslalg::RbTreeUtil::find(d_tree, this->comparator(), key);
3290 if (d_tree.sentinel() == node) {
3291 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
3292 "map<...>::at(key_type): invalid key value");
3294 return toNode(node)->value().second;
3297template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3302 return iterator(d_tree.firstNode());
3305template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3310 return iterator(d_tree.sentinel());
3313template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3321template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3329template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3334 int comparisonResult;
3335 BloombergLP::bslalg::RbTreeNode *insertLocation =
3336 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3341 if (!comparisonResult) {
3345 BloombergLP::bslalg::RbTreeNode *node =
3346 nodeFactory().emplaceIntoNewNode(value);
3347 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3349 comparisonResult < 0,
3354template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3358 BloombergLP::bslmf::MovableRef<value_type> value)
3362 int comparisonResult;
3363 BloombergLP::bslalg::RbTreeNode *insertLocation =
3364 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3369 if (!comparisonResult) {
3373 BloombergLP::bslalg::RbTreeNode *node =
3374 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
3375 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3377 comparisonResult < 0,
3382template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3383template <
class INPUT_ITERATOR>
3386 INPUT_ITERATOR last)
3388 insertFromRange(first, last);
3391#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
3392template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3395 const_iterator last)
3397 while (first != last) {
3404template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3410 BloombergLP::bslalg::RbTreeNode *hintNode =
3411 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3412 int comparisonResult;
3413 BloombergLP::bslalg::RbTreeNode *insertLocation =
3414 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3420 if (!comparisonResult) {
3424 BloombergLP::bslalg::RbTreeNode *node =
3425 nodeFactory().emplaceIntoNewNode(value);
3426 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3428 comparisonResult < 0,
3433template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3438 BloombergLP::bslmf::MovableRef<value_type> value)
3442 BloombergLP::bslalg::RbTreeNode *hintNode =
3443 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3444 int comparisonResult;
3445 BloombergLP::bslalg::RbTreeNode *insertLocation =
3446 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3452 if (!comparisonResult) {
3456 BloombergLP::bslalg::RbTreeNode *node =
3457 nodeFactory().emplaceIntoNewNode(MoveUtil::move(lvalue));
3459 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3461 comparisonResult < 0,
3466#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3467template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3470 std::initializer_list<value_type> values)
3472 insert(values.begin(), values.end());
3476#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3477template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3478template <
class BDE_OTHER_TYPE>
3480pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
3482 BDE_OTHER_TYPE&& obj)
3484 int comparisonResult;
3485 BloombergLP::bslalg::RbTreeNode *insertLocation =
3486 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3492 if (!comparisonResult) {
3499 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3502 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3504 comparisonResult < 0,
3510template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3511template <
class BDE_OTHER_TYPE>
3516 BDE_OTHER_TYPE&& obj)
3518 BloombergLP::bslalg::RbTreeNode *hintNode =
3519 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3520 int comparisonResult;
3521 BloombergLP::bslalg::RbTreeNode *insertLocation =
3522 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3529 if (!comparisonResult) {
3536 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3539 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3541 comparisonResult < 0,
3547template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3548template <
class BDE_OTHER_TYPE>
3552 BloombergLP::bslmf::MovableRef<key_type> key,
3553 BDE_OTHER_TYPE&& obj)
3555 int comparisonResult;
3556 BloombergLP::bslalg::RbTreeNode *insertLocation =
3557 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3563 if (!comparisonResult) {
3570 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3574 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3576 comparisonResult < 0,
3582template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3583template <
class BDE_OTHER_TYPE>
3588 BloombergLP::bslmf::MovableRef<key_type> key,
3589 BDE_OTHER_TYPE&& obj)
3591 BloombergLP::bslalg::RbTreeNode *hintNode =
3592 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3593 int comparisonResult;
3594 BloombergLP::bslalg::RbTreeNode *insertLocation =
3595 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3602 if (!comparisonResult) {
3609 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3613 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3615 comparisonResult < 0,
3622#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3624template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3625template <
class... Args>
3630 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3632 int comparisonResult;
3633 BloombergLP::bslalg::RbTreeNode *insertLocation =
3634 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3638 static_cast<const Node *
>(node)->value().first);
3639 if (!comparisonResult) {
3640 nodeFactory().deleteNode(node);
3644 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3646 comparisonResult < 0,
3651template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3652template <
class... Args>
3658 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3660 BloombergLP::bslalg::RbTreeNode *hintNode =
3661 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3662 int comparisonResult;
3663 BloombergLP::bslalg::RbTreeNode *insertLocation =
3664 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3668 static_cast<const Node *
>(node)->value().first,
3670 if (!comparisonResult) {
3671 nodeFactory().deleteNode(node);
3675 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3677 comparisonResult < 0,
3684template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3691 BloombergLP::bslalg::RbTreeNode *node =
3692 const_cast<BloombergLP::bslalg::RbTreeNode *
>(position.node());
3693 BloombergLP::bslalg::RbTreeNode *result =
3694 BloombergLP::bslalg::RbTreeUtil::next(node);
3695 BloombergLP::bslalg::RbTreeUtil::remove(&d_tree, node);
3696 nodeFactory().deleteNode(node);
3700template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3708template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3721template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3727 while (first != last) {
3728 first =
erase(first);
3733template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3737 AllocatorTraits::is_always_equal::value &&
3738 bsl::is_nothrow_swappable<COMPARATOR>::value)
3740 if (AllocatorTraits::propagate_on_container_swap::value) {
3741 quickSwapExchangeAllocators(other);
3748 nodeFactory().allocator() == other.nodeFactory().allocator())) {
3749 quickSwapRetainAllocators(other);
3754 map toOtherCopy(MoveUtil::move(*
this),
3755 other.nodeFactory().allocator());
3756 map toThisCopy(MoveUtil::move(other), nodeFactory().allocator());
3758 this->quickSwapRetainAllocators(toThisCopy);
3759 other.quickSwapRetainAllocators(toOtherCopy);
3764#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3765template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3766template <
class... Args>
3768pair<typename map<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator,
bool>
3772 int comparisonResult;
3773 BloombergLP::bslalg::RbTreeNode *insertLocation =
3774 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3779 if (!comparisonResult) {
3783#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3784 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3785 std::piecewise_construct,
3786 std::forward_as_tuple(key),
3789 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3794 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3796 comparisonResult < 0,
3801template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3802template <
class... Args>
3809 BloombergLP::bslalg::RbTreeNode *hintNode =
3810 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3811 int comparisonResult;
3812 BloombergLP::bslalg::RbTreeNode *insertLocation =
3813 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3819 if (!comparisonResult) {
3823#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3824 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3825 std::piecewise_construct,
3826 std::forward_as_tuple(key),
3829 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3834 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3836 comparisonResult < 0,
3841template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3842template <
class... Args>
3846 BloombergLP::bslmf::MovableRef<key_type> key,
3851 int comparisonResult;
3852 BloombergLP::bslalg::RbTreeNode *insertLocation =
3853 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3858 if (!comparisonResult) {
3862#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3863 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3864 std::piecewise_construct,
3868 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3873 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3875 comparisonResult < 0,
3881template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3882template <
class... Args>
3887 BloombergLP::bslmf::MovableRef<key_type> key,
3892 BloombergLP::bslalg::RbTreeNode *hintNode =
3893 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
3894 int comparisonResult;
3895 BloombergLP::bslalg::RbTreeNode *insertLocation =
3896 BloombergLP::bslalg::RbTreeUtil::findUniqueInsertLocation(
3902 if (!comparisonResult) {
3906#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR)
3907 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3908 std::piecewise_construct,
3912 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
3917 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
3919 comparisonResult < 0,
3925template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3931 if (d_tree.rootNode()) {
3935 BloombergLP::bslalg::RbTreeUtil::deleteTree(&d_tree, &nodeFactory());
3937#if defined(BSLS_ASSERT_SAFE_IS_USED)
3946template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3952 return nodeFactory().allocator();
3955template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3963template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3971template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3979template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3987template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
3995template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4003template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4011template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4019template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4024 return find(key) !=
end();
4028template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4033 return 0 == d_tree.numNodes();
4036template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4041 return d_tree.numNodes();
4044template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4049 return AllocatorTraits::max_size(get_allocator());
4052template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4057 const BloombergLP::bslalg::RbTreeNode *node =
4058 BloombergLP::bslalg::RbTreeUtil::find(d_tree,
4061 if (d_tree.sentinel() == node) {
4062 BloombergLP::bslstl::StdExceptUtil::throwOutOfRange(
4063 "map<...>::at(key_type): invalid key value");
4065 return toNode(node)->value().second;
4068template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4073 return comparator().keyComparator();
4076template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4087template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4092 return BloombergLP::bslalg::RangeCompare::equal(lhs.begin(),
4100#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
4101template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4110#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
4112template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4114BloombergLP::bslalg::SynthThreeWayUtil::Result<bsl::pair<const KEY, VALUE>>
4115bsl::operator<=>(
const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
4116 const map<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs)
4118 return bsl::lexicographical_compare_three_way(
4123 BloombergLP::bslalg::SynthThreeWayUtil::compare);
4128template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4133 return 0 > BloombergLP::bslalg::RangeCompare::lexicographical(
lhs.begin(),
4141template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4149template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4157template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4175bsl::erase_if(map<KEY, VALUE, COMPARATOR, ALLOCATOR>& m, PREDICATE predicate)
4177 return BloombergLP::bslstl::AlgorithmUtil::containerEraseIf(m, predicate);
4180template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4202template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
4212template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
Definition bslma_bslallocator.h:588
Definition bslstl_string.h:1252
Definition bslstl_map.h:771
value_compare(const value_compare &original)=default
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
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
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, iterator >::type insert(const_iterator hint, BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
Definition bslstl_map.h:1408
const_reverse_iterator crend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4014
void insert(INPUT_ITERATOR first, INPUT_ITERATOR last)
Definition bslstl_map.h:3385
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
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< iterator, bool > >::type insert_or_assign(LOOKUP_KEY &&key, BDE_OTHER_TYPE &&obj)
Definition bslstl_map.h:1523
iterator erase(const_iterator first, const_iterator last)
Definition bslstl_map.h:3724
iterator upper_bound(const key_type &key)
Definition bslstl_map.h:1958
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type lower_bound(const LOOKUP_KEY &key) const
Definition bslstl_map.h:2280
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3308
const_iterator find(const key_type &key) const
Definition bslstl_map.h:2187
iterator try_emplace(const_iterator hint, const KEY &key, Args &&... args)
Definition bslstl_map.h:3805
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
size_type erase(const key_type &key)
Definition bslstl_map.h:3711
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type find(const LOOKUP_KEY &key)
Definition bslstl_map.h:1902
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value &&!bsl::is_convertible< LOOKUP_KEY &&, const_iterator >::value &&!bsl::is_convertible< LOOKUP_KEY &&, iterator >::value, pair< iterator, bool > >::type try_emplace(LOOKUP_KEY &&key, Args &&... args)
Definition bslstl_map.h:1769
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
pair< iterator, bool > insert_or_assign(BloombergLP::bslmf::MovableRef< KEY > key, BDE_OTHER_TYPE &&obj)
map(const ALLOCATOR &basicAllocator)
Definition bslstl_map.h:3029
iterator insert(const_iterator hint, BloombergLP::bslmf::MovableRef< value_type > value)
Definition bslstl_map.h:3436
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type lower_bound(const LOOKUP_KEY &key)
Definition bslstl_map.h:1941
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
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< iterator, iterator > >::type equal_range(const LOOKUP_KEY &key)
Definition bslstl_map.h:2030
iterator insert_or_assign(const_iterator hint, const KEY &key, BDE_OTHER_TYPE &&obj)
Definition bslstl_map.h:3514
pair< iterator, bool > emplace(Args &&... args)
map(BloombergLP::bslmf::MovableRef< map > original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
Definition bslstl_map.h:3079
map(const map &original, const typename type_identity< ALLOCATOR >::type &basicAllocator)
Definition bslstl_map.h:3064
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
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type find(const LOOKUP_KEY &key) const
Definition bslstl_map.h:2204
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:4030
pair< iterator, bool > insert_or_assign(const KEY &key, BDE_OTHER_TYPE &&obj)
iterator erase(iterator position)
Definition bslstl_map.h:3703
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this map.
Definition bslstl_map.h:4039
map(BloombergLP::bslmf::MovableRef< map > original)
Definition bslstl_map.h:3053
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
map(const COMPARATOR &comparator, const ALLOCATOR &basicAllocator=ALLOCATOR())
Definition bslstl_map.h:937
pair< const_iterator, const_iterator > equal_range(const key_type &key) const
Definition bslstl_map.h:2340
void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_map.h:3927
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, size_type >::type count(const LOOKUP_KEY &key) const
Definition bslstl_map.h:2235
enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, t_KEY >::value &&!is_convertible< BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), iterator >::value &&!is_convertible< BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY), const_iterator >::value, size_type >::type erase(BSLS_COMPILERFEATURES_FORWARD_REF(t_KEY) key)
Definition bslstl_map.h:1705
pair< iterator, bool > try_emplace(BloombergLP::bslmf::MovableRef< KEY > key, Args &&... args)
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type try_emplace(const_iterator hint, LOOKUP_KEY &&key, Args &&... args)
Definition bslstl_map.h:1828
add_lvalue_reference< VALUE >::type operator[](BloombergLP::bslmf::MovableRef< key_type > key)
Definition bslstl_map.h:3252
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type insert_or_assign(const_iterator hint, LOOKUP_KEY &&key, BDE_OTHER_TYPE &&obj)
Definition bslstl_map.h:1598
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::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, iterator >::type upper_bound(const LOOKUP_KEY &key)
Definition bslstl_map.h:1980
iterator insert_or_assign(const_iterator hint, BloombergLP::bslmf::MovableRef< KEY > key, BDE_OTHER_TYPE &&obj)
Definition bslstl_map.h:3586
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, pair< const_iterator, const_iterator > >::type equal_range(const LOOKUP_KEY &key) const
Definition bslstl_map.h:2371
map(INPUT_ITERATOR first, INPUT_ITERATOR last, const COMPARATOR &comparator=COMPARATOR(), const ALLOCATOR &basicAllocator=ALLOCATOR())
Definition bslstl_map.h:3106
bsl::reverse_iterator< const_iterator > const_reverse_iterator
Definition bslstl_map.h:760
enable_if< is_convertible< ALT_VALUE_TYPE, value_type >::value, pair< iterator, bool > >::type insert(BSLS_COMPILERFEATURES_FORWARD_REF(ALT_VALUE_TYPE) value)
Definition bslstl_map.h:1333
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
iterator insert(const_iterator hint, const value_type &value)
Definition bslstl_map.h:3407
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, const_iterator >::type upper_bound(const LOOKUP_KEY &key) const
Definition bslstl_map.h:2321
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
const_iterator upper_bound(const key_type &key) const
Definition bslstl_map.h:2299
map(INPUT_ITERATOR first, INPUT_ITERATOR last, const ALLOCATOR &basicAllocator)
Definition bslstl_map.h:3119
map(const map &original)
Definition bslstl_map.h:3037
iterator try_emplace(const_iterator hint, BloombergLP::bslmf::MovableRef< KEY > key, Args &&... args)
Definition bslstl_map.h:3885
bsl::enable_if< BloombergLP::bslmf::IsTransparentPredicate< COMPARATOR, LOOKUP_KEY >::value, typenameadd_lvalue_reference< VALUE >::type >::type at(const LOOKUP_KEY &key)
Definition bslstl_map.h:1249
const_iterator lower_bound(const key_type &key) const
Definition bslstl_map.h:2258
COMPARATOR key_compare
Definition bslstl_map.h:745
Definition bslstl_pair.h:1280
#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_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#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
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
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
TYPE first
Definition bslstl_pair.h:587
Definition bslmf_addlvaluereference.h:128
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
Definition bslalg_hasstliterators.h:99
Definition bslma_usesbslmaallocator.h:344