libstdc++
__gnu_cxx::temporary_buffer Struct Reference
Inheritance diagram for __gnu_cxx::temporary_buffer:

List of all members.

Public Types

Public Member Functions

Protected Attributes


Detailed Description

This class provides similar behavior and semantics of the standard functions get_temporary_buffer() and return_temporary_buffer(), but encapsulated in a type vaguely resembling a standard container.

By default, a temporary_buffer<Iter> stores space for objects of whatever type the Iter iterator points to. It is constructed from a typical [first,last) range, and provides the begin(), end(), size() functions, as well as requested_size(). For non-trivial types, copies of *first will be used to initialize the storage.

malloc is used to obtain underlying storage.

Like get_temporary_buffer(), not all the requested memory may be available. Ideally, the created buffer will be large enough to hold a copy of [first,last), but if size() is less than requested_size(), then this didn't happen.


Constructor & Destructor Documentation

__gnu_cxx::temporary_buffer::temporary_buffer ( _ForwardIterator  __first,
_ForwardIterator  __last 
) [inline]

Requests storage large enough to hold a copy of [first,last).

Definition at line 187 of file ext/memory.

__gnu_cxx::temporary_buffer::~temporary_buffer ( ) [inline]

Destroys objects and frees storage.

Definition at line 191 of file ext/memory.


Member Function Documentation

iterator std::_Temporary_buffer::begin ( ) [inline, inherited]

As per Table mumble.

Definition at line 152 of file stl_tempbuf.h.

Referenced by std::stable_partition(), std::inplace_merge(), and std::stable_sort().

iterator std::_Temporary_buffer::end ( ) [inline, inherited]

As per Table mumble.

Definition at line 157 of file stl_tempbuf.h.

size_type std::_Temporary_buffer::requested_size ( ) const [inline, inherited]

Returns the size requested by the constructor; may be >size().

Definition at line 147 of file stl_tempbuf.h.

Referenced by std::stable_partition().

size_type std::_Temporary_buffer::size ( ) const [inline, inherited]

As per Table mumble.

Definition at line 142 of file stl_tempbuf.h.

Referenced by std::stable_partition(), std::inplace_merge(), and std::stable_sort().


The documentation for this struct was generated from the following file: