std::map::at

From Cppreference

Jump to: navigation, search
T& at( const Key& key );
(1) (C++11 feature)
T& at( Key&& key );
(2) (C++11 feature)

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

[edit] See also

operator[]
access specified element
(public member function)