...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns a prefix of a constant or mutable buffer sequence.
Defined in header <boost/beast/core/buffers_prefix.hpp>
template< class BufferSequence> buffers_prefix_view< BufferSequence > buffers_prefix( std::size_t size, BufferSequence const& buffers);
The returned buffer sequence points to the same memory as the passed buffer sequence, but with a size that is equal to or smaller. No memory allocations are performed; the resulting sequence is calculated as a lazy range.
Name |
Description |
---|---|
|
The maximum size of the returned buffer sequence in bytes. If this is greater than or equal to the size of the passed buffer sequence, the result will have the same size as the original buffer sequence. |
|
An object whose type meets the requirements of BufferSequence. The returned value will maintain a copy of the passed buffers for its lifetime; however, ownership of the underlying memory is not transferred. |
A constant buffer sequence that represents the prefix of the original buffer sequence. If the original buffer sequence also meets the requirements of MutableBufferSequence, then the returned value will also be a mutable buffer sequence.