25
Iterators library
[iterators]
25.3
Iterator requirements
[iterator.requirements]
25.3.4
Iterator concepts
[iterator.concepts]
25.3.4.5
Concept
incrementable
[iterator.concept.inc]
1
#
The
incrementable
concept specifies requirements on types that can be incremented with the pre- and post-increment operators
.
The increment operations are required to be equality-preserving, and the type is required to be
equality_
comparable
.
[
Note
1
:
This supersedes the annotations on the increment expressions in the definition of
weakly_
incrementable
.
—
end note
]
template
<
class
I
>
concept
incrementable
=
regular
<
I
>
&
&
weakly_
incrementable
<
I
>
&
&
requires
(
I i
)
{
{
i
+
+
}
-
>
same_
as
<
I
>
;
}
;
2
#
Let
a
and
b
be incrementable objects of type
I
.
I
models
incrementable
only if:
(2.1)
If
bool
(
a
=
=
b
)
then
bool
(
a
+
+
=
=
b
)
.
(2.2)
If
bool
(
a
=
=
b
)
then
bool
(
(
(
void
)
a
+
+
, a
)
=
=
+
+
b
)
.
3
#
[
Note
2
:
The requirement that
a
equals
b
implies
+
+
a
equals
+
+
b
(which is not true for weakly incrementable types) allows the use of multi-pass one-directional algorithms with types that model
incrementable
.
—
end note
]