...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Helper to permit a buffer sequence to be printed to a std::ostream.
Defined in header <boost/beast/core/make_printable.hpp>
template< class ConstBufferSequence> implementation-defined make_printable( ConstBufferSequence const& buffers);
This function is used to wrap a buffer sequence to allow it to be interpreted
as characters and written to a std::ostream
such as std::cout
. No character translation is performed;
unprintable and null characters will be transferred as-is to the output stream.
This function prints the size and contents of a buffer sequence to standard output:
template < class ConstBufferSequence> void print (ConstBufferSequence const & buffers) { std::cout << "Buffer size: " << buffer_bytes(buffers) << " bytes\n" "Buffer data: '" << make_printable(buffers) << "'\n" ; }
Name |
Description |
---|---|
|
An object meeting the requirements of ConstBufferSequence to be streamed. The implementation will make a copy of this object. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime. |