A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://en.cppreference.com/w/cpp/io/basic_syncbuf/../basic_osyncstream/get_wrapped.html below:

std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped - cppreference.com

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.

[edit] Parameters

(none)

[edit] Example

Wrapped buffer can be safely wrapped again in a different synchronized output stream.

#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:

Goodbye, Planet!
Hello, World!
[edit] See also destroys the basic_osyncstream and emits its internal buffer
(public member function) [edit] retrieves the wrapped streambuf pointer
(public member function of std::basic_syncbuf<CharT,Traits,Allocator>) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4