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 <syncstream> #include <iostream> int main() { std::osyncstream bout1(std::cout); bout1 << "Hello, "; { std::osyncstream(bout1.get_wrapped()) << "Goodbye, " << "Planet!" << '\n'; } // 发射临时缓冲的内容 bout1 << "World!" << '\n'; } // 发射 bout1 的内容
输出:
Goodbye, Planet! Hello, World!
参阅
  销毁 basic_osyncstream 并发射它的内部缓冲区 (公开成员函数)  | |
|   获得被包装的 streambuf 指针  ( std::basic_syncbuf<CharT,Traits,Allocator> 的公开成员函数)  |