std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped
提供: cppreference.com
<tbody>
</tbody>
streambuf_type* get_wrapped() const noexcept; |
||
ベースとなる std::basic_syncbuf に対して get_wrapped() を呼ぶことによって取得される、ラップされた std::basic_streambuf へのポインタを返します。
引数
(なし)
例
ラップされたバッファを別の同期出力ストリームで安全にもう一度ラップできます。
Run this code
#include <syncstream>
#include <iostream>
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 を破棄し、その内部バッファを排出します (パブリックメンバ関数) | |
| ラップされた streambuf のポインタを取得します ( std::basic_syncbuf<CharT,Traits,Allocator>のパブリックメンバ関数)
|