__GNU_CXX::TEMPORARY_BUFFER(3cxx)
π NAME π
__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp > β that's the whole name, bestie. This is the 3cxx manual page for it, and yes, we're getting into temporary-buffer lore. π¦
β¨ SYNOPSIS β¨
#include <memory>
Inherits std::_Temporary_buffer< _ForwardIterator, _Tp >. It's giving inherited-container energy, no cap.
π Public Types π
typedef pointer iteratorβ theiteratortypedef, exactly as written.typedef value_type * pointerβ thepointertypedef.typedef ptrdiff_t size_typeβ thesize_typetypedef.typedef _Tp value_typeβ thevalue_typetypedef.
πΈ 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.iterator begin ()β As per Table mumble. The docs said it, not me πiterator end ()β As per Table mumble.size_type requested_size () constβ Returns the size requested by the constructor; may be>size().size_type size () constβ As per Table mumble.
π§ Protected Attributes π§
pointer _M_bufferβ protected attribute, literally this name.size_type _M_lenβ protected attribute.size_type _M_original_lenβ protected attribute.
π₯ Detailed Description π₯
template<class _ForwardIterator, class _Tp = typename
std::iterator_traits<_ForwardIterator>::value_type>
struct __gnu_cxx::temporary_buffer< _ForwardIterator, _Tp >
Okay so this class provides similar behavior and semantics of the standard functions get_temporary_buffer() and return_temporary_buffer(), but it's 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 π
π«Ά 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). Iconic constructor behavior, periodt.
π ~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. Bye, storage π
π Member Function Documentation π
β begin
template<typename _ForwardIterator , typename _Tp > iterator
std::_Temporary_buffer< _ForwardIterator, _Tp >::begin () [inline],
[inherited]
As per Table mumble. That's literally the docs, bestie π
β end
template<typename _ForwardIterator , typename _Tp > iterator
std::_Temporary_buffer< _ForwardIterator, _Tp >::end () [inline],
[inherited]
As per Table mumble.
β requested_size
template<typename _ForwardIterator , typename _Tp > size_type
std::_Temporary_buffer< _ForwardIterator, _Tp >::requested_size () const
[inline], [inherited]
Returns the size requested by the constructor; may be >size().
β size
template<typename _ForwardIterator , typename _Tp > size_type
std::_Temporary_buffer< _ForwardIterator, _Tp >::size () const [inline],
[inherited]
As per Table mumble.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
π Cute sign-off: source/version is libstdc++ on the 3cxx manual, and the original footer doesn't show a date β just truncated page-name energy, so no date to report, bestie π
π¦ where this page comes from
- debian trixie: libstdc++-12-doc 12.4.0-5
- debian trixie: libstdc++-13-doc 13.3.0-16
- ubuntu noble: libstdc++-12-doc 12.3.0-17ubuntu1
- ubuntu noble: libstdc++-12-doc 12.4.0-2ubuntu1~24.04.1
- ubuntu noble: libstdc++-13-doc 13.2.0-23ubuntu4
- ubuntu noble: libstdc++-13-doc 13.3.0-6ubuntu2~24.04.1
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ubuntu questing: libstdc++-12-doc 12.5.0-6ubuntu1
- ubuntu questing: libstdc++-13-doc 13.4.0-4ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms