[#absl-btree_multimap] = xref:absl.adoc[absl]::btree_multimap :relfileprefix: ../ :mrdocs: An ordered associative container of keys and associated values that allows equivalent keys. == Synopsis Declared in `<absl/container/btree_map.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Key, typename Value, typename Compare = std::less<Key>, typename Alloc = std::allocator<std::pair<Key const, Value>>> class btree_multimap : public /* implementation-defined */::btree_multimap_container</* implementation-defined */::btree</* implementation-defined */>> ---- == Description An `absl::btree_multimap<K, V>` is an ordered associative container of keys and associated values designed to be a more efficient replacement for `std::multimap` (in most cases). Unlike `absl::btree_map`, a B‐tree multimap allows multiple elements with equivalent keys. Keys are sorted using an (optional) comparison function, which defaults to `std::less<K>`. An `absl::btree_multimap<K, V>` uses a default allocator of `std::allocator<std::pair<const K, V>>` to allocate (and deallocate) nodes, and construct and destruct values within those nodes. You may instead specify a custom allocator `A` (which in turn requires specifying a custom comparator `C`) as in `absl::btree_multimap<K, V, C, A>`. == Base Classes [cols="1,4"] |=== | Name| Description | `/* implementation-defined */::btree_multimap_container</* implementation-defined */::btree</* implementation-defined */>>` | |=== == Type Aliases [cols="1"] |=== | Name | xref:absl/btree_multimap/mapped_type.adoc[`mapped_type`] |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/btree_multimap/2constructor.adoc[`btree_multimap`] [.small]#[constructor]# | Constructs an empty `btree_multimap`. |=== == Using Declarations [cols="1"] |=== | Name | xref:absl/btree_multimap/_10using.adoc[`Unnamed using`] | xref:absl/btree_multimap/begin.adoc[`begin`] | xref:absl/btree_multimap/cbegin.adoc[`cbegin`] | xref:absl/btree_multimap/cend.adoc[`cend`] | xref:absl/btree_multimap/clear.adoc[`clear`] | xref:absl/btree_multimap/contains.adoc[`contains`] | xref:absl/btree_multimap/count.adoc[`count`] | xref:absl/btree_multimap/emplace.adoc[`emplace`] | xref:absl/btree_multimap/emplace_hint.adoc[`emplace_hint`] | xref:absl/btree_multimap/empty.adoc[`empty`] | xref:absl/btree_multimap/end.adoc[`end`] | xref:absl/btree_multimap/equal_range.adoc[`equal_range`] | xref:absl/btree_multimap/erase.adoc[`erase`] | xref:absl/btree_multimap/extract.adoc[`extract`] | xref:absl/btree_multimap/extract_and_get_next.adoc[`extract_and_get_next`] | xref:absl/btree_multimap/find.adoc[`find`] | xref:absl/btree_multimap/get_allocator.adoc[`get_allocator`] | xref:absl/btree_multimap/insert.adoc[`insert`] | xref:absl/btree_multimap/key_comp.adoc[`key_comp`] | xref:absl/btree_multimap/lower_bound.adoc[`lower_bound`] | xref:absl/btree_multimap/max_size.adoc[`max_size`] | xref:absl/btree_multimap/merge.adoc[`merge`] | xref:absl/btree_multimap/size.adoc[`size`] | xref:absl/btree_multimap/swap.adoc[`swap`] | xref:absl/btree_multimap/upper_bound.adoc[`upper_bound`] | xref:absl/btree_multimap/value_comp.adoc[`value_comp`] |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/erase_if-0ff.adoc[`erase_if`] | Erases all elements that satisfy the predicate `pred` from the container. | xref:absl/swap-000.adoc[`swap`] | Swaps the contents of two `absl::btree_multimap` containers. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#