__GNU_CXX::TEMPORARY_BUFFER(3)
π __gnu_cxx::temporary_buffer< _ForwardIterator, _Tp > π
okay bestie, welcome to the libstdc++ manual β Library Functions Manual energy, but make it cute. this one's about a lil buffer that's β¨temporaryβ¨ (the name said it, not me).
πΈ NAME πΈ
__gnu_cxx::temporary_buffer< _ForwardIterator, _Tp > β literally the whole vibe is in the name, no notes π
β¨ SYNOPSIS β¨
#include <memory>
Inherits std::_Temporary_buffer< _ForwardIterator, _Tp >. yes she's a nepo baby, and we love that for her π«Ά
π Public Types π
typedef pointer iteratorβ the iterator type, slaying as alwaystypedef value_type * pointerβ a pointer, but make itvalue_typetypedef ptrdiff_t size_typeβ the size type, iconictypedef _Tp value_typeβ the value type. it's_Tp. that's the whole personality
π¦ 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. she's done, she's logging off πsize_type _M_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.size_type size () constβ As per Table mumble.
"As per Table mumble" is not me being silly, bestie, that's the actual text. the docs said mumble and I said periodt. π
π Protected Attributes π
struct std::_Temporary_buffer::_Impl _M_implβ the internal impl, protected, don't touch hersize_type _M_original_lenβ the original length, preserved for the girls and the gays
π 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."
β οΈ lowkey important: you do not always get the memory you asked for. ifsize()is less thanrequested_size(), the universe simply said no. check before you use it, bestie, fr fr.
π₯ Constructor & Destructor Documentation π₯
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).
References std::_Temporary_buffer< _ForwardIterator, _Tp >::_Temporary_buffer(), and __gnu_cxx::distance().
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. cleanup queen π§
π Member Function Documentation π
template<typename _ForwardIterator, typename _Tp> size_type
std::_Temporary_buffer< _ForwardIterator, _Tp >::_M_requested_size ()
const [inline], [inherited]
Returns the size requested by the constructor; may be >size(). so like, what you wanted vs what you got β very "my expectations vs reality" energy π
template<typename _ForwardIterator, typename _Tp> iterator
std::_Temporary_buffer< _ForwardIterator, _Tp >::begin () [inline],
[inherited]
As per Table mumble.
Referenced by _Temporary_buffer().
template<typename _ForwardIterator, typename _Tp> iterator
std::_Temporary_buffer< _ForwardIterator, _Tp >::end () [inline],
[inherited]
As per Table mumble.
Referenced by _Temporary_buffer().
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.
and that's the whole page, bestie π this one came straight out of the libstdc++ manual, generated automatically by Doxygen from the source code β no cap, no date stamp on this one, just vibes and libstdc++ forever. mwah π«Άβ¨
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms