nothrow-input-iterator、nothrow-forward-iterator、nothrow-bidirectional-iterator、no-throw-input-range、nothrow-random-access-iterator
提供元 ja.cppreference.net
template< class I >
concept /*nothrow-input-iterator*/ =
std::input_iterator<I> &&
std::is_lvalue_reference_v<std::iter_reference_t<I>> &&
std::same_as<std::remove_cvref_t<std::iter_reference_t<I>>,
std::iter_value_t<I>>;
|
(1) | (説明専用*) |
template< class I >
concept /*nothrow-forward-iterator*/ =
/*nothrow-input-iterator*/<I> &&
std::forward_iterator<I> &&
/*nothrow-sentinel-for*/<I, I>;
|
(2) | (説明専用*) |
template< class I >
concept /*nothrow-bidirectional-iterator*/ =
/*nothrow-forward-iterator*/<I> &&
std::bidirectional_iterator<I>;
|
(3) | (C++26以降) (説明専用*) |
template< class I >
concept /*nothrow-random-access-iterator*/ =
/*nothrow-bidirectional-iterator*/<I> &&
std::random_access_iterator<I> &&
/*nothrow-sized-sentinel-for*/<I, I>;
|
(4) | (C++26以降) (説明専用*) |
これらの説明専用コンセプトは、特殊化された<メモリ>アルゴリズムがイテレータに対して要求する操作から例外が送出されないことを指定します。
/*nothrow-sentinel-for*/ と /*nothrow-sized-sentinel-for*/ の定義については、このページを参照してください。
意味論要件
1) 型
I が nothrow-input-iterator をモデル化するのは、I 型の有効なイテレータに対するインクリメント、コピー構築、ムーブ構築、コピー代入、ムーブ代入、または間接参照から例外が送出されない場合のみです。3) 型
I が nothrow-bidirectional-iterator をモデル化するのは、I 型の有効なイテレータのデクリメントから例外が送出されない場合のみです。4) 型
I が nothrow-random-access-iterator をモデル化するのは、I 型の有効なイテレータの比較、または -、+、-=、+=、[] 演算子が、有効な I 型および std::iter_difference_t<I> 型の値に対して例外を送出しない場合のみです。注記
これらのコンセプトにより、一部のイテレータ操作で例外が送出されることが許可されます。
関連項目
(C++20) |
型が入力イテレータであること、すなわち、その参照先の値を読み取ることができ、前置および後置のインクリメントが両方とも可能であることを指定します (コンセプト) |
(C++20) |
input_iterator が前方向イテレータであり、等値比較とマルチパスをサポートすることを指定します (コンセプト) |
(C++20) |
forward_iterator が双方向イテレータであり、後方への移動をサポートすることを指定します (コンセプト) |
(C++20) |
bidirectional_iterator がランダムアクセスイテレータであり、定数時間での進みと添え字アクセスをサポートすることを指定します (コンセプト) |