std::experimental::ranges:: ForwardIterator
| 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 | |||||||||||||||||||||||
|
헤더에 정의됨
<experimental/ranges/iterator>
|
||
|
template
<
class
I
>
concept
bool
ForwardIterator
=
|
(ranges TS) | |
ForwardIterator<I>
개념은
InputIterator
에 동등 비교와 다중 패스 보장을 추가하여 정제합니다.
순방향 반복자에 대한
==
연산자의 정의역은 동일한 기본 시퀀스에 대한 반복자들로 구성되지만, 동일한 타입의 값 초기화된 반복자들은 서로 비교될 수 있으며 동등함을 비교해야 합니다.
범위로부터 획득한 포인터와 참조는
[
i
,
s
)
가 계속해서 범위를 나타내는 동안 유효하게 유지되어야 합니다.
a
와
b
가
I
타입의 두 역참조 가능 반복자라고 하자.
ForwardIterator<I>
는 다음 조건을 만족할 때에만 충족된다:
- a == b 는 ++ a == ++ b 를 의미한다; 그리고
-
표현식
(
[
]
(
X x
)
{
++
x
;
}
(
a
)
,
*
a
)
는
*
a
와 동등하다. 즉,
a의 복사본을 증가시켜도a를 역참조한 결과에는 영향을 미치지 않는다.
이것은 multi-pass guarantee (멀티패스 보장)으로 알려져 있습니다.
참고 사항
포워드 반복자는 "스태싱(stashing)"일 수 없습니다: 포워드 반복자 자체 내부의 객체에 대한 참조를 반환할 수 없는데, 그 이유는 그러한 참조들이 포워드 반복자의 파괴로 인해 무효화되기 때문입니다.