C++ 概念: OutputIterator
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
OutputIterator是一个Iterator可以写入到指向的元素. 原文:
An
OutputIterator is an Iterator that can write to the pointed-to element. 一个例子的一个类型实现
OutputIterator的std :: ostream_iterator连用.原文:
An example of a type that implements
OutputIterator is 的std :: ostream_iterator连用.当
ForwardIterator,BidirectionalIterator,或RandomAccessIterator满足OutputIterator要求,除了其自身的需求,它被描述为“'可变原文:
When
ForwardIterator, BidirectionalIterator, or RandomAccessIterator satisfies the OutputIterator requirements in addition to its own requirements, it is described as mutable.[编辑] 要求
除上述要求外,类型
ItOutputIterator,实例i和oIt必须:原文:
In addition to the above requirement, for a type
It to be an OutputIterator, instances i and o of It must:| Expression | Return | Equivalent expression | Notes |
|---|---|---|---|
| *i = o | it may not be possible to write twice in the same iterator | ||
| ++i | It& | After this, copies of i may be invalidated.发表'“:&r == &++r
| |
| i++ | const It& | It temp = i; ++i; |
|
| *i++ = o | *i = o; ++i; |