| Home | Libraries | People | FAQ | More

###### static_resource::static_resource (4 of 5 overloads)

Constructor.

<h7> Synopsis </h7>

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

<h7> Description </h7>

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`.

<h7> Complexity </h7>

Constant.

<h7> Exception Safety </h7>

No-throw guarantee.

<h7> Parameters </h7>

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.