名前空間
変種
操作

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

提供: cppreference.com
 
 
入出力ライブラリ
入出力マニピュレータ
Cスタイルの入出力
バッファ
(C++98で非推奨)
ストリーム
抽象
ファイル入出力
文字列入出力
配列入出力
(C++98で非推奨)
(C++98で非推奨)
(C++98で非推奨)
同期化出力
エラーカテゴリインタフェース
(C++11)
 
 
streambuf_type* get_wrapped() const noexcept;

ベースとなる std::basic_syncbuf に対して get_wrapped() を呼ぶことによって取得される、ラップされた std::basic_streambuf へのポインタを返します。

[編集] 引数

(なし)

[編集]

ラップされたバッファを別の同期出力ストリームで安全にもう一度ラップできます。

#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 を破棄し、その内部バッファを排出します
(パブリックメンバ関数) [edit]
ラップされた streambuf のポインタを取得します
(std::basic_syncbuf<CharT,Traits,Allocator>のパブリックメンバ関数) [edit]