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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
monotonic_resource::monotonic_resource (3 of 6 overloads)

Constructor.

Synopsis
template<
    std::size_t N>
monotonic_resource(
    unsigned char(&) buffer \[N\],
    storage_ptr upstream = {});
Description

This constructs the resource and indicates that subsequent allocations should use the specified caller-owned buffer. When this buffer is exhausted, dynamic allocations from the upstream resource are made.

This constructor is guaranteed not to perform any dynamic allocations.

Complexity

Constant.

Exception Safety

No-throw guarantee.

Parameters

Name

Description

buffer

The buffer to use. Ownership is not transferred; the caller is responsible for ensuring that the lifetime of the buffer extends until the resource is destroyed.

upstream

An optional upstream memory resource to use for performing internal dynamic allocations. If this parameter is omitted, the default resource is used.


PrevUpHomeNext