C++ 概念: InputIterator
来自cppreference.com
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
InputIterator是Iterator,可以读取所指向的元素.原文:
An
InputIterator is an Iterator that can read from the pointed-to element.[编辑] 要求
除了上述的要求,一个类型
It是InputIterator,实例a和bIt必须:原文:
In addition to the above requirements, for a type
It to be an InputIterator, instances a and b of It must:| Expression | Return | Equivalent expression | Notes |
|---|---|---|---|
| a != b | bool | !(a == b) | |
| *a | value_type | If a == b equivalent to *b |
|
| a->m | (*a).m | ||
| ++a | It& | After this, copies of a may be invalidated
| |
| a++ | ++a | ||
| *a++ | value_type | value_type t = *a; ++a; |