11#ifndef INCLUDED_BSLSTL_MULTIMAP_CPP03
12#define INCLUDED_BSLSTL_MULTIMAP_CPP03
63#ifdef COMPILING_BSLSTL_MULTIMAP_H
88 class COMPARATOR = std::less<KEY>,
89 class ALLOCATOR = allocator<pair<const KEY, VALUE> > >
96 typedef pair<const KEY, VALUE> ValueType;
100 typedef BloombergLP::bslstl::MapComparator<KEY, VALUE, COMPARATOR>
105 typedef BloombergLP::bslstl::TreeNode<ValueType> Node;
109 typedef BloombergLP::bslstl::TreeNodePool<ValueType, ALLOCATOR>
118 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
129 class DataWrapper :
public Comparator {
136 DataWrapper(
const DataWrapper&);
137 DataWrapper& operator=(
const DataWrapper&);
145 DataWrapper(
const COMPARATOR& comparator,
146 const ALLOCATOR& basicAllocator);
154 BloombergLP::bslmf::MovableRef<DataWrapper> original);
160 NodeFactory& nodeFactory();
166 const NodeFactory& nodeFactory()
const;
170 DataWrapper d_compAndAlloc;
174 BloombergLP::bslalg::RbTreeAnchor d_tree;
192 typedef BloombergLP::bslstl::TreeIterator<
value_type,
196 typedef BloombergLP::bslstl::TreeIterator<
const value_type,
211 class value_compare {
273 static Node *toNode(BloombergLP::bslalg::RbTreeNode *node);
278 static const Node *toNode(
const BloombergLP::bslalg::RbTreeNode *node);
284 Comparator& comparator();
288 NodeFactory& nodeFactory();
295 void quickSwapExchangeAllocators(
multimap& other);
303 void quickSwapRetainAllocators(
multimap& other);
309 const Comparator& comparator()
const;
313 const NodeFactory& nodeFactory()
const;
330 explicit multimap(
const COMPARATOR& comparator,
331 const ALLOCATOR& basicAllocator = ALLOCATOR())
332 : d_compAndAlloc(comparator, basicAllocator)
348 explicit multimap(
const ALLOCATOR& basicAllocator);
367 multimap(BloombergLP::bslmf::MovableRef<multimap> original);
392 multimap(BloombergLP::bslmf::MovableRef<multimap> original,
421 template <
class INPUT_ITERATOR>
424 const COMPARATOR& comparator = COMPARATOR(),
425 const ALLOCATOR& basicAllocator = ALLOCATOR());
426 template <
class INPUT_ITERATOR>
429 const ALLOCATOR& basicAllocator);
431#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
432 multimap(std::initializer_list<value_type> values,
433 const COMPARATOR& comparator = COMPARATOR(),
434 const ALLOCATOR& basicAllocator = ALLOCATOR());
453 multimap(std::initializer_list<value_type> values,
454 const ALLOCATOR& basicAllocator);
475 AllocatorTraits::is_always_equal::value &&
476 std::is_nothrow_move_assignable<COMPARATOR>::value);
492#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
533#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
534 template <
class ALT_VALUE_TYPE>
536#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
537 template <
class ALT_VALUE_TYPE>
538 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
550 template <
class ALT_VALUE_TYPE>
551 typename enable_if<std::is_constructible<
value_type,
552 ALT_VALUE_TYPE&&>::value,
576#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
577 template <
class ALT_VALUE_TYPE>
579#elif !defined(BSLS_COMPILERFEATURES_SUPPORT_TRAITS_HEADER)
580 template <
class ALT_VALUE_TYPE>
581 typename enable_if<is_convertible<ALT_VALUE_TYPE, value_type>::value,
597 template <
class ALT_VALUE_TYPE>
598 typename enable_if<std::is_constructible<
value_type,
599 ALT_VALUE_TYPE&&>::value,
623 template <
class INPUT_ITERATOR>
624 void insert(INPUT_ITERATOR first, INPUT_ITERATOR last);
626#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
641#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
647 void insert(std::initializer_list<value_type> values);
650#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
653#ifndef BSLSTL_MULTIMAP_VARIADIC_LIMIT
654#define BSLSTL_MULTIMAP_VARIADIC_LIMIT 2
656#ifndef BSLSTL_MULTIMAP_VARIADIC_LIMIT_A
657#define BSLSTL_MULTIMAP_VARIADIC_LIMIT_A BSLSTL_MULTIMAP_VARIADIC_LIMIT
660#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 0
664#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 1
665 template <
class Args_1>
669#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 2
670 template <
class Args_1,
677#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 0
681#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 1
682 template <
class Args_1>
687#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_A >= 2
688 template <
class Args_1,
699 template <
class... Args>
702 template <
class... Args>
738 AllocatorTraits::is_always_equal::value &&
739 bsl::is_nothrow_swappable<COMPARATOR>::value);
775 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
776 d_tree, this->comparator(), key));
785 template <
class LOOKUP_KEY>
787 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
790 find(
const LOOKUP_KEY& key)
792 return iterator(BloombergLP::bslalg::RbTreeUtil::find(
793 d_tree, this->comparator(), key));
808 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
809 d_tree, this->comparator(), key));
822 template <
class LOOKUP_KEY>
824 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
829 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
830 d_tree, this->comparator(), key));
845 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
846 d_tree, this->comparator(), key));
859 template <
class LOOKUP_KEY>
861 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
866 return iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
867 d_tree, this->comparator(), key));
885 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
902 template <
class LOOKUP_KEY>
904 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
906 pair<iterator, iterator> >::type
911 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
914 return pair<iterator, iterator>(startIt, endIt);
977 template <class LOOKUP_KEY>
978 typename
bsl::enable_if<
979 BloombergLP::
bslmf::IsTransparentPredicate<COMPARATOR,
982 contains(const LOOKUP_KEY& key)
const
1026 d_tree, this->comparator(), key));
1035 template <
class LOOKUP_KEY>
1037 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1040 find(
const LOOKUP_KEY& key)
const
1043 d_tree, this->comparator(), key));
1055 while (it !=
end() && !comparator()(key, *it.node())) {
1066 template <
class LOOKUP_KEY>
1068 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1071 count(
const LOOKUP_KEY& key)
const
1076 while (it !=
end() && !comparator()(key, *it.node())) {
1096 return iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
1097 d_tree, this->comparator(), key));
1111 template <
class LOOKUP_KEY>
1113 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1118 return const_iterator(BloombergLP::bslalg::RbTreeUtil::lowerBound(
1119 d_tree, this->comparator(), key));
1134 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
1135 d_tree, this->comparator(), key));
1148 template <
class LOOKUP_KEY>
1150 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1155 return const_iterator(BloombergLP::bslalg::RbTreeUtil::upperBound(
1156 d_tree, this->comparator(), key));
1174 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
1191 template <
class LOOKUP_KEY>
1193 BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
1195 pair<const_iterator, const_iterator> >::type
1200 if (endIt !=
end() && !comparator()(key, *endIt.node())) {
1203 return pair<const_iterator, const_iterator>(startIt, endIt);
1209#ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
1219 class INPUT_ITERATOR,
1220 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1222 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1223 class COMPARATOR = std::less<KEY>,
1225 BloombergLP::bslstl::IteratorUtil::IterToAlloc_t<INPUT_ITERATOR>>,
1226 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
1227 class = bsl::enable_if_t<
bsl::IsStdAllocator_v<ALLOCATOR>>
1229multimap(INPUT_ITERATOR,
1231 COMPARATOR = COMPARATOR(),
1232 ALLOCATOR = ALLOCATOR())
1233-> multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>;
1242 class INPUT_ITERATOR,
1245 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1247 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1248 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
1249 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1251multimap(INPUT_ITERATOR, INPUT_ITERATOR, COMPARATOR, ALLOC *)
1252-> multimap<KEY, VALUE, COMPARATOR>;
1259 class INPUT_ITERATOR,
1261 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1263 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1264 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1266multimap(INPUT_ITERATOR, INPUT_ITERATOR, ALLOCATOR)
1267-> multimap<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
1274 class INPUT_ITERATOR,
1276 class KEY = BloombergLP::bslstl::IteratorUtil::IterKey_t<INPUT_ITERATOR>,
1278 BloombergLP::bslstl::IteratorUtil::IterMapped_t<INPUT_ITERATOR>,
1279 class DEFAULT_ALLOCATOR = bsl::allocator<pair<const KEY, VALUE>>,
1280 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1282multimap(INPUT_ITERATOR, INPUT_ITERATOR, ALLOC *)
1283-> multimap<KEY, VALUE>;
1294 class COMPARATOR = std::less<KEY>,
1295 class ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1296 class = bsl::enable_if_t<!bsl::IsStdAllocator_v<COMPARATOR>>,
1297 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1299multimap(std::initializer_list<pair<const KEY, VALUE>>,
1300 COMPARATOR = COMPARATOR(),
1301 ALLOCATOR = ALLOCATOR())
1302-> multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>;
1315 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1316 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1318multimap(std::initializer_list<pair<const KEY, VALUE>>, COMPARATOR, ALLOC *)
1319-> multimap<KEY, VALUE, COMPARATOR>;
1331 class = bsl::enable_if_t<bsl::IsStdAllocator_v<ALLOCATOR>>
1333multimap(std::initializer_list<pair<const KEY, VALUE>>, ALLOCATOR)
1334-> multimap<KEY, VALUE, std::less<KEY>, ALLOCATOR>;
1344 class DEFAULT_ALLOCATOR = bsl::allocator<bsl::pair<const KEY, VALUE>>,
1345 class = bsl::enable_if_t<bsl::is_convertible_v<ALLOC *, DEFAULT_ALLOCATOR>>
1347multimap(std::initializer_list<pair<const KEY, VALUE>>, ALLOC *)
1348-> multimap<KEY, VALUE>;
1361template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1362bool operator==(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1363 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1365#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
1366template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1367bool operator!=(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1368 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1379#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
1385template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1386BloombergLP::bslalg::SynthThreeWayUtil::Result<pair<const KEY, VALUE>>
1387operator<=>(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1388 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1392template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1393bool operator<(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1394 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1407template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1408bool operator>(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1409 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1418template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1419bool operator<=(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1420 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1429template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1430bool operator>=(const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
1431 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs);
1461template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1462void
swap(multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& a,
1463 multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& b)
1475template <class KEY, class VALUE, class COMPARATOR, class ALLOCATOR>
1477multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
1478 const COMPARATOR& comparator,
1479 const ALLOCATOR& basicAllocator)
1480:
::bsl::multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(comparator)
1481, d_pool(basicAllocator)
1485template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1487multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::DataWrapper(
1488 BloombergLP::bslmf::MovableRef<DataWrapper> original)
1489: ::
bsl::multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator(
1490 MoveUtil::access(original).keyComparator())
1491, d_pool(MoveUtil::move(MoveUtil::access(original).d_pool))
1496template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1498typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
1499multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
1505template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1507const typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
1508multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::DataWrapper::nodeFactory()
const
1517template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1519multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::value_compare(
1520 COMPARATOR comparator)
1525template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1527bool multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare::operator()(
1528 const value_type& x,
1529 const value_type& y)
const
1531 return comp(x.first, y.first);
1539template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1541typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
1542multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
1544 return d_compAndAlloc;
1547template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1549typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
1550multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
1552 return d_compAndAlloc.nodeFactory();
1555template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1557void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapExchangeAllocators(
1560 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
1561 nodeFactory().swapExchangeAllocators(other.nodeFactory());
1569 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
1570 comparator().swap(other.comparator());
1574template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1576void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::quickSwapRetainAllocators(
1579 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &other.d_tree);
1580 nodeFactory().swapRetainAllocators(other.nodeFactory());
1584 if (
sizeof(NodeFactory) !=
sizeof(DataWrapper)) {
1585 comparator().swap(other.comparator());
1590template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1592const typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::Comparator&
1593multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::comparator()
const
1595 return d_compAndAlloc;
1598template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1600const typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::NodeFactory&
1601multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::nodeFactory()
const
1603 return d_compAndAlloc.nodeFactory();
1607template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1609multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap()
1610: d_compAndAlloc(COMPARATOR(), ALLOCATOR())
1615template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1617multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1618 const ALLOCATOR& basicAllocator)
1619: d_compAndAlloc(COMPARATOR(), basicAllocator)
1624template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1626multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
const multimap& original)
1627: d_compAndAlloc(original.comparator().keyComparator(),
1628 AllocatorTraits::select_on_container_copy_construction(
1629 original.nodeFactory().allocator()))
1632 if (0 < original.size()) {
1633 nodeFactory().reserveNodes(original.size());
1634 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
1640template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1642multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1643 BloombergLP::bslmf::MovableRef<multimap> original)
1644: d_compAndAlloc(MoveUtil::move(MoveUtil::access(original).d_compAndAlloc))
1647 multimap& lvalue = original;
1648 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
1651template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1653multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1654 const multimap& original,
1655 const typename type_identity<ALLOCATOR>::type& basicAllocator)
1656: d_compAndAlloc(original.comparator().keyComparator(), basicAllocator)
1659 if (0 < original.size()) {
1660 nodeFactory().reserveNodes(original.size());
1661 BloombergLP::bslalg::RbTreeUtil::copyTree(&d_tree,
1667template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1669multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1670 BloombergLP::bslmf::MovableRef<multimap> original,
1671 const typename type_identity<ALLOCATOR>::type& basicAllocator)
1672: d_compAndAlloc(MoveUtil::access(original).comparator().keyComparator(),
1676 multimap& lvalue = original;
1679 nodeFactory().allocator() == lvalue.nodeFactory().allocator())) {
1680 d_compAndAlloc.nodeFactory().adopt(
1681 MoveUtil::move(lvalue.d_compAndAlloc.nodeFactory()));
1682 BloombergLP::bslalg::RbTreeUtil::swap(&d_tree, &lvalue.d_tree);
1685 if (0 < lvalue.size()) {
1686 nodeFactory().reserveNodes(lvalue.size());
1687 BloombergLP::bslalg::RbTreeUtil::moveTree(&d_tree,
1690 &lvalue.nodeFactory());
1695template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1696template <
class INPUT_ITERATOR>
1698multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1699 INPUT_ITERATOR first,
1700 INPUT_ITERATOR last,
1701 const COMPARATOR& comparator,
1702 const ALLOCATOR& basicAllocator)
1703: d_compAndAlloc(comparator, basicAllocator)
1706 if (first != last) {
1708 size_type numElements =
1709 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
1711 if (0 < numElements) {
1712 nodeFactory().reserveNodes(numElements);
1715 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
1726 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
1727 while (++first != last) {
1730 const value_type& value = *first;
1731 if (this->comparator()(value.first, *prevNode)) {
1733 insert(++first, last);
1736 BloombergLP::bslalg::RbTreeNode *node =
1737 nodeFactory().emplaceIntoNewNode(value);
1738 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1748template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1749template <
class INPUT_ITERATOR>
1751multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1752 INPUT_ITERATOR first,
1753 INPUT_ITERATOR last,
1754 const ALLOCATOR& basicAllocator)
1755: d_compAndAlloc(COMPARATOR(), basicAllocator)
1758 if (first != last) {
1760 size_type numElements =
1761 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
1763 if (0 < numElements) {
1764 nodeFactory().reserveNodes(numElements);
1767 BloombergLP::bslalg::RbTreeUtilTreeProctor<NodeFactory> proctor(
1778 BloombergLP::bslalg::RbTreeNode *prevNode = d_tree.rootNode();
1779 while (++first != last) {
1782 const value_type& value = *first;
1783 if (this->comparator()(value.first, *prevNode)) {
1785 insert(++first, last);
1788 BloombergLP::bslalg::RbTreeNode *node =
1789 nodeFactory().emplaceIntoNewNode(value);
1790 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1800#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1801template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1803multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1804 std::initializer_list<value_type> values,
1805 const COMPARATOR& comparator,
1806 const ALLOCATOR& basicAllocator)
1807: multimap(values.
begin(), values.
end(), comparator, basicAllocator)
1811template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1813multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::multimap(
1814 std::initializer_list<value_type> values,
1815 const ALLOCATOR& basicAllocator)
1816: multimap(values.
begin(), values.
end(), COMPARATOR(), basicAllocator)
1821template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1823multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::~multimap()
1829template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1831multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>&
1832multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
const multimap& rhs)
1835 if (AllocatorTraits::propagate_on_container_copy_assignment::value) {
1836 multimap other(rhs, rhs.nodeFactory().allocator());
1837 quickSwapExchangeAllocators(other);
1840 multimap other(rhs, nodeFactory().allocator());
1841 quickSwapRetainAllocators(other);
1847template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1849multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>&
1850multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
1851 BloombergLP::bslmf::MovableRef<multimap> rhs)
1853 AllocatorTraits::is_always_equal::value &&
1854 std::is_nothrow_move_assignable<COMPARATOR>::value)
1856 multimap& lvalue = rhs;
1859 if (nodeFactory().allocator() == lvalue.nodeFactory().allocator()) {
1860 multimap other(MoveUtil::move(lvalue));
1861 quickSwapRetainAllocators(other);
1864 AllocatorTraits::propagate_on_container_move_assignment::value) {
1865 multimap other(MoveUtil::move(lvalue));
1866 quickSwapExchangeAllocators(other);
1869 multimap other(MoveUtil::move(lvalue), nodeFactory().allocator());
1870 quickSwapRetainAllocators(other);
1876#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1877template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1879multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>&
1880multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::operator=(
1881 std::initializer_list<value_type> values)
1884 insert(values.begin(), values.end());
1889template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1891typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
1894 return iterator(d_tree.firstNode());
1897template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1899typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
1902 return iterator(d_tree.sentinel());
1905template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1907typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
1910 return reverse_iterator(
end());
1913template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1915typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::reverse_iterator
1918 return reverse_iterator(
begin());
1921template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1923typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
1924multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
const value_type& value)
1928 BloombergLP::bslalg::RbTreeNode *insertLocation =
1929 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(&leftChild,
1934 BloombergLP::bslalg::RbTreeNode *node =
1935 nodeFactory().emplaceIntoNewNode(value);
1937 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
1941 return iterator(node);
1944template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1945template <
class INPUT_ITERATOR>
1947void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(INPUT_ITERATOR first,
1948 INPUT_ITERATOR last)
1958 const bool canCalculateInsertDistance =
1959 is_convertible<
typename
1960 iterator_traits<INPUT_ITERATOR>::iterator_category,
1961 forward_iterator_tag>::value;
1963 while (first != last) {
1964 if (canCalculateInsertDistance
1966 !nodeFactory().hasFreeNodes())) {
1967 const size_type numElements =
1968 BloombergLP::bslstl::IteratorUtil::insertDistance(first, last);
1970 nodeFactory().reserveNodes(numElements);
1977#if defined(BSLS_PLATFORM_CMP_SUN) && BSLS_PLATFORM_CMP_VERSION < 0x5130
1978template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1980void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator first,
1981 const_iterator last)
1983 while (first != last) {
1990template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
1992typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
1993multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(const_iterator hint,
1994 const value_type& value)
1998 BloombergLP::bslalg::RbTreeNode *hintNode =
1999 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2001 BloombergLP::bslalg::RbTreeNode *insertLocation =
2002 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(&leftChild,
2008 BloombergLP::bslalg::RbTreeNode *node =
2009 nodeFactory().emplaceIntoNewNode(value);
2011 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2015 return iterator(node);
2018#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2019template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2021void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::insert(
2022 std::initializer_list<value_type> values)
2024 insert(values.begin(), values.end());
2028#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2031#ifndef BSLSTL_MULTIMAP_VARIADIC_LIMIT
2032#define BSLSTL_MULTIMAP_VARIADIC_LIMIT 2
2034#ifndef BSLSTL_MULTIMAP_VARIADIC_LIMIT_B
2035#define BSLSTL_MULTIMAP_VARIADIC_LIMIT_B BSLSTL_MULTIMAP_VARIADIC_LIMIT
2037#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 0
2038template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2040typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2041multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
2046 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2049 BloombergLP::bslalg::RbTreeNode *insertLocation =
2050 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2054 static_cast<const Node *
>(node)->value().first);
2056 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2060 return iterator(node);
2064#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 1
2065template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2066template <
class Args_1>
2068typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2069multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
2074 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2077 BloombergLP::bslalg::RbTreeNode *insertLocation =
2078 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2082 static_cast<const Node *
>(node)->value().first);
2084 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2088 return iterator(node);
2092#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 2
2093template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2094template <
class Args_1,
2097typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2098multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
2104 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2108 BloombergLP::bslalg::RbTreeNode *insertLocation =
2109 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2113 static_cast<const Node *
>(node)->value().first);
2115 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2119 return iterator(node);
2124#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 0
2125template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2127typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2128multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint)
2132 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2135 BloombergLP::bslalg::RbTreeNode *hintNode =
2136 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2138 BloombergLP::bslalg::RbTreeNode *insertLocation =
2139 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2143 static_cast<const Node *
>(node)->value().first,
2146 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2150 return iterator(node);
2154#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 1
2155template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2156template <
class Args_1>
2158typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2159multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
2164 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2167 BloombergLP::bslalg::RbTreeNode *hintNode =
2168 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2170 BloombergLP::bslalg::RbTreeNode *insertLocation =
2171 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2175 static_cast<const Node *
>(node)->value().first,
2178 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2182 return iterator(node);
2186#if BSLSTL_MULTIMAP_VARIADIC_LIMIT_B >= 2
2187template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2188template <
class Args_1,
2191typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2192multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
2198 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2202 BloombergLP::bslalg::RbTreeNode *hintNode =
2203 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2205 BloombergLP::bslalg::RbTreeNode *insertLocation =
2206 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2210 static_cast<const Node *
>(node)->value().first,
2213 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2217 return iterator(node);
2224template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2225template <
class... Args>
2227typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2228multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace(
2233 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2236 BloombergLP::bslalg::RbTreeNode *insertLocation =
2237 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2241 static_cast<const Node *
>(node)->value().first);
2243 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2247 return iterator(node);
2250template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2251template <
class... Args>
2253typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2254multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::emplace_hint(const_iterator hint,
2259 BloombergLP::bslalg::RbTreeNode *node = nodeFactory().emplaceIntoNewNode(
2262 BloombergLP::bslalg::RbTreeNode *hintNode =
2263 const_cast<BloombergLP::bslalg::RbTreeNode *
>(hint.node());
2265 BloombergLP::bslalg::RbTreeNode *insertLocation =
2266 BloombergLP::bslalg::RbTreeUtil::findInsertLocation(
2270 static_cast<const Node *
>(node)->value().first,
2273 BloombergLP::bslalg::RbTreeUtil::insertAt(&d_tree,
2277 return iterator(node);
2283template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2285typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2286multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator position)
2290 BloombergLP::bslalg::RbTreeNode *node =
2291 const_cast<BloombergLP::bslalg::RbTreeNode *
>(position.node());
2292 BloombergLP::bslalg::RbTreeNode *result =
2293 BloombergLP::bslalg::RbTreeUtil::next(node);
2294 BloombergLP::bslalg::RbTreeUtil::remove(&d_tree, node);
2295 nodeFactory().deleteNode(node);
2296 return iterator(result);
2299template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2301typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2302multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(iterator position)
2304 return erase(const_iterator(position));
2307template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2309typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
2310multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(
const key_type& key)
2312 size_type count = 0;
2313 const_iterator first = find(key);
2315 if (first !=
end()) {
2316 const_iterator last = upper_bound(key);
2317 while (first != last) {
2318 first =
erase(first);
2325template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2327typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::iterator
2328multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::erase(const_iterator first,
2329 const_iterator last)
2331 while (first != last) {
2332 first =
erase(first);
2334 return iterator(last.node());
2337template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2339void multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::swap(multimap& other)
2341 AllocatorTraits::is_always_equal::value &&
2342 bsl::is_nothrow_swappable<COMPARATOR>::value)
2344 if (AllocatorTraits::propagate_on_container_swap::value) {
2345 quickSwapExchangeAllocators(other);
2352 nodeFactory().allocator() == other.nodeFactory().allocator())) {
2353 quickSwapRetainAllocators(other);
2358 multimap toOtherCopy(MoveUtil::move(*
this),
2359 other.nodeFactory().allocator());
2360 multimap toThisCopy( MoveUtil::move(other),
2361 nodeFactory().allocator());
2363 this->quickSwapRetainAllocators(toThisCopy);
2364 other.quickSwapRetainAllocators(toOtherCopy);
2369template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2375 if (d_tree.rootNode()) {
2379 BloombergLP::bslalg::RbTreeUtil::deleteTree(&d_tree, &nodeFactory());
2381#if defined(BSLS_ASSERT_SAFE_IS_USED)
2390template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2392typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::allocator_type
2393multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::get_allocator() const
2396 return nodeFactory().allocator();
2399template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2401typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
2402multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::begin() const
2409template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2411typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
2418template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2420typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
2421multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::rbegin() const
2427template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2429typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
2435template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2437typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
2438multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::cbegin() const
2441 return const_iterator(d_tree.firstNode());
2444template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2446typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_iterator
2449 return const_iterator(d_tree.sentinel());
2452template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2454typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
2455multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::crbegin() const
2458 return const_reverse_iterator(
end());
2461template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2463typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::const_reverse_iterator
2464multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::crend() const
2467 return const_reverse_iterator(
begin());
2470template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2472bool multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::contains(
2473 const key_type& key)
const
2475 return find(key) !=
end();
2479template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2481bool multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::empty() const
2484 return 0 == d_tree.numNodes();
2487template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2489typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
2492 return d_tree.numNodes();
2495template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2497typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::size_type
2498multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::max_size() const
2501 return AllocatorTraits::max_size(get_allocator());
2504template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2506typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_compare
2507multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::key_comp()
const
2509 return comparator().keyComparator();
2512template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2514typename multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_compare
2515multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>::value_comp()
const
2517 return value_compare(key_comp());
2523template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2529 return BloombergLP::bslalg::RangeCompare::equal(lhs.
begin(),
2537#ifndef BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON
2538template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2544 return !(lhs == rhs);
2548#ifdef BSLALG_SYNTHTHREEWAYUTIL_AVAILABLE
2550template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2552BloombergLP::bslalg::SynthThreeWayUtil::Result<bsl::pair<const KEY, VALUE>>
2553bsl::operator<=>(
const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& lhs,
2554 const multimap<KEY, VALUE, COMPARATOR, ALLOCATOR>& rhs)
2556 return bsl::lexicographical_compare_three_way(
2561 BloombergLP::bslalg::SynthThreeWayUtil::compare);
2566template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2572 return 0 > BloombergLP::bslalg::RangeCompare::lexicographical(lhs.
begin(),
2580template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2589template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2595 return !(rhs < lhs);
2599template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2605 return !(lhs < rhs);
2611template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2633template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2634struct HasStlIterators<
bsl::multimap<KEY, VALUE, COMPARATOR, ALLOCATOR> >
2643template <
class KEY,
class VALUE,
class COMPARATOR,
class ALLOCATOR>
2644struct UsesBslmaAllocator<
bsl::multimap<KEY, VALUE, COMPARATOR, ALLOCATOR> >
2653# error Not valid except when included from bslstl_multimap.h
Definition bslma_bslallocator.h:580
COMPARATOR comp
Definition bslstl_multimap.h:793
friend class multimap
Definition bslstl_multimap.h:789
value_compare & operator=(const value_compare &rhs)=default
bool operator()(const value_type &x, const value_type &y) const
Definition bslstl_multimap.h:2075
value_type first_argument_type
Definition bslstl_multimap.h:813
value_compare(COMPARATOR comparator)
Definition bslstl_multimap.h:2067
bool result_type
Definition bslstl_multimap.h:808
value_type second_argument_type
Definition bslstl_multimap.h:818
Definition bslstl_multimap.h:665
void swap(multimap &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:1309
AllocatorTraits::difference_type difference_type
Definition bslstl_multimap.h:763
pair< const KEY, VALUE > value_type
Definition bslstl_multimap.h:756
bool contains(const key_type &key) const
Definition bslstl_multimap.h:2823
bsl::reverse_iterator< const_iterator > const_reverse_iterator
Definition bslstl_multimap.h:776
size_type max_size() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2849
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this multimap.
Definition bslstl_multimap.h:2841
bsl::pair< iterator, iterator > equal_range(const key_type &key)
Definition bslstl_multimap.h:1429
const value_type & const_reference
Definition bslstl_multimap.h:760
COMPARATOR key_compare
Definition bslstl_multimap.h:757
iterator emplace(Args &&... args)
Definition bslstl_multimap.h:2581
AllocatorTraits::const_pointer const_pointer
Definition bslstl_multimap.h:765
AllocatorTraits::size_type size_type
Definition bslstl_multimap.h:762
iterator insert(const value_type &value)
Definition bslstl_multimap.h:2472
BloombergLP::bslstl::TreeIterator< const value_type, Node, difference_type > const_iterator
Definition bslstl_multimap.h:773
const_reverse_iterator crbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2806
iterator erase(const_iterator position)
Definition bslstl_multimap.h:2637
BloombergLP::bslstl::TreeIterator< value_type, Node, difference_type > iterator
Definition bslstl_multimap.h:769
multimap & operator=(const multimap &rhs)
Definition bslstl_multimap.h:2380
bsl::reverse_iterator< iterator > reverse_iterator
Definition bslstl_multimap.h:775
bool empty() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2832
reverse_iterator rbegin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2456
ALLOCATOR allocator_type
Definition bslstl_multimap.h:758
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2744
~multimap()
Destroy this object.
Definition bslstl_multimap.h:2371
AllocatorTraits::pointer pointer
Definition bslstl_multimap.h:764
iterator emplace_hint(const_iterator hint, Args &&... args)
Definition bslstl_multimap.h:2606
value_compare value_comp() const
Definition bslstl_multimap.h:2866
iterator lower_bound(const key_type &key)
Definition bslstl_multimap.h:1354
const_iterator cend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2798
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2448
key_compare key_comp() const
Definition bslstl_multimap.h:2858
const_reverse_iterator crend() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2815
iterator find(const key_type &key)
Definition bslstl_multimap.h:1321
size_type count(const key_type &key) const
Definition bslstl_multimap.h:1598
const_iterator cbegin() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2789
multimap()
Definition bslstl_multimap.h:2157
VALUE mapped_type
Definition bslstl_multimap.h:755
KEY key_type
Definition bslstl_multimap.h:754
iterator upper_bound(const key_type &key)
Definition bslstl_multimap.h:1391
value_type & reference
Definition bslstl_multimap.h:759
reverse_iterator rend() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2464
multimap &operator=(BloombergLP::bslmf::MovableRef< multimap > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_multimap.h:2440
Definition bslstl_pair.h:1210
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
void swap(OptionValue &a, OptionValue &b)
Definition bdlb_printmethods.h:283
void swap(array< VALUE_TYPE, SIZE > &lhs, array< VALUE_TYPE, SIZE > &rhs)
T::const_iterator cend(const T &container)
Definition bslstl_iterator.h:1611
bool operator<(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
T::const_reverse_iterator crbegin(const T &container)
Definition bslstl_iterator.h:1597
bool operator>(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
bool operator>=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
bool operator<=(const array< VALUE_TYPE, SIZE > &lhs, const array< VALUE_TYPE, SIZE > &rhs)
deque< VALUE_TYPE, ALLOCATOR >::size_type erase(deque< VALUE_TYPE, ALLOCATOR > &deq, const BDE_OTHER_TYPE &value)
Definition bslstl_deque.h:4126
T::iterator begin(T &container)
Definition bslstl_iterator.h:1495
bool operator==(const memory_resource &a, const memory_resource &b)
T::const_iterator cbegin(const T &container)
Definition bslstl_iterator.h:1553
T::iterator end(T &container)
Definition bslstl_iterator.h:1523
bool operator!=(const memory_resource &a, const memory_resource &b)
T::const_reverse_iterator crend(const T &container)
Definition bslstl_iterator.h:1654
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdlbb_blob.h:576
Definition bslma_allocatortraits.h:1061
BloombergLP::bslma::AllocatorTraits_ConstPointerType< ALLOCATOR >::type const_pointer
Definition bslma_allocatortraits.h:1152
BloombergLP::bslma::AllocatorTraits_SizeType< ALLOCATOR >::type size_type
Definition bslma_allocatortraits.h:1165
BloombergLP::bslma::AllocatorTraits_PointerType< ALLOCATOR >::type pointer
Definition bslma_allocatortraits.h:1149
BloombergLP::bslma::AllocatorTraits_DifferenceType< ALLOCATOR >::type difference_type
Definition bslma_allocatortraits.h:1162
Definition bslmf_enableif.h:525
Definition bslmf_isconvertible.h:867
t_TYPE type
Definition bslmf_typeidentity.h:216