C++ Iterator Library - output_iterator_tag



Description

It is used to identify the category of an iterator as an output iterator and all output iterators support at least one the following operations.

C++98

property valid expressions
It is a copy-constructible,copy-assignable and destructible

X b(a);

b = a;

It 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
It can be incremented.

++a

a++

*a++ = t

C++11

property valid expressions
It is a copy-constructible, copy-assignable and destructible

X b(a);

b = a;

It 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
It can be incremented.

++a

a++

*a++ = t

Lvalues are swappable. swap(a,b)

Declaration

Following is the declaration for std::output_iterator_tag.

C++11

struct output_iterator_tag {};
iterator.htm
Advertisements