std::vector::at
来自cppreference.com
|
|
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. |
| reference at( size_type pos ); |
||
| const_reference at( size_type pos ) const; |
||
返回一个引用的元素在指定的位置
pos。执行边界检查,将被抛出的异常的类型std::out_of_range,无效的访问.Original:
Returns a reference to the element at specified location
pos. Bounds checking is performed, exception of type std::out_of_range will be thrown on invalid access.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.
目录 |
[编辑] 参数
| pos | - | 该元素的位置返回
Original: position of the element to return 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 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 if !(pos < size()).
[编辑] 复杂性
常数
Original:
Constant
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.
[编辑] 另请参阅
| 访问指定的元素 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. (公共成员函数) | |