std::basic_osyncstream<CharT,Traits,Allocator>::get_wrapped
streambuf_type* get_wrapped() const noexcept; |
Возвращает указатель на обёрнутый std::basic_streambuf, полученный вызовом get_wrapped() для нижележащего std::basic_syncbuf.
Параметры
(нет)
Пример
Обёрнутый буфер можно безопасно обернуть ещё раз в другой синхронизированный выходной поток.
#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>) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/io/basic_osyncstream/get_wrapped