std::basic_...:get_wrapped(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

Okay so this is the std::basic_osyncstream::get_wrapped page from the C++ Standard Libary manual β€” manual tag std::basic_...:get_wrapped(3). The name is std::basic_osyncstream::get_wrapped β€” std::basic_osyncstream::get_wrapped. It’s giving β€œhand me the wrapped stream buffer, bestie.” πŸ’…


πŸ“œ Synopsis

streambuf_type* get_wrapped() const noexcept;

Returns a pointer to the wrapped std::basic_streambuf, obtained by calling get_wrapped() on the underlying std::basic_syncbuf. Slay. ✨

πŸŽ€ Parameters

(none) β€” literally none, bestie. No args, no stress. 🫢

🌈 Example

Wrapped buffer can be safely wrapped again in a different synchronized output stream. Iconic behavior, honestly. πŸ¦‹

Run this code, bestie 🧚:

#include <iostream>
#include <syncstream>

int main()
{
    std::osyncstream bout1(std::cout);
    bout1 << "Hello, ";
    {
        std::osyncstream(bout1.get_wrapped()) << "Goodbye, " <<
       "Planet!" << '\n';
    } // emits the contents of the temporary buffer
    bout1 << "World!" << '\n';
} // emits the contents of bout1

πŸ’– Output πŸ’–

Output:

Goodbye, Planet!
Hello, World!

πŸ‘‘ See also

  • destructor β€” destroys the basic_osyncstream and emits its internal buffer (public member function)
  • retrieves the wrapped streambuf pointer
  • get_wrapped β€” (public member function of std::basic_syncbuf<CharT,Traits,Allocator>)

mwah πŸ’‹ β€” source: http://cppreference.com Β· version/date: 2024.06.10 Β· manual: std::basic_...:get_wrapped(3) ✨

πŸ“¦ where this page comes from