A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../memory/null_memory_resource.html below:

std::pmr::null_memory_resource - cppreference.com

Returns a pointer to a memory_resource that doesn't perform any allocation.

[edit] Return value

Returns a pointer p to a static storage duration object of a type derived from std::pmr::memory_resource, with the following properties:

The same value is returned every time this function is called.

[edit] Example

The program demos the main usage of null_memory_resource: ensure that a memory pool which requires memory allocated on the stack will NOT allocate memory on the heap if it needs more memory.

Possible output:

size: 50...
size: 100...
size: 150...
std::bad_alloc
size: 183

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4