...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Returns an iterable range representing a buffer sequence.
Defined in header <boost/beast/core/buffers_range.hpp>
template< class BufferSequence> implementation-defined buffers_range( BufferSequence const& buffers);
This function returns an iterable range representing the passed buffer sequence.
The values obtained when iterating the range will be net::const_buffer
,
unless the underlying buffer sequence is a MutableBufferSequence,
in which case the value obtained when iterating will be a net::mutable_buffer
.
The following function returns the total number of bytes in the specified buffer sequence. A copy of the buffer sequence is maintained for the lifetime of the range object:
template <class BufferSequence> std::size_t buffer_sequence_size (BufferSequence const& buffers) { std::size_t size = 0; for (auto const buffer : buffers_range (buffers)) size += buffer.size(); return size; }
Name |
Description |
---|---|
|
The buffer sequence to adapt into a range. The range object returned from this function will contain a copy of the passed buffer sequence. |
An object of unspecified type which meets the requirements of ConstBufferSequence.
If buffers
is a mutable buffer
sequence, the returned object will also meet the requirements of MutableBufferSequence.
Convenience header <boost/beast/core.hpp>