std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped
來自 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 併發出其內部緩衝區(公開成員函式) | |
獲取被包裝的 streambuf 指標 ( std::basic_syncbuf<CharT,Traits,Allocator> 的公開成員函式) |