std::unordered_map::at
T& at( const Key& key ); | (1) | (since C++11) |
---|---|---|
const T& at( const Key& key ) const; | (2) | (since C++11) |
返回对元素映射值的引用,其键等价于key
如果不存在这类元素,则为类型的例外。std::out_of_range
被扔了。
参数
key | - | the key of the element to find |
---|
返回值
引用所请求元素的映射值。
例外
std::out_of_range
如果容器没有具有指定key
...
复杂性
平均情况:常量,最坏情况:线性大小。
另见
operator[] | access specified element (public member function) |
---|
? cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com