std::unordered_map::at - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::unordered_map::at

From cppreference.com
< cpp‎ | container‎ | unordered map

[edit template]

T& at( const Key& key ); | (1) | (since C++11)
const T& at( const Key& key ) const; | (2) | (since C++11)

Returns a reference to the mapped value of the element with key equivalent to `key`. If no such element exists, an exception of type std::out_of_range is thrown.

### [edit] Parameters

key | - | the key of the element to find

### [edit] Return value

Reference to the mapped value of the requested element

### [edit] Exceptions

std::out_of_range if the container does not have an element with the specified `key`

### [edit] Complexity

Average case: constant, worst case: linear in size.

### [edit] See also

operator[] | access specified element (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/container/unordered_map/at&oldid=50679"