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

buffer_bytes

Return the total number of bytes in a buffer or buffer sequence.

Synopsis

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

template<
    class BufferSequence>
std::size_t
buffer_bytes(
    BufferSequence const& buffers);
Description

This function returns the total number of bytes in a buffer, buffer sequence, or object convertible to a buffer. Specifically it may be passed:

This function is designed as an easier-to-use replacement for net::buffer_size. It recognizes customization points found through argument-dependent lookup. The call beast::buffer_bytes(b) is equivalent to performing:

using net::buffer_size;
return buffer_size(b);

In addition this handles types which are convertible to net::const_buffer; these are not handled by net::buffer_size.

Parameters

Name

Description

buffers

The buffer or buffer sequence to calculate the size of.

Return Value

The total number of bytes in the buffer or sequence.


PrevUpHomeNext