---
name: "std::unordered_multimap"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::unordered_multimap/3cxx"
---

# std::unordered\_multimap(3cxx)

A standard container composed of equivalent keys (possibly containing multiple of each key value) that associates values of another type with the keys.

## NAME

std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> - A standard container composed of equivalent keys (possibly containing multiple of each key value) that associates values of another type with the keys.

## SYNOPSIS

`#include <unordered_map>`

### Public Types

**using** **node\_type** = **typename** \_Hashtable::node\_type\

**typedef** \_Hashtable::key\_type **key\_type**\
 Public typedefs.  **typedef** \_Hashtable::value\_type **value\_type**\
 Public typedefs.  **typedef** \_Hashtable::mapped\_type **mapped\_type**\
 Public typedefs.  **typedef** \_Hashtable::hasher **hasher**\
 Public typedefs.  **typedef** \_Hashtable::key\_equal **key\_equal**\
 Public typedefs.  **typedef** \_Hashtable::allocator\_type **allocator\_type**\
 Public typedefs.

**typedef** \_Hashtable::pointer **pointer**\
 Iterator-related typedefs.  **typedef** \_Hashtable::const\_pointer **const\_pointer**\
 Iterator-related typedefs.  **typedef** \_Hashtable::reference **reference**\
 Iterator-related typedefs.  **typedef** \_Hashtable::const\_reference **const\_reference**\
 Iterator-related typedefs.  **typedef** \_Hashtable::iterator **iterator**\
 Iterator-related typedefs.  **typedef** \_Hashtable::const\_iterator **const\_iterator**\
 Iterator-related typedefs.  **typedef** \_Hashtable::local\_iterator **local\_iterator**\
 Iterator-related typedefs.  **typedef** \_Hashtable::const\_local\_iterator **const\_local\_iterator**\
 Iterator-related typedefs.  **typedef** \_Hashtable::size\_type **size\_type**\
 Iterator-related typedefs.  **typedef** \_Hashtable::difference\_type **difference\_type**\
 Iterator-related typedefs.

### Public Member Functions

**unordered\_multimap** ()=**default**\
 Default constructor.  template\<**typename** **\_InputIterator** \> **unordered\_multimap** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last, **size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 template\<**typename** **\_InputIterator** \> **unordered\_multimap** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last, **size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 template\<**typename** **\_InputIterator** \> **unordered\_multimap** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last, **size\_type** \_\_n=0, const **hasher** &**\_\_hf**=**hasher**(), const **key\_equal** &**\_\_eql**=**key\_equal**(), const **allocator\_type** &\_\_a=**allocator\_type**())\
 Builds an unordered\_multimap from a range.  **unordered\_multimap** (const **allocator\_type** &\_\_a)\
 Creates an unordered\_multimap with no elements.  **unordered\_multimap** (const **unordered\_multimap** &)=**default**\
 Copy constructor.  **unordered\_multimap** (const **unordered\_multimap** &**\_\_ummap**, const **allocator\_type** &\_\_a)\
 **unordered\_multimap** (**initializer\_list**\< **value\_type** \> **\_\_l**, **size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 **unordered\_multimap** (**initializer\_list**\< **value\_type** \> **\_\_l**, **size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 **unordered\_multimap** (**initializer\_list**\< **value\_type** \> **\_\_l**, **size\_type** \_\_n=0, const **hasher** &**\_\_hf**=**hasher**(), const **key\_equal** &**\_\_eql**=**key\_equal**(), const **allocator\_type** &\_\_a=**allocator\_type**())\
 Builds an unordered\_multimap from an initializer\_list.  **unordered\_multimap** (**size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 **unordered\_multimap** (**size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 **unordered\_multimap** (**size\_type** \_\_n, const **hasher** &**\_\_hf**=**hasher**(), const **key\_equal** &**\_\_eql**=**key\_equal**(), const **allocator\_type** &\_\_a=**allocator\_type**())\
 Default constructor creates no elements.  **unordered\_multimap** (**unordered\_multimap** &&)=**default**\
 Move constructor.  **unordered\_multimap** (**unordered\_multimap** &&**\_\_ummap**, const **allocator\_type** &\_\_a) noexcept(noexcept(**\_Hashtable**(**std::move**(\_\_ummap.\_M\_h), \_\_a)))\
 **iterator** **begin** () noexcept\
 **local\_iterator** **begin** (**size\_type** \_\_n)\
 Returns a read/write iterator pointing to the first bucket element.  **size\_type** **bucket** (const **key\_type** &**\_\_key**) const\
 **size\_type** **bucket\_count** () const noexcept\
 Returns the number of buckets of the unordered\_multimap.  **size\_type** **bucket\_size** (**size\_type** \_\_n) const\
 **void** **clear** () noexcept\
 template\<typename... \_Args\> **iterator** **emplace** (**\_Args** &&... **\_\_args**)\
 Attempts to build and insert a std::pair into the unordered\_multimap.  template\<typename... \_Args\> **iterator** **emplace\_hint** (**const\_iterator** **\_\_pos**, **\_Args** &&... **\_\_args**)\
 Attempts to build and insert a std::pair into the unordered\_multimap.  bool **empty** () const noexcept\
 Returns true if the unordered\_multimap is empty.  **iterator** **end** () noexcept\
 **local\_iterator** **end** (**size\_type** \_\_n)\
 Returns a read/write iterator pointing to one past the last bucket elements.  **size\_type** **erase** (const **key\_type** &\_\_x)\
 Erases elements according to the provided key.  **iterator** **erase** (**const\_iterator** \_\_first, **const\_iterator** \_\_last)\
 Erases a \[\_\_first,\_\_last) range of elements from an unordered\_multimap.  node\_type **extract** (const **key\_type** &**\_\_key**)\
 Extract a node.  node\_type **extract** (**const\_iterator** **\_\_pos**)\
 Extract a node.  **allocator\_type** **get\_allocator** () const noexcept\
 Returns the allocator object used by the unordered\_multimap.  **hasher** **hash\_function** () const\
 Returns the hash functor object with which the unordered\_multimap was constructed.  template\<**typename** **\_InputIterator** \> **void** **insert** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last)\
 A template function that attempts to insert a range of elements.  **iterator** **insert** (**const\_iterator** **\_\_hint**, node\_type &&**\_\_nh**)\
 Re-insert an extracted node.  **void** **insert** (**initializer\_list**\< **value\_type** \> **\_\_l**)\
 Attempts to insert a list of elements into the unordered\_multimap.  **iterator** **insert** (node\_type &&**\_\_nh**)\
 Re-insert an extracted node.  **key\_equal** **key\_eq** () const\
 Returns the key comparison object with which the unordered\_multimap was constructed.  float **load\_factor** () const noexcept\
 Returns the average number of elements per bucket.  **size\_type** **max\_bucket\_count** () const noexcept\
 Returns the maximum number of buckets of the unordered\_multimap.  float **max\_load\_factor** () const noexcept\
 Returns a positive number that the unordered\_multimap tries to keep the load factor less than or equal to.  **void** **max\_load\_factor** (float **\_\_z**)\
 Change the unordered\_multimap maximum load factor.  **size\_type** **max\_size** () const noexcept\
 Returns the maximum size of the unordered\_multimap.  template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_map**\< **\_Key**, \_Tp, **\_H2**, **\_P2**, \_Alloc \> &&**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_map**\< **\_Key**, \_Tp, **\_H2**, **\_P2**, \_Alloc \> &**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_multimap**\< **\_Key**, \_Tp, **\_H2**, **\_P2**, \_Alloc \> &&**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_multimap**\< **\_Key**, \_Tp, **\_H2**, **\_P2**, \_Alloc \> &**\_\_source**)\
 **unordered\_multimap** & **operator=** (const **unordered\_multimap** &)=**default**\
 Copy assignment operator.  **unordered\_multimap** & **operator=** (**initializer\_list**\< **value\_type** \> **\_\_l**)\
 Unordered\_multimap list assignment operator.  **unordered\_multimap** & **operator=** (**unordered\_multimap** &&)=**default**\
 Move assignment operator.  **void** **rehash** (**size\_type** \_\_n)\
 May rehash the unordered\_multimap.  **void** **reserve** (**size\_type** \_\_n)\
 Prepare the unordered\_multimap for a specified number of elements.  **size\_type** **size** () const noexcept\
 Returns the size of the unordered\_multimap.  **void** **swap** (**unordered\_multimap** &\_\_x) noexcept(noexcept(\_M\_h.swap(\_\_x.\_M\_h)))\
 Swaps data with another unordered\_multimap.

**const\_iterator** **begin** () const noexcept\
 **const\_iterator** **cbegin** () const noexcept\

**const\_iterator** **end** () const noexcept\
 **const\_iterator** **cend** () const noexcept\

**iterator** **insert** (const **value\_type** &\_\_x)\
 Inserts a std::pair into the unordered\_multimap.  **iterator** **insert** (**value\_type** &&\_\_x)\
 Inserts a std::pair into the unordered\_multimap.  template\<**typename** **\_Pair** \> **\_\_enable\_if\_t**\< **is\_constructible**\< **value\_type**, **\_Pair** && \>::value, **iterator** \> **insert** (**\_Pair** &&\_\_x)\
 Inserts a std::pair into the unordered\_multimap.

**iterator** **insert** (**const\_iterator** **\_\_hint**, const **value\_type** &\_\_x)\
 Inserts a std::pair into the unordered\_multimap.  **iterator** **insert** (**const\_iterator** **\_\_hint**, **value\_type** &&\_\_x)\
 Inserts a std::pair into the unordered\_multimap.  template\<**typename** **\_Pair** \> **\_\_enable\_if\_t**\< **is\_constructible**\< **value\_type**, **\_Pair** && \>::value, **iterator** \> **insert** (**const\_iterator** **\_\_hint**, **\_Pair** &&\_\_x)\
 Inserts a std::pair into the unordered\_multimap.

**iterator** **erase** (**const\_iterator** **\_\_position**)\
 Erases an element from an unordered\_multimap.  **iterator** **erase** (**iterator** **\_\_position**)\
 Erases an element from an unordered\_multimap.

**iterator** **find** (const **key\_type** &\_\_x)\
 Tries to locate an element in an unordered\_multimap.  template\<**typename** **\_Kt** \> **auto** **find** (const **\_Kt** &\_\_x) -\> **decltype**(\_M\_h.\_M\_find\_tr(\_\_x))\
 Tries to locate an element in an unordered\_multimap.  **const\_iterator** **find** (const **key\_type** &\_\_x) const\
 Tries to locate an element in an unordered\_multimap.  template\<**typename** **\_Kt** \> **auto** **find** (const **\_Kt** &\_\_x) const -\> **decltype**(\_M\_h.\_M\_find\_tr(\_\_x))\
 Tries to locate an element in an unordered\_multimap.

**size\_type** **count** (const **key\_type** &\_\_x) const\
 Finds the number of elements.  template\<**typename** **\_Kt** \> **auto** **count** (const **\_Kt** &\_\_x) const -\> **decltype**(\_M\_h.\_M\_count\_tr(\_\_x))\
 Finds the number of elements.

bool **contains** (const **key\_type** &\_\_x) const\
 Finds whether an element with the given key exists.  template\<**typename** **\_Kt** \> **auto** **contains** (const **\_Kt** &\_\_x) const -\> **decltype**(\_M\_h.\_M\_find\_tr(\_\_x), **void**(), **true**)\
 Finds whether an element with the given key exists.

**std::pair**\< **iterator**, **iterator** \> **equal\_range** (const **key\_type** &\_\_x)\
 Finds a subsequence matching given key.  template\<**typename** **\_Kt** \> **auto** **equal\_range** (const **\_Kt** &\_\_x) -\> **decltype**(\_M\_h.\_M\_equal\_range\_tr(\_\_x))\
 Finds a subsequence matching given key.  **std::pair**\< **const\_iterator**, **const\_iterator** \> **equal\_range** (const **key\_type** &\_\_x) const\
 Finds a subsequence matching given key.  template\<**typename** **\_Kt** \> **auto** **equal\_range** (const **\_Kt** &\_\_x) const -\> **decltype**(\_M\_h.\_M\_equal\_range\_tr(\_\_x))\
 Finds a subsequence matching given key.

**const\_local\_iterator** **begin** (**size\_type** \_\_n) const\
 Returns a read-only (constant) iterator pointing to the first bucket element.  **const\_local\_iterator** **cbegin** (**size\_type** \_\_n) const\
 Returns a read-only (constant) iterator pointing to the first bucket element.

**const\_local\_iterator** **end** (**size\_type** \_\_n) const\
 Returns a read-only (constant) iterator pointing to one past the last bucket elements.  **const\_local\_iterator** **cend** (**size\_type** \_\_n) const\
 Returns a read-only (constant) iterator pointing to one past the last bucket elements.

### Friends

template\<**typename** **\_Key1** , **typename** **\_Tp1** , **typename** **\_Hash1** , **typename** **\_Pred1** , **typename** \_Alloc1 \> bool **operator==** (const **unordered\_multimap**\< **\_Key1**, **\_Tp1**, **\_Hash1**, **\_Pred1**, \_Alloc1 \> &, const **unordered\_multimap**\< **\_Key1**, **\_Tp1**, **\_Hash1**, **\_Pred1**, \_Alloc1 \> &)\
 template\<**typename** , **typename** , **typename** \> **class** **std::\_Hash\_merge\_helper**\

## Detailed Description

### template\<typename \_Key, typename \_Tp, typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\>

class std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>"A standard container composed of equivalent keys (possibly containing multiple of each key value) that associates values of another type with the keys.

**Since**

C++11

**Template Parameters**

*\_Key* Type of key objects. \
 *\_Tp* Type of mapped objects. \
 *\_Hash* Hashing function object type, defaults to hash\<\_Value\>. \
 *\_Pred* Predicate function object type, defaults to equal\_to\<\_Value\>. \
 *\_Alloc* Allocator type, defaults to std::allocator\<std::pair\<const \_Key, \_Tp\>\>.

Meets the requirements of a `container`, and `unordered associative container`

The resulting value type of the container is std::pair\<const \_Key, \_Tp\>.

Base is \_Hashtable, dispatched at compile time via template alias \_\_ummap\_hashtable.

## Member Typedef Documentation

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::allocator\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::allocator\_type

Public typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::const\_iterator

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::const\_local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::const\_local\_iterator

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::const\_pointer std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::const\_pointer

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::const\_reference std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::const\_reference

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::difference\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::difference\_type

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::hasher std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::hasher

Public typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::iterator

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::key\_equal std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::key\_equal

Public typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::key\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::key\_type

Public typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::local\_iterator

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::mapped\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::mapped\_type

Public typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::pointer std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::pointer

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::reference std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::reference

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::size\_type

Iterator-related typedefs.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> typedef \_Hashtable::value\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::value\_type

Public typedefs.

## Constructor & Destructor Documentation

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap ()` [default]`

Default constructor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (size\_type \_\_n, const hasher & \_\_hf = hasher`()`, const key\_equal & \_\_eql = key\_equal`()`, const allocator\_type & \_\_a = allocator\_type`()`)` [inline]`, ` [explicit]`

Default constructor creates no elements.

**Parameters**

*\_\_n* Mnimal initial number of buckets. \
 *\_\_hf* A hash functor. \
 *\_\_eql* A key equality functor. \
 *\_\_a* An allocator object.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_InputIterator \> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (\_InputIterator \_\_first, \_InputIterator \_\_last, size\_type \_\_n = `0`, const hasher & \_\_hf = hasher`()`, const key\_equal & \_\_eql = key\_equal`()`, const allocator\_type & \_\_a = allocator\_type`()`)` [inline]`

Builds an unordered\_multimap from a range.

**Parameters**

*\_\_first* An input iterator. \
 *\_\_last* An input iterator. \
 *\_\_n* Minimal initial number of buckets. \
 *\_\_hf* A hash functor. \
 *\_\_eql* A key equality functor. \
 *\_\_a* An allocator object.

Create an unordered\_multimap consisting of copies of the elements from \[\_\_first,\_\_last). This is linear in N (where N is distance(\_\_first,\_\_last)).

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (const unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> &)` [default]`

Copy constructor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> &&)` [default]`

Move constructor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (const allocator\_type & \_\_a)` [inline]`, ` [explicit]`

Creates an unordered\_multimap with no elements.

**Parameters**

*\_\_a* An allocator object.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::unordered\_multimap (initializer\_list\< value\_type \> \_\_l, size\_type \_\_n = `0`, const hasher & \_\_hf = hasher`()`, const key\_equal & \_\_eql = key\_equal`()`, const allocator\_type & \_\_a = allocator\_type`()`)` [inline]`

Builds an unordered\_multimap from an initializer\_list.

**Parameters**

*\_\_l* An initializer\_list. \
 *\_\_n* Minimal initial number of buckets. \
 *\_\_hf* A hash functor. \
 *\_\_eql* A key equality functor. \
 *\_\_a* An allocator object.

Create an unordered\_multimap consisting of copies of the elements in the list. This is linear in N (where N is *\_\_l.size()*).

## Member Function Documentation

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::begin () const` [inline]`, ` [noexcept]`

Returns a read-only (constant) iterator that points to the first element in the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::begin ()` [inline]`, ` [noexcept]`

Returns a read/write iterator that points to the first element in the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::begin (size\_type \_\_n)` [inline]`

Returns a read/write iterator pointing to the first bucket element.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read/write local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::begin (size\_type \_\_n) const` [inline]`

Returns a read-only (constant) iterator pointing to the first bucket element.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read-only local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::bucket\_count () const` [inline]`, ` [noexcept]`

Returns the number of buckets of the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::cbegin () const` [inline]`, ` [noexcept]`

Returns a read-only (constant) iterator that points to the first element in the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::cbegin (size\_type \_\_n) const` [inline]`

Returns a read-only (constant) iterator pointing to the first bucket element.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read-only local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::cend () const` [inline]`, ` [noexcept]`

Returns a read-only (constant) iterator that points one past the last element in the unordered\_multimap.

Referenced by **std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::cend (size\_type \_\_n) const` [inline]`

Returns a read-only (constant) iterator pointing to one past the last bucket elements.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read-only local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::clear ()` [inline]`, ` [noexcept]`

Erases all elements in an unordered\_multimap. Note that this function only erases the elements, and that if the elements themselves are pointers, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::contains (const \_Kt & \_\_x) const -\> decltype(\_M\_h.\_M\_find\_tr(\_\_x), void(), true)

	` [inline]`"

Finds whether an element with the given key exists.

**Parameters**

*\_\_x* Key of elements to be located.

**Returns**

True if there is any element with the specified key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> bool std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::contains (const key\_type & \_\_x) const` [inline]`

Finds whether an element with the given key exists.

**Parameters**

*\_\_x* Key of elements to be located.

**Returns**

True if there is any element with the specified key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::count (const \_Kt & \_\_x) const -\> decltype(\_M\_h.\_M\_count\_tr(\_\_x))

	` [inline]`"

Finds the number of elements.

**Parameters**

*\_\_x* Key to count.

**Returns**

Number of elements with specified key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::count (const key\_type & \_\_x) const` [inline]`

Finds the number of elements.

**Parameters**

*\_\_x* Key to count.

**Returns**

Number of elements with specified key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename... \_Args\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::emplace (\_Args &&... \_\_args)` [inline]`

Attempts to build and insert a std::pair into the unordered\_multimap.

**Parameters**

*\_\_args* Arguments used to generate a new pair instance (see std::piecewise\_contruct for passing arguments to each part of the pair constructor).

**Returns**

An iterator that points to the inserted pair.

This function attempts to build and insert a (key, value) pair into the unordered\_multimap.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename... \_Args\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::emplace\_hint (const\_iterator \_\_pos, \_Args &&... \_\_args)` [inline]`

Attempts to build and insert a std::pair into the unordered\_multimap.

**Parameters**

*\_\_pos* An iterator that serves as a hint as to where the pair should be inserted. \
 *\_\_args* Arguments used to generate a new pair instance (see std::piecewise\_contruct for passing arguments to each part of the pair constructor).

**Returns**

An iterator that points to the element with key of the std::pair built from *\_\_args*.

Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert\_hints for more on *hinting*.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> bool std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::empty () const` [inline]`, ` [noexcept]`

Returns true if the unordered\_multimap is empty.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::end () const` [inline]`, ` [noexcept]`

Returns a read-only (constant) iterator that points one past the last element in the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::end ()` [inline]`, ` [noexcept]`

Returns a read/write iterator that points one past the last element in the unordered\_multimap.

Referenced by **std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::extract()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::end (size\_type \_\_n)` [inline]`

Returns a read/write iterator pointing to one past the last bucket elements.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read/write local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_local\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::end (size\_type \_\_n) const` [inline]`

Returns a read-only (constant) iterator pointing to one past the last bucket elements.

**Parameters**

*\_\_n* The bucket index.

**Returns**

A read-only local iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::equal\_range (const \_Kt & \_\_x) -\> decltype(\_M\_h.\_M\_equal\_range\_tr(\_\_x))

	` [inline]`"

Finds a subsequence matching given key.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Pair of iterators that possibly points to the subsequence matching given key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::equal\_range (const \_Kt & \_\_x) const -\> decltype(\_M\_h.\_M\_equal\_range\_tr(\_\_x))

	` [inline]`"

Finds a subsequence matching given key.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Pair of iterators that possibly points to the subsequence matching given key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::pair\< iterator, iterator \> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::equal\_range (const key\_type & \_\_x)` [inline]`

Finds a subsequence matching given key.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Pair of iterators that possibly points to the subsequence matching given key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> std::pair\< const\_iterator, const\_iterator \> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::equal\_range (const key\_type & \_\_x) const` [inline]`

Finds a subsequence matching given key.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Pair of iterators that possibly points to the subsequence matching given key.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::erase (const key\_type & \_\_x)` [inline]`

Erases elements according to the provided key.

**Parameters**

*\_\_x* Key of elements to be erased.

**Returns**

The number of elements erased.

This function erases all the elements located by the given key from an unordered\_multimap. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::erase (const\_iterator \_\_first, const\_iterator \_\_last)` [inline]`

Erases a \[\_\_first,\_\_last) range of elements from an unordered\_multimap.

**Parameters**

*\_\_first* Iterator pointing to the start of the range to be erased. \
 *\_\_last* Iterator pointing to the end of the range to be erased.

**Returns**

The iterator *\_\_last*.

This function erases a sequence of elements from an unordered\_multimap. Note that this function only erases the elements, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::erase (const\_iterator \_\_position)` [inline]`

Erases an element from an unordered\_multimap.

**Parameters**

*\_\_position* An iterator pointing to the element to be erased.

**Returns**

An iterator pointing to the element immediately following *\_\_position* prior to the element being erased. If no such element exists, end() is returned.

This function erases an element, pointed to by the given iterator, from an unordered\_multimap. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::erase (iterator \_\_position)` [inline]`

Erases an element from an unordered\_multimap.

**Parameters**

*\_\_position* An iterator pointing to the element to be erased.

**Returns**

An iterator pointing to the element immediately following *\_\_position* prior to the element being erased. If no such element exists, end() is returned.

This function erases an element, pointed to by the given iterator, from an unordered\_multimap. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way. Managing the pointer is the user's responsibility.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> node\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::extract (const key\_type & \_\_key)` [inline]`

Extract a node.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> node\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::extract (const\_iterator \_\_pos)` [inline]`

Extract a node.

References **std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::end()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::find (const \_Kt & \_\_x) -\> decltype(\_M\_h.\_M\_find\_tr(\_\_x))

	` [inline]`"

Tries to locate an element in an unordered\_multimap.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Iterator pointing to sought-after element, or end() if not found.

This function takes a key and tries to locate the element with which the key matches. If successful the function returns an iterator pointing to the sought after element. If unsuccessful it returns the past-the-end ( `end()` ) iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Kt \> auto std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::find (const \_Kt & \_\_x) const -\> decltype(\_M\_h.\_M\_find\_tr(\_\_x))

	` [inline]`"

Tries to locate an element in an unordered\_multimap.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Iterator pointing to sought-after element, or end() if not found.

This function takes a key and tries to locate the element with which the key matches. If successful the function returns an iterator pointing to the sought after element. If unsuccessful it returns the past-the-end ( `end()` ) iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::find (const key\_type & \_\_x)` [inline]`

Tries to locate an element in an unordered\_multimap.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Iterator pointing to sought-after element, or end() if not found.

This function takes a key and tries to locate the element with which the key matches. If successful the function returns an iterator pointing to the sought after element. If unsuccessful it returns the past-the-end ( `end()` ) iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> const\_iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::find (const key\_type & \_\_x) const` [inline]`

Tries to locate an element in an unordered\_multimap.

**Parameters**

*\_\_x* Key to be located.

**Returns**

Iterator pointing to sought-after element, or end() if not found.

This function takes a key and tries to locate the element with which the key matches. If successful the function returns an iterator pointing to the sought after element. If unsuccessful it returns the past-the-end ( `end()` ) iterator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> allocator\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::get\_allocator () const` [inline]`, ` [noexcept]`

Returns the allocator object used by the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> hasher std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::hash\_function () const` [inline]`

Returns the hash functor object with which the unordered\_multimap was constructed.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_InputIterator \> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (\_InputIterator \_\_first, \_InputIterator \_\_last)` [inline]`

A template function that attempts to insert a range of elements.

**Parameters**

*\_\_first* Iterator pointing to the start of the range to be inserted. \
 *\_\_last* Iterator pointing to the end of the range.

Complexity similar to that of the range constructor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Pair \> \_\_enable\_if\_t\< is\_constructible\< value\_type, \_Pair && \>::value, iterator \> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (\_Pair && \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the inserted pair.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (const value\_type & \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the inserted pair.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> template\<typename \_Pair \> \_\_enable\_if\_t\< is\_constructible\< value\_type, \_Pair && \>::value, iterator \> std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (const\_iterator \_\_hint, \_Pair && \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_hint* An iterator that serves as a hint as to where the pair should be inserted. \
 *\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the element with key of *\_\_x* (may or may not be the pair passed in).

Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert\_hints for more on *hinting*.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (const\_iterator \_\_hint, const value\_type & \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_hint* An iterator that serves as a hint as to where the pair should be inserted. \
 *\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the element with key of *\_\_x* (may or may not be the pair passed in).

Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert\_hints for more on *hinting*.

Insertion requires amortized constant time.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (const\_iterator \_\_hint, node\_type && \_\_nh)` [inline]`

Re-insert an extracted node.

References **std::move()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (const\_iterator \_\_hint, value\_type && \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_hint* An iterator that serves as a hint as to where the pair should be inserted. \
 *\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the element with key of *\_\_x* (may or may not be the pair passed in).

Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.

See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert\_hints for more on *hinting*.

Insertion requires amortized constant time.

References **std::move()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (initializer\_list\< value\_type \> \_\_l)` [inline]`

Attempts to insert a list of elements into the unordered\_multimap.

**Parameters**

*\_\_l* A std::initializer\_list\<value\_type\> of elements to be inserted.

Complexity similar to that of the range constructor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (node\_type && \_\_nh)` [inline]`

Re-insert an extracted node.

References **std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::cend()**, and **std::move()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> iterator std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::insert (value\_type && \_\_x)` [inline]`

Inserts a std::pair into the unordered\_multimap.

**Parameters**

*\_\_x* Pair to be inserted (see std::make\_pair for easy creation of pairs).

**Returns**

An iterator that points to the inserted pair.

Insertion requires amortized constant time.

References **std::move()**.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> key\_equal std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::key\_eq () const` [inline]`

Returns the key comparison object with which the unordered\_multimap was constructed.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> float std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::load\_factor () const` [inline]`, ` [noexcept]`

Returns the average number of elements per bucket.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::max\_bucket\_count () const` [inline]`, ` [noexcept]`

Returns the maximum number of buckets of the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> float std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::max\_load\_factor () const` [inline]`, ` [noexcept]`

Returns a positive number that the unordered\_multimap tries to keep the load factor less than or equal to.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::max\_load\_factor (float \_\_z)` [inline]`

Change the unordered\_multimap maximum load factor.

**Parameters**

*\_\_z* The new maximum load factor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::max\_size () const` [inline]`, ` [noexcept]`

Returns the maximum size of the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> unordered\_multimap & std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::operator= (const unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> &)` [default]`

Copy assignment operator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> unordered\_multimap & std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::operator= (initializer\_list\< value\_type \> \_\_l)` [inline]`

Unordered\_multimap list assignment operator.

**Parameters**

*\_\_l* An initializer\_list.

This function fills an unordered\_multimap with copies of the elements in the initializer list *\_\_l*.

Note that the assignment completely changes the unordered\_multimap and that the resulting unordered\_multimap's size is the same as the number of elements assigned.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> unordered\_multimap & std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::operator= (unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> &&)` [default]`

Move assignment operator.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::rehash (size\_type \_\_n)` [inline]`

May rehash the unordered\_multimap.

**Parameters**

*\_\_n* The new number of buckets.

Rehash will occur only if the new number of buckets respect the unordered\_multimap maximum load factor.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::reserve (size\_type \_\_n)` [inline]`

Prepare the unordered\_multimap for a specified number of elements.

**Parameters**

*\_\_n* Number of elements required.

Same as rehash(ceil(n / max\_load\_factor())).

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> size\_type std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::size () const` [inline]`, ` [noexcept]`

Returns the size of the unordered\_multimap.

### template\<typename \_Key , typename \_Tp , typename \_Hash = hash\<\_Key\>, typename \_Pred = equal\_to\<\_Key\>, typename \_Alloc = allocator\<std::pair\<const \_Key, \_Tp\>\>\> void std::unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \>::swap (unordered\_multimap\< \_Key, \_Tp, \_Hash, \_Pred, \_Alloc \> & \_\_x)` [inline]`, ` [noexcept]`

Swaps data with another unordered\_multimap.

**Parameters**

*\_\_x* An unordered\_multimap of the same element and allocator types.

This exchanges the elements between two unordered\_multimap in constant time. Note that the global std::swap() function is specialized such that std::swap(m1,m2) will feed to this function.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
