std::experimental::ranges:: Incrementable
| 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
Incrementable
=
|
(ranges TS) | |
概念
Incrementable<I>
规定了可自增类型(通过前置与后置自增运算符)的要求。自增操作(包括
WeaklyIncrementable
所要求的操作)必须保持相等性,且该类型必须满足
EqualityComparable
。
设
a
和
b
为类型
I
的可递增对象。仅当满足以下条件时,
Incrementable<I>
概念成立:
- 如果 bool ( a == b ) 成立,则 bool ( a ++ == b ) 成立。
- 如果 bool ( a == b ) 成立,则 bool ( void ( a ++ ) , a ) == ++ b ) 成立。
等值保持性
表达式若在给定相等输入时产生相等输出,则称其具有 等值保持性 。
- 表达式的输入由其操作数构成。
- 表达式的输出由其结果及所有被该表达式修改的操作数(如有)构成。
每个要求保持相等性的表达式还必须满足 稳定性 要求:对此类表达式进行两次求值时,若输入对象相同且期间未显式修改这些输入对象,则必须获得相等的输出结果。
除非另有说明,在 要求表达式 中使用的每个表达式都必须保持相等性且稳定,且表达式的求值只能修改其非常量操作数。常量操作数不得被修改。
注释
要求
a
等于
b
意味着
++a
等于
++b
,这允许对
Incrementable
类型使用多趟算法。