The get_wrapped Function

Understand the use of the 'get_wrapped' function with an example.

std::basic_osyncstream syncStream offers two interesting member functions:

  • syncStream.emit() emits all buffered output and executes all pending flushes.
  • syncStream.get_wrapped() returns a pointer to the wrapped buffer.

cppreference.com shows how you can sequence the output of different output streams with the get_wrapped member function.

Get hands-on with 1200+ tech skills courses.