std::basic_osyncstream<CharT,Traits,Allocator>:: get_wrapped
From cppreference.net
<
cpp
|
io
|
basic osyncstream
C++
Input/output library
| I/O manipulators | ||||
| Print functions (C++23) | ||||
| C-style I/O | ||||
| Buffers | ||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(C++20)
|
||||
| Streams | ||||
| Abstractions | ||||
| File I/O | ||||
| String I/O | ||||
| Array I/O | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
|
(
C++98/26*
)
|
||||
| Synchronized Output | ||||
|
(C++20)
|
||||
| Types | ||||
| Error category interface | ||||
|
(C++11)
|
||||
|
(C++11)
|
std::basic_osyncstream
| Public member functions | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
basic_osyncstream::get_wrapped
(C++20)
|
||||
|
(C++20)
|
|
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)
|