__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 always
  • typedef value_type * pointer β€” a pointer, but make it value_type
  • typedef ptrdiff_t size_type β€” the size type, iconic
  • typedef _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 her
  • size_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. if size() is less than requested_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