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)
|