A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/iterator/OutputIterator/ below:

class

<iterator>

std::output_iterator_tag
struct output_iterator_tag {};

Output iterator category

Empty class to identify the category of an iterator as an output iterator:

Output iterators


Output iterators are iterators that can be used in sequential output operations, where each element pointed by the iterator is written a value only once and then the iterator is incremented.

All forward, bidirectional and random-access iterators that are not constant iterators are also valid output iterators.

There is not a single type of output iterator: Each container may define its own specific iterator type able to iterate through it and access its elements. But all output iterators support -at least- the following operations:

property valid expressions Is copy-constructible, copy-assignable and destructible X b(a);
b = a;
Can be dereferenced as an lvalue (if in a dereferenceable state).
It shall only be dereferenced as the left-side of an assignment statement.
Once dereferenced, its iterator value may no longer be dereferenceable. *a = t Can be incremented. ++a
a++
*a++ = t
property valid expressions Is copy-constructible, copy-assignable and destructible X b(a);
b = a;
Can be dereferenced as an lvalue (if in a dereferenceable state).
It shall only be dereferenced as the left-side of an assignment statement.
Once dereferenced, its iterator value may no longer be dereferenceable. *a = t Can be incremented. ++a
a++
*a++ = t
Lvalues are swappable. swap(a,b)


Where X is an output iterator type, a and b are objects of this iterator type, and t is an object of the type pointed by the iterator type (or some other type that can be assigned to the lvalue returned by dereferencing an object of type X).

Algorithms requiring output iterators should be single-pass output algorithms: each iterator position is dereferenced once at most.



See also
input_iterator_tag
Input iterator category (class)
forward_iterator_tag
Forward iterator category (class)
bidirectional_iterator_tag
Bidirectional iterator category (class)
random_access_iterator_tag
Random-access iterator category (class)
iterator
Iterator base class (class template)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4