nothrow-input-iterator, nothrow-forward-iterator, nothrow-bidirectional-iterator, no-throw-input-range, nothrow-random-access-iterator
From cppreference.com
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) | (exposition only*) |
template< class I >
concept /*nothrow-forward-iterator*/ =
/*nothrow-input-iterator*/<I> &&
std::forward_iterator<I> &&
/*nothrow-sentinel-for*/<I, I>;
|
(2) | (exposition only*) |
template< class I >
concept /*nothrow-bidirectional-iterator*/ =
/*nothrow-forward-iterator*/<I> &&
std::bidirectional_iterator<I>;
|
(3) | (since C++26) (exposition only*) |
template< class I >
concept /*nothrow-random-access-iterator*/ =
/*nothrow-bidirectional-iterator*/<I> &&
std::random_access_iterator<I> &&
/*nothrow-sized-sentinel-for*/<I, I>;
|
(4) | (since C++26) (exposition only*) |
These exposition-only concepts specify that no exceptions are thrown from operations required by the specialized <memory> algorithms on iterators.
For the definitions of /*nothrow-sentinel-for*/ and /*nothrow-sized-sentinel-for*/, see this page.
Semantic requirements
1) A type
I models nothrow-input-iterator only if no exceptions are thrown from increment, copy construction, move construction, copy assignment, move assignment, or indirection through valid iterators of type I.3) A type
I models nothrow-bidirectional-iterator only if no exceptions are thrown from decrementing valid iterators of type I.4) A type
I models nothrow-random-access-iterator only if no exceptions are thrown from comparisons of valid iterators of type I, or the -, +, -=, +=, [] operators on valid values of type I and std::iter_difference_t<I>.Notes
These concepts allow some operations on iterators to throw exceptions.
See also
(C++20) |
specifies that a type is an input iterator, that is, its referenced values can be read and it can be both pre- and post-incremented (concept) |
(C++20) |
specifies that an input_iterator is a forward iterator, supporting equality comparison and multi-pass (concept) |
(C++20) |
specifies that a forward_iterator is a bidirectional iterator, supporting movement backwards (concept) |
(C++20) |
specifies that a bidirectional_iterator is a random-access iterator, supporting advancement in constant time and subscripting (concept) |