man __gnu_cxx::temporary_buffer (Fonctions bibliothèques) -
NAME
__gnu_cxx::temporary_buffer -
SYNOPSIS
Inherits std::Temporary_buffer< ForwardIterator, Type >< ForwardIterator, Type >.
Public Types
typedef Type value_type
typedef value_type * pointer
typedef pointer iterator
typedef ptrdiff_t size_type
Public Member Functions
temporary_buffer (ForwardIterator first, ForwardIterator last)
Requests storage large enough to hold a copy of [first,last).
~temporary_buffer ()
Destroys objects and frees storage.
size_type size () const
As per Table mumble.
size_type requested_size () const
Returns the size requested by the constructor; may be >size().
iterator begin ()
As per Table mumble.
iterator end ()
As per Table mumble.
Protected Member Functions
void M_initialize_buffer (const Type &, __true_type)
void M_initialize_buffer (const Type &val, __false_type)
Protected Attributes
size_type M_original_len
size_type M_len
pointer M_buffer
Detailed Description
template<class ForwardIterator, class Type = typename std::iterator_traits<ForwardIterator>::value_type> struct __gnu_cxx::temporary_buffer< ForwardIterator, Type >
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.
Definition at line 159 of file ext/memory.
Constructor & Destructor Documentation
template<class ForwardIterator, class Type = typename std::iterator_traits<ForwardIterator>::value_type> __gnu_cxx::temporary_buffer< ForwardIterator, Type >::temporary_buffer (ForwardIterator first, ForwardIterator last) [inline]
Requests storage large enough to hold a copy of [first,last).
Definition at line 162 of file ext/memory.
template<class ForwardIterator, class Type = typename std::iterator_traits<ForwardIterator>::value_type> __gnu_cxx::temporary_buffer< ForwardIterator, Type >::~temporary_buffer () [inline]
Destroys objects and frees storage.
Definition at line 166 of file ext/memory.
Member Function Documentation
template<typename ForwardIterator, typename Type> iterator std::Temporary_buffer< ForwardIterator, Type >::begin () [inline, inherited]
As per Table mumble.
Definition at line 112 of file stl_tempbuf.h.
template<typename ForwardIterator, typename Type> iterator std::Temporary_buffer< ForwardIterator, Type >::end () [inline, inherited]
As per Table mumble.
Definition at line 117 of file stl_tempbuf.h.
template<typename ForwardIterator, typename Type> size_type std::Temporary_buffer< ForwardIterator, Type >::requested_size () const [inline, inherited]
Returns the size requested by the constructor; may be >size().
Definition at line 107 of file stl_tempbuf.h.
template<typename ForwardIterator, typename Type> size_type std::Temporary_buffer< ForwardIterator, Type >::size () const [inline, inherited]
As per Table mumble.
Definition at line 102 of file stl_tempbuf.h.
Author
Generated automatically by Doxygen for libstdc++-v3 Source from the source code.