Namespaces
Variants
Views
Actions

std::map::at

From cppreference.com
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 exist, exception of type std::out_of_range is thrown.

Contents

[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 key key

[edit] Complexity

Logarithmic in the size of the container.

[edit] See also

access specified element
(public member function) [edit]