| Home | Libraries | People | FAQ | More

##### buffers_adaptor::prepare

Returns a mutable buffer sequence representing writable bytes.

###### Synopsis

    mutable_buffers_type
    prepare(
        std::size_t n);

###### Description

Returns a mutable buffer sequence representing the writable bytes containing exactly `n` bytes of storage. This function does not allocate memory. Instead, the storage comes from the underlying mutable buffer sequence. All buffer sequences previously obtained using `buffers_adaptor::prepare` are invalidated. Buffer sequences previously obtained using `buffers_adaptor::data` remain valid.

###### Parameters

Name | Description
--- | ---
`n` | The desired number of bytes in the returned buffer sequence.

###### Exceptions

Type | Thrown On
--- | ---
`std::length_error` | if `size() + n` exceeds `max_size()`.

###### Exception Safety

Strong guarantee.