Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped

      From cppreference.com
      <cpp‎ |io‎ |basic osyncstream
       
       
       
       
      streambuf_type* get_wrapped()constnoexcept;

      Returns a pointer to the wrappedstd::basic_streambuf, obtained by callingget_wrapped() on the underlyingstd::basic_syncbuf.

      [edit]Parameters

      (none)

      [edit]Example

      Wrapped buffer can be safely wrapped again in a different synchronized 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!

      [edit]See also

      destroys thebasic_osyncstream and emits its internal buffer
      (public member function)[edit]
      retrieves the wrapped streambuf pointer
      (public member function ofstd::basic_syncbuf<CharT,Traits,Allocator>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/basic_osyncstream/get_wrapped&oldid=158554"

      [8]ページ先頭

      ©2009-2026 Movatter.jp