std::experimental::ranges:: Iterator
| Technical Specification | ||||
| Filesystem library (filesystem TS) | ||||
| Library fundamentals (library fundamentals TS) | ||||
| Library fundamentals 2 (library fundamentals TS v2) | ||||
| Library fundamentals 3 (library fundamentals TS v3) | ||||
| Extensions for parallelism (parallelism TS) | ||||
| Extensions for parallelism 2 (parallelism TS v2) | ||||
| Extensions for concurrency (concurrency TS) | ||||
| Extensions for concurrency 2 (concurrency TS v2) | ||||
| Concepts (concepts TS) | ||||
| Ranges (ranges TS) | ||||
| Reflection (reflection TS) | ||||
| Mathematical special functions (special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
| Iterator concepts | |||||||||||||||||||||||
|
|||||||||||||||||||||||
| Indirect callable concepts | |||||||||||||||||||||||
| Common algorithm requirements | |||||||||||||||||||||||
| Concept utilities | |||||||||||||||||||||||
| Iterator utilities and operations | |||||||||||||||||||||||
| Iterator traits | |||||||||||||||||||||||
| Iterator adaptors | |||||||||||||||||||||||
| Stream iterators | |||||||||||||||||||||||
|
template
<
class
I
>
concept
bool
Iterator
=
|
(ranges TS) | |
Iterator
概念构成了迭代器概念分类体系的基础;每个迭代器都满足
Iterator
要求。
等值保持性
表达式若在给定相等输入时产生相等输出,则称其具有 等值保持性 。
- 表达式的输入由其操作数构成。
- 表达式的输出由其结果及所有被该表达式修改的操作数(如有)构成。
每个要求保持相等性的表达式还必须满足 稳定性 要求:对此类表达式进行两次求值,若输入对象相同,则输出结果必须相等,除非其间显式修改了这些输入对象。
除非另有说明,每个在 要求表达式 中使用的表达式都必须保持相等性且稳定,且该表达式的求值只能修改其非常量操作数。常量操作数不得被修改。
注释
Iterator
本身仅规定了迭代器的解引用和递增操作。大多数算法将需要额外的操作,例如:
-
比较迭代器与哨兵(参见
Sentinel); -
从迭代器读取值(参见
Readable和InputIterator); -
向迭代器写入值(参见
Writable和OutputIterator); -
更丰富的迭代器移动操作(参见
ForwardIterator、BidirectionalIterator、RandomAccessIterator)。
- > auto && 约束意味着解引用操作的结果类型不能是 void 。