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 (33 of 42 overloads)

Create a new modifiable buffer from a contiguous container.

template<
    typename T>
mutable_buffer buffer(
    T & data,
    typename constraint< is_contiguous_iterator< typename T::iterator >::value, defaulted_constraint >::type  = defaulted_constraint(),
    typename constraint< !is_convertible< T, const_buffer >::value, defaulted_constraint >::type  = defaulted_constraint(),
    typename constraint< !is_convertible< T, mutable_buffer >::value, defaulted_constraint >::type  = defaulted_constraint(),
    typename constraint< !is_const< typename remove_reference< typename std::iterator_traits< typename T::iterator >::reference >::type >::value, defaulted_constraint >::type  = defaulted_constraint());
Return Value

A mutable_buffer value equivalent to:

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

PrevUpHomeNext