...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Type alias for the underlying buffer type of a list of buffer sequence types.
Defined in header <boost/beast/core/buffer_traits.hpp>
template< class... BufferSequence> using buffers_type = see-below;
This metafunction is used to determine the underlying buffer type for a list of buffer sequence. The equivalent type of the alias will vary depending on the template type argument:
net::mutable_buffer
,
otherwise
net::const_buffer
.
The following code returns the first buffer in a buffer sequence, or generates a compilation error if the argument is not a buffer sequence:
template < class BufferSequence> buffers_type <BufferSequence> buffers_front (BufferSequence const & buffers) { static_assert ( net::is_const_buffer_sequence<BufferSequence>::value, "BufferSequence type requirements not met" ); auto const first = net::buffer_sequence_begin (buffers); if (first == net::buffer_sequence_end (buffers)) return {}; return *first; }
Type |
Description |
---|---|
|
A list of zero or more types to check. If this list is empty, the
resulting type alias will be |