asio C++ library

PrevUpHomeNext

buffer (29 of 38 overloads)

Create a new modifiable buffer from a contiguous container.

template<
    typename T>
mutable_buffer buffer(
    T & data,
    constraint_t< is_contiguous_iterator< typename T::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(),
    constraint_t< !is_const< remove_reference_t< typename std::iterator_traits< typename T::iterator >::reference > >::value, defaulted_constraint >  = 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