---
name: "std::unordered_set"
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_set/3cxx"
---

# std::unordered\_set(3cxx)

A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves.

## NAME

std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \> - A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves.

## SYNOPSIS

`#include <unordered_set>`

### Public Types

**using** **insert\_return\_type** = **typename** \_Hashtable::insert\_return\_type\
 **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::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\_set** ()=**default**\
 Default constructor.  template\<**typename** **\_InputIterator** \> **unordered\_set** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last, **size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 template\<**typename** **\_InputIterator** \> **unordered\_set** (**\_InputIterator** \_\_first, **\_InputIterator** \_\_last, **size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 template\<**typename** **\_InputIterator** \> **unordered\_set** (**\_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\_set from a range.  **unordered\_set** (const **allocator\_type** &\_\_a)\
 Creates an unordered\_set with no elements.  **unordered\_set** (const **unordered\_set** &)=**default**\
 Copy constructor.  **unordered\_set** (const **unordered\_set** &**\_\_uset**, const **allocator\_type** &\_\_a)\
 **unordered\_set** (**initializer\_list**\< **value\_type** \> **\_\_l**, **size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 **unordered\_set** (**initializer\_list**\< **value\_type** \> **\_\_l**, **size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 **unordered\_set** (**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\_set from an initializer\_list.  **unordered\_set** (**size\_type** \_\_n, const **allocator\_type** &\_\_a)\
 **unordered\_set** (**size\_type** \_\_n, const **hasher** &**\_\_hf**, const **allocator\_type** &\_\_a)\
 **unordered\_set** (**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\_set** (**unordered\_set** &&)=**default**\
 Move constructor.  **unordered\_set** (**unordered\_set** &&**\_\_uset**, const **allocator\_type** &\_\_a) noexcept(noexcept(**\_Hashtable**(**std::move**(\_\_uset.\_M\_h), \_\_a)))\
 **size\_type** **bucket** (const **key\_type** &**\_\_key**) const\
 **size\_type** **bucket\_count** () const noexcept\
 Returns the number of buckets of the unordered\_set.  **size\_type** **bucket\_size** (**size\_type** \_\_n) const\
 **const\_iterator** **cbegin** () const noexcept\
 **const\_iterator** **cend** () const noexcept\
 **void** **clear** () noexcept\
 template\<typename... \_Args\> **std::pair**\< **iterator**, bool \> **emplace** (**\_Args** &&... **\_\_args**)\
 Attempts to build and insert an element into the unordered\_set.  template\<typename... \_Args\> **iterator** **emplace\_hint** (**const\_iterator** **\_\_pos**, **\_Args** &&... **\_\_args**)\
 Attempts to insert an element into the unordered\_set.  bool **empty** () const noexcept\
 Returns true if the unordered\_set is empty.  **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\_set.  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\_set.  **hasher** **hash\_function** () const\
 Returns the hash functor object with which the unordered\_set 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**, 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\_set.  insert\_return\_type **insert** (node\_type &&**\_\_nh**)\
 Re-insert an extracted node.  **key\_equal** **key\_eq** () const\
 Returns the key comparison object with which the unordered\_set 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\_set.  float **max\_load\_factor** () const noexcept\
 Returns a positive number that the unordered\_set tries to keep the load factor less than or equal to.  **void** **max\_load\_factor** (float **\_\_z**)\
 Change the unordered\_set maximum load factor.  **size\_type** **max\_size** () const noexcept\
 Returns the maximum size of the unordered\_set.  template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_multiset**\< \_Value, **\_H2**, **\_P2**, \_Alloc \> &&**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_multiset**\< \_Value, **\_H2**, **\_P2**, \_Alloc \> &**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_set**\< \_Value, **\_H2**, **\_P2**, \_Alloc \> &&**\_\_source**)\
 template\<**typename** **\_H2** , **typename** **\_P2** \> **void** **merge** (**unordered\_set**\< \_Value, **\_H2**, **\_P2**, \_Alloc \> &**\_\_source**)\
 **unordered\_set** & **operator=** (const **unordered\_set** &)=**default**\
 Copy assignment operator.  **unordered\_set** & **operator=** (**initializer\_list**\< **value\_type** \> **\_\_l**)\
 Unordered\_set list assignment operator.  **unordered\_set** & **operator=** (**unordered\_set** &&)=**default**\
 Move assignment operator.  **void** **rehash** (**size\_type** \_\_n)\
 May rehash the unordered\_set.  **void** **reserve** (**size\_type** \_\_n)\
 Prepare the unordered\_set for a specified number of elements.  **size\_type** **size** () const noexcept\
 Returns the size of the unordered\_set.  **void** **swap** (**unordered\_set** &\_\_x) noexcept(noexcept(\_M\_h.swap(\_\_x.\_M\_h)))\
 Swaps data with another unordered\_set.

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

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

**std::pair**\< **iterator**, bool \> **insert** (const **value\_type** &\_\_x)\
 Attempts to insert an element into the unordered\_set.  **std::pair**\< **iterator**, bool \> **insert** (**value\_type** &&\_\_x)\
 Attempts to insert an element into the unordered\_set.

**iterator** **insert** (**const\_iterator** **\_\_hint**, const **value\_type** &\_\_x)\
 Attempts to insert an element into the unordered\_set.  **iterator** **insert** (**const\_iterator** **\_\_hint**, **value\_type** &&\_\_x)\
 Attempts to insert an element into the unordered\_set.

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

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

**size\_type** **count** (const **key\_type** &\_\_x) const\
 Finds the number of elements.  template\<**typename** **\_Kt** \> **auto** **count** (const **\_Kt** &**\_\_k**) const -\> **decltype**(\_M\_h.\_M\_count\_tr(**\_\_k**))\
 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** &**\_\_k**) const -\> **decltype**(\_M\_h.\_M\_find\_tr(**\_\_k**), **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** &**\_\_k**) -\> **decltype**(\_M\_h.\_M\_equal\_range\_tr(**\_\_k**))\
 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** &**\_\_k**) const -\> **decltype**(\_M\_h.\_M\_equal\_range\_tr(**\_\_k**))\
 Finds a subsequence matching given key.

**local\_iterator** **begin** (**size\_type** \_\_n)\
 Returns a read-only (constant) iterator pointing to the first bucket element.  **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.

**local\_iterator** **end** (**size\_type** \_\_n)\
 Returns a read-only (constant) iterator pointing to one past the last bucket elements.  **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** **\_Value1** , **typename** **\_Hash1** , **typename** **\_Pred1** , **typename** \_Alloc1 \> bool **operator==** (const **unordered\_set**\< **\_Value1**, **\_Hash1**, **\_Pred1**, \_Alloc1 \> &, const **unordered\_set**\< **\_Value1**, **\_Hash1**, **\_Pred1**, \_Alloc1 \> &)\
 template\<**typename** , **typename** , **typename** \> **class** **std::\_Hash\_merge\_helper**\

## Detailed Description

### template\<typename \_Value, typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\>

class std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>"A standard container composed of unique keys (containing at most one of each key value) in which the elements' keys are the elements themselves.

**Since**

C++11

**Template Parameters**

*\_Value* Type of key 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 allocator\<\_Key\>.

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

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

## Member Typedef Documentation

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::allocator\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::allocator\_type

Public typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::const\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::const\_iterator

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::const\_local\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::const\_local\_iterator

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::const\_pointer std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::const\_pointer

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::const\_reference std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::const\_reference

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::difference\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::difference\_type

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::hasher std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::hasher

Public typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::iterator

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::key\_equal std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::key\_equal

Public typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::key\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::key\_type

Public typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::local\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::local\_iterator

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::pointer std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::pointer

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::reference std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::reference

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::size\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::size\_type

Iterator-related typedefs.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> typedef \_Hashtable::value\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::value\_type

Public typedefs.

## Constructor & Destructor Documentation

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::unordered\_set ()` [default]`

Default constructor.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::unordered\_set (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* Minimal initial number of buckets. \
 *\_\_hf* A hash functor. \
 *\_\_eql* A key equality functor. \
 *\_\_a* An allocator object.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_InputIterator \> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::unordered\_set (\_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\_set 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\_set consisting of copies of the elements from \[\_\_first,\_\_last). This is linear in N (where N is distance(\_\_first,\_\_last)).

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

Copy constructor.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::unordered\_set (unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \> &&)` [default]`

Move constructor.

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

Creates an unordered\_set with no elements.

**Parameters**

*\_\_a* An allocator object.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::unordered\_set (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\_set 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\_set consisting of copies of the elements in the list. This is linear in N (where N is *\_\_l.size()*).

## Member Function Documentation

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

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::begin ()` [inline]`, ` [noexcept]`

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> local\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::begin (size\_type \_\_n)` [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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_local\_iterator std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> size\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::bucket\_count () const` [inline]`, ` [noexcept]`

Returns the number of buckets of the unordered\_set.

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

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_local\_iterator std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::cend () const` [inline]`, ` [noexcept]`

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_local\_iterator std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> void std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::clear ()` [inline]`, ` [noexcept]`

Erases all elements in an unordered\_set. 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_Kt \> auto std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::contains (const \_Kt & \_\_k) const -\> decltype(\_M\_h.\_M\_find\_tr(\_\_k), 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> bool std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_Kt \> auto std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::count (const \_Kt & \_\_k) const -\> decltype(\_M\_h.\_M\_count\_tr(\_\_k))

	` [inline]`"

Finds the number of elements.

**Parameters**

*\_\_x* Element to located.

**Returns**

Number of elements with specified key.

This function only makes sense for unordered\_multisets; for unordered\_set the result will either be 0 (not present) or 1 (present).

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

Finds the number of elements.

**Parameters**

*\_\_x* Element to located.

**Returns**

Number of elements with specified key.

This function only makes sense for unordered\_multisets; for unordered\_set the result will either be 0 (not present) or 1 (present).

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

Attempts to build and insert an element into the unordered\_set.

**Parameters**

*\_\_args* Arguments used to generate an element.

**Returns**

A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted.

This function attempts to build and insert an element into the unordered\_set. An unordered\_set relies on unique keys and thus an element is only inserted if it is not already present in the unordered\_set.

Insertion requires amortized constant time.

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

Attempts to insert an element into the unordered\_set.

**Parameters**

*\_\_pos* An iterator that serves as a hint as to where the element should be inserted. \
 *\_\_args* Arguments used to generate the element to be inserted.

**Returns**

An iterator that points to the element with key equivalent to the one generated from *\_\_args* (may or may not be the element itself).

This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single-argument emplace() does. 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.

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

Insertion requires amortized constant time.

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

Returns true if the unordered\_set is empty.

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

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::end ()` [inline]`, ` [noexcept]`

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

Referenced by **std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::extract()**.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> local\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::end (size\_type \_\_n)` [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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_local\_iterator std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_Kt \> auto std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::equal\_range (const \_Kt & \_\_k) -\> decltype(\_M\_h.\_M\_equal\_range\_tr(\_\_k))

	` [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.

This function probably only makes sense for multisets.

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

	` [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.

This function probably only makes sense for multisets.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::pair\< iterator, iterator \> std::unordered\_set\< \_Value, \_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.

This function probably only makes sense for multisets.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::pair\< const\_iterator, const\_iterator \> std::unordered\_set\< \_Value, \_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.

This function probably only makes sense for multisets.

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

Erases elements according to the provided key.

**Parameters**

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

**Returns**

The number of elements erased.

This function erases all the elements located by the given key from an unordered\_set. For an unordered\_set the result of this function can only be 0 (not present) or 1 (present). 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::erase (const\_iterator \_\_first, const\_iterator \_\_last)` [inline]`

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

**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\_set. 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::erase (const\_iterator \_\_position)` [inline]`

Erases an element from an unordered\_set.

**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\_set. 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::erase (iterator \_\_position)` [inline]`

Erases an element from an unordered\_set.

**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\_set. 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> node\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::extract (const key\_type & \_\_key)` [inline]`

Extract a node.

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

Extract a node.

References **std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::end()**.

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

	` [inline]`"

Tries to locate an element in an unordered\_set.

**Parameters**

*\_\_x* Element 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_Kt \> auto std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::find (const \_Kt & \_\_k) const -\> decltype(\_M\_h.\_M\_find\_tr(\_\_k))

	` [inline]`"

Tries to locate an element in an unordered\_set.

**Parameters**

*\_\_x* Element 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::find (const key\_type & \_\_x)` [inline]`

Tries to locate an element in an unordered\_set.

**Parameters**

*\_\_x* Element 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> const\_iterator std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::find (const key\_type & \_\_x) const` [inline]`

Tries to locate an element in an unordered\_set.

**Parameters**

*\_\_x* Element 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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> allocator\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::get\_allocator () const` [inline]`, ` [noexcept]`

Returns the allocator object used by the unordered\_set.

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

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> template\<typename \_InputIterator \> void std::unordered\_set\< \_Value, \_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 \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> std::pair\< iterator, bool \> std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::insert (const value\_type & \_\_x)` [inline]`

Attempts to insert an element into the unordered\_set.

**Parameters**

*\_\_x* Element to be inserted.

**Returns**

A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted.

This function attempts to insert an element into the unordered\_set. An unordered\_set relies on unique keys and thus an element is only inserted if it is not already present in the unordered\_set.

Insertion requires amortized constant time.

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

Attempts to insert an element into the unordered\_set.

**Parameters**

*\_\_hint* An iterator that serves as a hint as to where the element should be inserted. \
 *\_\_x* Element to be inserted.

**Returns**

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

This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single-argument insert() does. 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.

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

Insertion requires amortized constant.

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

Attempts to insert an element into the unordered\_set.

**Parameters**

*\_\_hint* An iterator that serves as a hint as to where the element should be inserted. \
 *\_\_x* Element to be inserted.

**Returns**

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

This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single-argument insert() does. 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.

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

Insertion requires amortized constant.

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

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

Re-insert an extracted node.

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

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

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

**Parameters**

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

Complexity similar to that of the range constructor.

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> insert\_return\_type std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::insert (node\_type && \_\_nh)` [inline]`

Re-insert an extracted node.

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

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

Attempts to insert an element into the unordered\_set.

**Parameters**

*\_\_x* Element to be inserted.

**Returns**

A pair, of which the first element is an iterator that points to the possibly inserted element, and the second is a bool that is true if the element was actually inserted.

This function attempts to insert an element into the unordered\_set. An unordered\_set relies on unique keys and thus an element is only inserted if it is not already present in the unordered\_set.

Insertion requires amortized constant time.

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

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

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

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

Returns the average number of elements per bucket.

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

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

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

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

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

Change the unordered\_set maximum load factor.

**Parameters**

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

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

Returns the maximum size of the unordered\_set.

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

Copy assignment operator.

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

Unordered\_set list assignment operator.

**Parameters**

*\_\_l* An initializer\_list.

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

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

### template\<typename \_Value , typename \_Hash = hash\<\_Value\>, typename \_Pred = equal\_to\<\_Value\>, typename \_Alloc = allocator\<\_Value\>\> unordered\_set & std::unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \>::operator= (unordered\_set\< \_Value, \_Hash, \_Pred, \_Alloc \> &&)` [default]`

Move assignment operator.

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

May rehash the unordered\_set.

**Parameters**

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

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

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

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

**Parameters**

*\_\_n* Number of elements required.

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

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

Returns the size of the unordered\_set.

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

Swaps data with another unordered\_set.

**Parameters**

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

This exchanges the elements between two sets in constant time. Note that the global std::swap() function is specialized such that std::swap(s1,s2) will feed to this function.

## Author

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