![]() |
Home | Libraries | People | FAQ | More |
ForwardIterator 前向迭代器
A forward iterator is an iterator that can read through a sequence of
values. It is multi-pass (old values of the iterator can be
re-used), and can be either mutable (data pointed to by it can be
changed) or not mutable.
前向迭代器是一種可以讀入一組值的序列的迭代器。它是多遍的(迭代器的舊值可以重用),可以是可寫的(所指數據可以改變)或不可寫的。
An iterator represents a position in a sequence. Therefore, the
iterator can point into the sequence (returning a value when dereferenced
and being incrementable), or be off-the-end (and not dereferenceable or
incrementable).
迭代器表示了在一個序列中的某個位置。因此,迭代器可以指向序列內部(在提領時返回一個值且可以遞增),或者指向序列末端之後(不可提領且不可遞
增)
value_type
std::iterator_traits<Iter>::value_type
The value type of the iterator
迭代器的值類型
category
std::iterator_traits<Iter>::iterator_category
The category of the iterator
迭代器的類別
i, j
xcategory must be derived from std::forward_iterator_tag.
category 必須派生自 std::forward_iterator_tag。
| Name 名字 | Expression 表達式 | Type 類型 | Precondition 前置條件 | Semantics 語義 | Postcondition 後置條件 |
|---|---|---|---|---|---|
Dereference 提領 |
*i |
const-if-not-mutable value_type & |
|
||
Member access 成員訪問 |
i->{member-name} (return type is pointer-to-object type)(返回類型為對像指針類型) |
const-if-not-mutable value_type * |
|
||
Preincrement 前綴遞增 |
++i |
Iter & |
|
||
Postincrement 後綴遞增 |
i++ |
Iter |
|
Equivalent to
|
|