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
basic_flat_buffer::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. Memory may be reallocated as needed. All buffers sequences previously obtained using basic_flat_buffer::data or basic_flat_buffer::prepare become invalid.

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 either max_size() or the allocator's maximum allocation size.

Exception Safety

Strong guarantee.


PrevUpHomeNext