std::unordered_map::at
来自cppreference.com
< cpp | container | unordered map
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| T& at( const Key& key ); |
(1) | (C++11 起) |
| const T & at( const Key& key ) const; |
(2) | (C++11 起) |
关键相当于
key的元素,返回一个引用的映射值。如果不存在这样的元素,被抛出的异常类型std::out_of_range.Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| key | - | 找到的元素的键
Original: the key of the element to find The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[编辑] 返回值
所请求的元素的映射值的参考
Original:
Reference to the mapped value of the requested element
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 例外
std::out_of_range如果容器不具有与指定
key的元素Original:
std::out_of_range if the container does not have an element with the specified
keyThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 复杂性
Average case: constant, worst case: linear in size.
[编辑] 另请参阅
| 访问指定的元素 Original: access specified element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (公共成员函数) | |