Share via


raw_storage_iterator Class

An adaptor class that is provided to enable algorithms to store their results into uninitialized memory.

For a list of all members of this type, see raw_storage_iterator Members.

template <class OutputIterator, class Type>
class raw_storage_iterator

Parameters

  • OutputIterator
    Specifies the output iterator for the object being stored.

  • Type
    The type of object for which storage is being allocated.

Remarks

The class describes an output iterator that constructs objects of type Type in the sequence it generates. An object of class raw_storage_iterator<ForwardIterator, Type> accesses storage through a forward iterator object, of class ForwardIterator, that you specify when you construct the object. For an object first of class ForwardIterator, the expression &*first must designate unconstructed storage for the next object (of type Type) in the generated sequence.

This adaptor class is used when it is necessary to separate memory allocation and object construction. The raw_storage_iterator can be used to copy objects into uninitialized storage, such as memory allocated using the malloc function.

Requirements

Header: <memory>

Namespace: std

See Also

Reference

Thread Safety in the Standard C++ Library

Other Resources

raw_storage_iterator Members

<memory> Members