std:: output_iterator
| Iterator concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator primitives | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Algorithm concepts and utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Utilities | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定义于头文件
<iterator>
|
||
|
template
<
class
I,
class
T
>
concept output_iterator
=
|
(C++20 起) | |
output_iterator
概念是对
input_or_output_iterator
的细化,增加了可通过
T
编码的类型和值类别写入数值的要求(通过
indirectly_writable
)。不要求满足
equality_comparable
。
目录 |
语义要求
设
E
为满足
decltype
(
(
E
)
)
等于
T
的表达式,
i
为类型
I
的可解引用对象。仅当
std
::
output_iterator
<
I, T
>
所包含的所有概念均被满足时,该概念才被实现,且
*
i
++
=
E
;
的效果必须等价于
*
i
=
E
;
++
i
;
。
等值保持性
标准库概念的 requires 表达式 中声明的表达式必须满足 等值保持 要求(除非另有说明)。
注释
与
LegacyOutputIterator
要求不同,
output_iterator
概念不要求必须定义迭代器类别标签。
输出迭代器上的算法应当是单遍的。
参见
|
(C++20)
|
指定某个类型的对象可以进行递增和解引用操作
(概念) |