std::array::at
reference at( size_type pos ); | | (until C++17) |
|---|---|---|
constexpr reference at( size_type pos ); | | (since C++17) |
const_reference at( size_type pos ) const; | | (until C++14) |
constexpr const_reference at( size_type pos ) const; | | (since C++14) |
返回对指定位置的元素的引用。pos,进行边界检查。
如果pos不在容器的范围内,是类型的例外。std::out_of_range被扔了。
参数
pos | - | position of the element to return |
|---|
返回值
引用请求的元素。
例外
std::out_of_range如果!(pos < size())...
复杂性
常量。
另见
operator[] | access specified element (public member function) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

