std::basic_osyncstream<CharT,Traits,Allocator>:: get_wrapped
From ja.cppreference.net
<
cpp
|
io
|
basic osyncstream
|
streambuf_type
*
get_wrapped
(
)
const
noexcept
;
|
||
ラップされた std::basic_streambuf へのポインタを返します。これは基盤となる std::basic_syncbuf に対して get_wrapped() を呼び出すことで取得されます。
パラメータ
(なし)
例
ラップされたバッファは、異なる同期出力ストリームで安全に再ラップできます。
このコードを実行
#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
出力:
Goodbye, Planet! Hello, World!
関連項目
basic_osyncstreamを破棄し、内部バッファを出力する
(public member function) |
|
|
ラップされたstreambufポインタを取得する
( std::basic_syncbuf<CharT,Traits,Allocator>のpublic member function)
|