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 a snapshot of the master branch, built from commit a8a4da0b3c.
PrevUpHomeNext

buffer (34 of 38 overloads)

Create a new non-modifiable buffer from a contiguous container.

template<
    typename T>
const_buffer buffer(
    const T & data,
    std::size_t max_size_in_bytes,
    constraint_t< is_contiguous_iterator< typename T::const_iterator >::value, defaulted_constraint >  = defaulted_constraint(),
    constraint_t< !is_convertible< T, const_buffer >::value, defaulted_constraint >  = defaulted_constraint(),
    constraint_t< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >  = defaulted_constraint());
Return Value

A const_buffer value equivalent to:

const_buffer(
   data.size() ? &data[0] : 0,
   min(
     data.size() * sizeof(typename T::value_type),
     max_size_in_bytes));

PrevUpHomeNext