...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Adaptor to progressively trim the front of a BufferSequence.
Defined in header <boost/beast/core/buffers_suffix.hpp>
template< class BufferSequence> class buffers_suffix
Name |
Description |
---|---|
A bidirectional iterator type that may be used to read elements. |
|
The type for each element in the list of buffers. |
Name |
Description |
---|---|
Get a bidirectional iterator to the first element. |
|
buffers_suffix [constructor] |
Constructor. |
Remove bytes from the beginning of the sequence. |
|
Get a bidirectional iterator to one past the last element. |
|
Copy Assignment. |
This adaptor wraps a buffer sequence to create a new sequence which may be incrementally consumed. Bytes consumed are removed from the front of the buffer. The underlying memory is not changed, instead the adaptor efficiently iterates through a subset of the buffers wrapped. The wrapped 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.
Type |
Description |
---|---|
|
The buffer sequence to wrap. |
This function writes the entire contents of a buffer sequence to the specified stream.
template<class SyncWriteStream, class ConstBufferSequence> void send(SyncWriteStream& stream, ConstBufferSequence const& buffers) { buffers_suffix<ConstBufferSequence> bs{buffers}; while(buffer_bytes(bs) > 0) bs.consume(stream.write_some(bs)); }