Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/memory/raw storage iterator"

From cppreference.com
< cpp‎ | memory
(+)
 
m (desc tweaks)
Line 10: Line 10:
 
{{ddcl list end}}
 
{{ddcl list end}}
  
The output iterator {{tt|std::raw_storage_iterator}} makes it possible for standard algorithms to store results in uninitialized memory. Whenever the algorithm writes an object of type {{tt|T}} to the dereferenced iterator, the object is copy-constructed in the buffer. The template parameter {{tt|OutputIterator}} is any type that satisfied the requirements for output iterator and which has {{cpp|operator*}} defined to return an object, for which {{cpp|operator&}} returns an object of type {{tt|T*}}. Usually, the type {{tt|T*}} is used as {{tt|OutputIterator}}.
+
The output iterator {{tt|std::raw_storage_iterator}} makes it possible for standard algorithms to store results in uninitialized memory. Whenever the algorithm writes an object of type {{tt|T}} to the dereferenced iterator, the object is copy-constructed into the location in the uninitialized storage pointed to by the iterator. The template parameter {{tt|OutputIterator}} is any type that satisfied output iterator requirements and has {{cpp|operator*}} defined to return an object, for which {{cpp|operator&}} returns an object of type {{tt|T*}}. Usually, the type {{tt|T*}} is used as {{tt|OutputIterator}}.
  
 
===Member functions===
 
===Member functions===

Revision as of 12:44, 1 November 2011

Template:cpp/memory/allocator/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <memory>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
template< class OutputIterator, class T >

class raw_storage_iterator

    : public std::iterator<std::output_iterator_tag, void, void, void, void>;
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

The output iterator std::raw_storage_iterator makes it possible for standard algorithms to store results in uninitialized memory. Whenever the algorithm writes an object of type T to the dereferenced iterator, the object is copy-constructed into the location in the uninitialized storage pointed to by the iterator. The template parameter OutputIterator is any type that satisfied output iterator requirements and has Template:cpp defined to return an object, for which Template:cpp returns an object of type T*. Usually, the type T* is used as OutputIterator.

Member functions

creates a new raw_storage_iterator
(public member function)
returns a reference to this raw_storage_iterator
(public member function)
copy-constructs an object at the pointed-to location in the buffer
(public member function)
advances the iterator and returns a reference to the updated iterator
(public member function)
advances the iterator and returns the old value of the iterator
(public member function)

Example

Template:example cpp

See also

Template:cpp/memory/dcl list allocator traitsTemplate:cpp/memory/dcl list scoped allocator adaptorTemplate:cpp/memory/dcl list uses allocator