std::map::at

std::map::at

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.

Parameters

key - the key of the element to find

Return value

Reference to the mapped value of the requested element.

Exceptions

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

Complexity

Logarithmic in the size of the container.

See also

access specified element
(public member function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/container/map/at

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部