Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::basic_...:get_wrapped(3) C++ Standard Libarystd::basic_...:get_wrapped(3)

NAME
       std::basic_osyncstream::get_wrapped	   -	     std::basic_osync-
       stream::get_wrapped

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.

Parameters
	  (none)

Example
	  Wrapped  buffer  can be safely wrapped again in a different synchro-
       nized output
	  stream.

       // Run this code

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

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::ba-
       sic_syncbuf<CharT,Traits,Allocator>)

http://cppreference.com		  2024.06.10	 std::basic_...:get_wrapped(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::basic_osyncstream::get_wrapped&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help