Member Where defined Description
raw_storage_iterator(ForwardIterator x) raw_storage_iterator See below.
raw_storage_iterator(const raw_storage_iterator&) trivial iterator The copy constructor
raw_storage_iterator& operator=(const raw_storage_iterator&) trivial iterator The assignment operator
raw_storage_iterator& operator*() Output Iterator Used to implement the output iterator expression *i = x. [2]
raw_storage_iterator& operator=(const Sequence::value_type&) Output Iterator Used to implement the output iterator expression *i = x. [2]
raw_storage_iterator& operator++() Output Iterator Preincrement.
raw_storage_iterator& operator++(int) Output Iterator Postincrement.
output_iterator_tag iterator_category(const raw_storage_iterator&) iterator tags Returns the iterator's category. This is a global function, not a member.
New members

These members are not defined in the Output Iterator requirements, but are specific to raw_storage_iterator.

Function Description
raw_storage_iterator(ForwardIterator i) Creates a raw_storage_iterator whose underlying iterator is i.
raw_storage_iterator& operator=(const T& val) Constructs an object of ForwardIterator's value type at the location pointed to by the iterator, using val as the constructor's argument.
Notes

[1] In particular, this sort of low-level memory management is used in the implementation of some container classes.

[2] Note how assignment through a raw_storage_iterator is implemented. In general, unary operator* must be defined so that it returns a proxy object, where the proxy object defines operator= to perform the insert operation. In this case, for the sake of simplicity, the proxy object is the raw_storage_iterator itself. That is, *i returns i, and *i = t is equivalent to i = t . You should not, however, rely on this behavior. It is an implementation detail, and it is not guaranteed to remain the same in future versions.

See also

Allocators, construct, destroy, uninitialized_copy uninitialized_fill, uninitialized_fill_n

sequence_buffer<Container, buf_sz>

Categories: iterators, adaptors

Component type: type

Description

Sequence_buffer is similar to back_insert_iterator: it is an output iterator adaptor that appends elements to the end of a container.

The main difference between sequence_buffer and back_insert_iterator is that back_insert_iterator inserts elements into a sequence one element at a time; sequence_buffer, however, as the 'buffer' part of the name suggests, accumulates elements into a buffer and appends the entire buffer in a single operation.

Specifically, the expression *it = v adds v to the end of it's internal buffer. The buffer is automatically flushed when it gets full, or when

Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату