Namespaces
Variants

no-throw-input-iterator , no-throw-forward-iterator , no-throw-sentinel-for , no-throw-input-range , no-throw-forward-range

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(1) ( 仅用于说明* )
template < class I >

concept no - throw - forward - iterator =
no - throw - input - iterator < I > &&
std:: forward_iterator < I > &&

no - throw - sentinel - for < I, I > ;
(2) ( 仅用于说明* )
template < class S, class I >
concept no - throw - sentinel - for = std:: sentinel_for < S, I > ;
(3) ( 仅用于说明* )
template < class R >

concept no - throw - input - range =
ranges:: range < R > &&
no - throw - input - iterator < ranges:: iterator_t < R >> &&

no - throw - sentinel - for < ranges:: sentinel_t < R > , ranges:: iterator_t < R >> ;
(4) ( 仅用于说明* )
template < class R >

concept no - throw - forward - range =
no - throw - input - range < R > &&

no - throw - forward - iterator < ranges:: iterator_t < R >> ;
(5) ( 仅用于说明* )

这些仅用于阐述的概念指明,算法在迭代器、哨兵及范围上所需执行的操作不会抛出异常。

1) no-throw-input-iterator 概念要求解引用迭代器产生左值,类似于 contiguous_iterator LegacyForwardIterator

语义要求

与所有标准概念一样,只有当某个概念所包含的所有子概念都被建模时,此处列出的每个概念才被视为已建模。

1) 类型 I 满足 no-throw-input-iterator 模型的前提是:通过有效迭代器进行递增、复制构造、移动构造、复制赋值、移动赋值或解引用操作时不会抛出异常。
3) 类型 S I 仅当在拷贝构造、移动构造、拷贝赋值、移动赋值或类型 I S 的有效值之间的比较操作中不抛出异常时,才满足 no-throw-sentinel-for 概念。
4) 类型 R 满足 no-throw-input-range 模型的条件是:对 R 类型对象调用 ranges:: begin ranges:: end 时不会抛出任何异常。

注释

这些概念允许对迭代器和哨兵进行某些操作时抛出异常,例如对无效值的操作。

参见

指定类型为输入迭代器,即可读取其引用值且支持前置与后置递增操作
(concept)
指定 input_iterator 为前向迭代器,支持相等比较和多趟遍历
(concept)
指定类型为 input_or_output_iterator 类型的哨兵
(concept)
指定迭代器类型满足 input_iterator 的范围
(concept)
指定迭代器类型满足 forward_iterator 的范围
(concept)