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 a snapshot of the master branch, built from commit 7789ef3d8d.
PrevUpHomeNext
static_resource::static_resource (4 of 5 overloads)

Constructor.

Synopsis
template<
    std::size_t N>
static_resource(
    std::byte(&) buffer [N]);
Description

This constructs the resource to use the specified buffer for subsequent calls to allocate. When the buffer is exhausted, allocate will throw std::bad_alloc.

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.


PrevUpHomeNext