std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped
From cppreference.com
< 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 メンバ関数) |