libstdc++: __gnu_cxx::temporary_buffer< _ForwardIterator, _Tp > Struct Template Reference

libstdc++

__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp > Struct Template Reference
Extensions » SGI

`#include <memory>`

Inheritance diagram for __gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >:
[legend]

## Public Types
typedef pointer | iterator
typedef value_type * | pointer
typedef ptrdiff_t | size_type
typedef _Tp | value_type

## Public Member Functions
| temporary_buffer (_ForwardIterator __first, _ForwardIterator __last)
| ~temporary_buffer ()
size_type | _M_requested_size () const
iterator | begin ()
iterator | end ()
size_type | size () const

## Protected Attributes
struct std::_Temporary_buffer::_Impl | _M_impl
size_type | _M_original_len

## Detailed Description

template<class _ForwardIterator, class _Tp = typename std::iterator_traits<_ForwardIterator>::value_type>
struct __gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >

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 188 of file ext/memory.

## Member Typedef Documentation

## ◆ iterator

template<typename _ForwardIterator, typename _Tp>

typedef pointer std::_Temporary_buffer< _ForwardIterator, _Tp >::iterator
| inherited

Definition at line 195 of file stl_tempbuf.h.

## ◆ pointer

template<typename _ForwardIterator, typename _Tp>

typedef value_type* std::_Temporary_buffer< _ForwardIterator, _Tp >::pointer
| inherited

Definition at line 194 of file stl_tempbuf.h.

## ◆ size_type

template<typename _ForwardIterator, typename _Tp>

typedef ptrdiff_t std::_Temporary_buffer< _ForwardIterator, _Tp >::size_type
| inherited

Definition at line 196 of file stl_tempbuf.h.

## ◆ value_type

template<typename _ForwardIterator, typename _Tp>

typedef _Tp std::_Temporary_buffer< _ForwardIterator, _Tp >::value_type
| inherited

Definition at line 193 of file stl_tempbuf.h.

## Constructor & Destructor Documentation

## ◆ temporary_buffer()

template<class _ForwardIterator, class _Tp = typename std::iterator_traits<_ForwardIterator>::value_type>

__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >::temporary_buffer | ( | _ForwardIterator | __first,
|  | _ForwardIterator | __last )
| inline

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

Definition at line 191 of file ext/memory.

References std::_Temporary_buffer< _ForwardIterator, _Tp >::_Temporary_buffer(), and __gnu_cxx::distance().

## ◆ ~temporary_buffer()

template<class _ForwardIterator, class _Tp = typename std::iterator_traits<_ForwardIterator>::value_type>

__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >::~temporary_buffer | ( |  | ) |
| inline

Destroys objects and frees storage.

Definition at line 197 of file ext/memory.

## Member Function Documentation

## ◆ _M_requested_size()

template<typename _ForwardIterator, typename _Tp>

size_type std::_Temporary_buffer< _ForwardIterator, _Tp >::_M_requested_size | ( |  | ) | const
| inlineinherited

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

Definition at line 229 of file stl_tempbuf.h.

## ◆ begin()

template<typename _ForwardIterator, typename _Tp>

iterator std::_Temporary_buffer< _ForwardIterator, _Tp >::begin | ( |  | ) |
| inlineinherited

As per Table mumble.

Definition at line 234 of file stl_tempbuf.h.

Referenced by _Temporary_buffer().

## ◆ end()

template<typename _ForwardIterator, typename _Tp>

iterator std::_Temporary_buffer< _ForwardIterator, _Tp >::end | ( |  | ) |
| inlineinherited

As per Table mumble.

Definition at line 239 of file stl_tempbuf.h.

Referenced by _Temporary_buffer().

## ◆ size()

template<typename _ForwardIterator, typename _Tp>

size_type std::_Temporary_buffer< _ForwardIterator, _Tp >::size | ( |  | ) | const
| inlineinherited

As per Table mumble.

Definition at line 224 of file stl_tempbuf.h.

## Member Data Documentation

## ◆ _M_original_len

template<typename _ForwardIterator, typename _Tp>

size_type std::_Temporary_buffer< _ForwardIterator, _Tp >::_M_original_len
| protectedinherited

Definition at line 199 of file stl_tempbuf.h.

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

- ext/memory