名前空間
変種
操作

std::array<T,N>::at

提供: cppreference.com
< cpp‎ | container‎ | array
 
 
 
 
reference at( size_type pos );
(C++17未満)
constexpr reference at( size_type pos );
(C++17以上)
const_reference at( size_type pos ) const;
(C++14未満)
constexpr const_reference at( size_type pos ) const;
(C++14以上)

境界チェック付きで、指定された位置 pos の要素への参照を返します。

pos がコンテナの範囲内でなければ std::out_of_range 型の例外が投げられます。

目次

[編集] 引数

pos - 返す要素の位置

[編集] 戻り値

要求された要素への参照。

[編集] 例外

!(pos < size()) の場合 std::out_of_range

[編集] 計算量

一定。

[編集] 関連項目

指定された要素にアクセスします
(パブリックメンバ関数) [edit]