![]() |
Home | Libraries | People | FAQ | More |
OutputIterator 輸出迭代器
An output iterator is an iterator that can write a sequence of
values. It is single-pass (old values of the iterator cannot be
re-used), and write-only.
輸出迭代器是一種可以寫出一組值的序列的迭代器。它是單遍的(迭代器的舊值不可重用)和只寫的。
An output iterator represents a position in a (possibly infinite)
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 stated value type of the iterator (should be
void for an output iterator that does not model some other
iterator concept).
迭代器聲明的值類型(對於不符合其它迭代器概念的輸出迭代器,可以為 void)
difference_type
std::iterator_traits<Iter>::difference_type
The difference type of the iterator
迭代器的距離類型
category
std::iterator_traits<Iter>::iterator_category
The category of the iterator
迭代器的類別
i, j
xThe type Iter must be a model of Assignable.
類型 Iter 必須為 可賦值。
The type ValueType must be a model of Assignable.
類型 ValueType 必須為 可賦值。
The type Iter must be a model of DefaultConstructible.
類型 Iter 必須為 可缺省構造。
The type Iter must be a model of EqualityComparable.
類型 Iter 必須為 可等價比較。
category must be derived from std::output_iterator_tag, a model of DefaultConstructible, and a model of CopyConstructible.
difference_type must be a model of SignedInteger.
difference_type 必須為 有符號整數。
| Name 名字 | Expression 表達式 | Type 類型 | Precondition 前置條件 | Semantics 語義 | Postcondition 後置條件 |
|---|---|---|---|---|---|
Dereference 提領 |
*i |
|
|||
Dereference and assign 提領並賦值 |
*i = x |
|
|
||
Preincrement 前緣遞增 |
++i |
Iter & |
|
||
Postincrement 後綴遞增 |
i++ |
|
Equivalent to
|
|
|
Postincrement, dereference, and assign 後綴遞增、提領並賦值 |
*i++ = x |
|
Equivalent to
|
|