boost::capy::MutableBuffer

Type recognized by the library as a buffer (a handle to contiguous memory region) with mutable access to data.

Synopsis

Declared in <boost/capy/buffers.hpp>

template<typename T>
concept MutableBuffer = ConstBuffer<T> && std::convertible_to<T const&, mutable_buffer>;

Semantic Requirements

After the conversion to mutable_buffer or const_buffer b, b.data() and b.size() designate a valid contiguous memory region. The region shall remain valid for the duration of an operation represented by the concept‐constrained function template call.

Function templates in this library constrained by this concept, such as buffer_size, are often noexcept, so if this conversion throws, this results in calling std::terminate().

std::convertible_to implies that mutable_buffer can also be explicitly constructed from T const& with the same effect as the implicit conversion.

See Also