Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

buffers_type

Type alias for the underlying buffer type of a list of buffer sequence types.

Synopsis

Defined in header <boost/beast/core/buffer_traits.hpp>

template<
    class... BufferSequence>
using buffers_type = see-below;
Description

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:

Example

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;
}
Template Parameters

Type

Description

BufferSequence

A list of zero or more types to check. If this list is empty, the resulting type alias will be net::mutable_buffer.

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext