Difference between revisions of "cpp/named req/OutputIterator"
From cppreference.com
m (Text replace - "{{cpp|" to "{{c|") |
(added link) |
||
Line 2: | Line 2: | ||
{{cpp/concept/sidebar}} | {{cpp/concept/sidebar}} | ||
− | An Iterator that can | + | An {{tt|OutputIterator}} is an {{concept|Iterator}} that can write to the pointed-to element. |
− | + | ||
+ | An example of a class implementing this concept is [[cpp/iterator/ostream_iterator|std::ostream_iterator]]. | ||
===Requirements=== | ===Requirements=== |
Revision as of 07:12, 22 May 2012
Template:cpp/concept/title Template:cpp/concept/sidebar
An OutputIterator
is an Template:concept that can write to the pointed-to element.
An example of a class implementing this concept is std::ostream_iterator.
Requirements
Expression | Return | Equivalent expression | Notes |
---|---|---|---|
*i = o | it may not be possible to write twice in the same iterator | ||
++i | It& | After this, copies of a may be invalidated.Post: &r == &++r | |
i++ | const It& | It temp = i; ++i; |
|
*i++ = o | *i = o; ++i; |