no-throw-input-iterator , no-throw-forward-iterator , no-throw-sentinel-for , no-throw-input-range , no-throw-forward-range
|
template
<
class
I
>
concept no
-
throw
-
input
-
iterator
=
|
(1) | ( 仅用于说明* ) |
|
template
<
class
I
>
concept no
-
throw
-
forward
-
iterator
=
|
(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
=
|
(4) | ( 仅用于说明* ) |
|
template
<
class
R
>
concept no
-
throw
-
forward
-
range
=
|
(5) | ( 仅用于说明* ) |
这些仅用于阐述的概念指明,算法在迭代器、哨兵及范围上所需执行的操作不会抛出异常。
语义要求
与所有标准概念一样,只有当某个概念所包含的所有子概念都被建模时,此处列出的每个概念才被视为已建模。
I
满足
no-throw-input-iterator
模型的前提是:通过有效迭代器进行递增、复制构造、移动构造、复制赋值、移动赋值或解引用操作时不会抛出异常。
S
和
I
仅当在拷贝构造、移动构造、拷贝赋值、移动赋值或类型
I
与
S
的有效值之间的比较操作中不抛出异常时,才满足
no-throw-sentinel-for
概念。
注释
这些概念允许对迭代器和哨兵进行某些操作时抛出异常,例如对无效值的操作。
参见
|
(C++20)
|
指定类型为输入迭代器,即可读取其引用值且支持前置与后置递增操作
(concept) |
|
(C++20)
|
指定
input_iterator
为前向迭代器,支持相等比较和多趟遍历
(concept) |
|
(C++20)
|
指定类型为
input_or_output_iterator
类型的哨兵
(concept) |
|
(C++20)
|
指定迭代器类型满足
input_iterator
的范围
(concept) |
|
(C++20)
|
指定迭代器类型满足
forward_iterator
的范围
(concept) |