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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext
buffers_prefix (1 of 3 overloads)

Returns a prefix of a constant buffer.

Synopsis

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

boost::asio::const_buffer
buffers_prefix(
    std::size_t size,
    boost::asio::const_buffer buffer);
Description

The returned buffer points to the same memory as the passed buffer, but with a size that is equal to or less than the size of the original buffer.

Parameters

Name

Description

size

The size of the returned buffer.

buffer

The buffer to shorten. The underlying memory is not modified.

Return Value

A new buffer that points to the first size bytes of the original buffer.

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext