...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Return an output stream that formats values into a DynamicBuffer.
Defined in header <boost/beast/core/ostream.hpp>
template< class DynamicBuffer> implementation-defined ostream( DynamicBuffer& buffer);
This function wraps the caller provided DynamicBuffer
into a std::ostream
derived class, to allow operator<<
stream style formatting operations.
ostream(buffer) << "Hello, world!" << std::endl;
Calling members of the underlying buffer before the output stream is destroyed results in undefined behavior.
Name |
Description |
---|---|
|
An object meeting the requirements of DynamicBuffer into which the formatted output will be placed. |
An object derived from std::ostream
which redirects output The wrapped dynamic buffer is not modified, a copy
is made instead. Ownership of the underlying memory is not transferred, the
application is still responsible for managing its lifetime. The caller is
responsible for ensuring the dynamic buffer is not destroyed for the lifetime
of the output stream.