std::pmr::synchronized_pool_resource::synchronized_pool_resource - cppreference.com

C++ | Compiler support | Freestanding and hosted | Language | Standard library | Standard library headers | Named requirements | Feature test macros | Language support library | Concepts library | Diagnostics library | Memory management library | Metaprogramming library | Containers library | Iterators library | Ranges library | Algorithms library | Strings library | Text processing library | Numerics library | Date and time library | Input/output library | Filesystem library | Concurrency support library | Execution control library | Technical specifications | Symbols index | [edit]

From cppreference.com

synchronized_pool_resource(); (1) (since C++17)explicitsynchronized_pool_resource(std::pmr::memory_resource*upstream); (2) (since C++17)explicitsynchronized_pool_resource(conststd::pmr::pool_options&opts); (3) (since C++17)synchronized_pool_resource(conststd::pmr::pool_options&opts,std::pmr::memory_resource*upstream); (4) (since C++17)synchronized_pool_resource(constsynchronized_pool_resource&)=delete; (5) (since C++17)Constructs a synchronized_pool_resource.

1-4) Constructs a synchronized_pool_resource using the specified upstream memory resource and tuned according to the specified options. The resulting object holds a copy of upstream but does not own the resource to which upstream points.

The overloads not taking opts as a parameter uses a default constructed instance of

pool_options

as the options. The overloads not taking upstream as a parameter uses the return value of

std::pmr::get_default_resource

as the upstream memory resource.

5) Copy constructor is deleted.

Parameters

opts - a

std::pmr::pool_options

struct containing the constructor options upstream - the upstream memory resource to use Exceptions

1-4) Throws only if a call to the allocate() function of the upstream resource throws. It is unspecified if or under what conditions such a call takes place.