__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 β€” the iterator typedef, exactly as written.
  • typedef value_type * pointer β€” the pointer typedef.
  • typedef ptrdiff_t size_type β€” the size_type typedef.
  • typedef _Tp value_type β€” the value_type typedef.

🌸 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 πŸ’