Difference between revisions of "cpp/experimental/synchronized pool resource/synchronized pool resource"
From cppreference.com
(+) |
Andreas Krug (Talk | contribs) m (fmt, {{c}}) |
||
(3 intermediate revisions by one user not shown) | |||
Line 2: | Line 2: | ||
{{cpp/experimental/lib extensions/pmr/synchronized_pool_resource/navbar}} | {{cpp/experimental/lib extensions/pmr/synchronized_pool_resource/navbar}} | ||
{{dcl begin}} | {{dcl begin}} | ||
− | {{dcl|since=libfund_ts | num= 1| 1= | + | {{dcl|since=libfund_ts|num=1|1= |
synchronized_pool_resource(); | synchronized_pool_resource(); | ||
}} | }} | ||
− | {{dcl|since=libfund_ts | num= 2| 1= | + | {{dcl|since=libfund_ts|num=2|1= |
− | explicit synchronized_pool_resource(memory_resource* upstream); | + | explicit synchronized_pool_resource( memory_resource* upstream ); |
}} | }} | ||
− | {{dcl|since=libfund_ts | num= 3| 1= | + | {{dcl|since=libfund_ts|num=3|1= |
− | explicit synchronized_pool_resource(const pool_options& opts); | + | explicit synchronized_pool_resource( const pool_options& opts ); |
}} | }} | ||
− | {{dcl|since=libfund_ts | num= 4| 1= | + | {{dcl|since=libfund_ts|num=4|1= |
− | synchronized_pool_resource(const pool_options& opts, | + | synchronized_pool_resource( const pool_options& opts, |
− | + | memory_resource* upstream ); | |
}} | }} | ||
− | {{dcl|since=libfund_ts | num= 5| 1= | + | {{dcl|since=libfund_ts|num=5|1= |
− | synchronized_pool_resource(const synchronized_pool_resource&) = delete; | + | synchronized_pool_resource( const synchronized_pool_resource& ) = delete; |
}} | }} | ||
{{dcl end}} | {{dcl end}} | ||
Line 22: | Line 22: | ||
Constructs a {{tt|synchronized_pool_resource}}. | Constructs a {{tt|synchronized_pool_resource}}. | ||
− | @1-4@ Constructs a {{tt|synchronized_pool_resource}} using the specified | + | @1-4@ Constructs a {{tt|synchronized_pool_resource}} using the specified upstream memory resource . |
+ | The overloads not taking {{|opts}} as a parameter uses a default constructed instance of {{ltt|cpp/experimental/pool_options}} as the options. The overloads not taking {{|upstream}} as a parameter uses the return value of {{c|std::experimental::pmr::get_default_resource()}} as the upstream memory resource. | ||
@5@ Copy constructor is deleted. | @5@ Copy constructor is deleted. | ||
− | === Parameters === | + | ===Parameters=== |
− | + | ||
{{par begin}} | {{par begin}} | ||
− | {{par | opts | a {{tt|pool_options}} struct containing the constructor options }} | + | {{par|opts|a {{tt|pool_options}} struct containing the constructor options}} |
− | {{par | upstream | the upstream memory resource to use }} | + | {{par|upstream|the upstream memory resource to use}} |
{{par end}} | {{par end}} | ||
+ | |||
+ | |||
+ |
Latest revision as of 05:56, 6 August 2023
synchronized_pool_resource(); |
(1) | (library fundamentals TS) |
explicit synchronized_pool_resource( memory_resource* upstream ); |
(2) | (library fundamentals TS) |
explicit synchronized_pool_resource( const pool_options& opts ); |
(3) | (library fundamentals TS) |
synchronized_pool_resource( const pool_options& opts, memory_resource* upstream ); |
(4) | (library fundamentals TS) |
synchronized_pool_resource( const synchronized_pool_resource& ) = delete; |
(5) | (library fundamentals TS) |
Constructs a synchronized_pool_resource
.
1-4) Constructs a
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::experimental::pmr::get_default_resource() as the upstream memory resource.
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::experimental::pmr::get_default_resource() as the upstream memory resource.
5) Copy constructor is deleted.
[edit] Parameters
opts | - | a pool_options struct containing the constructor options
|
upstream | - | the upstream memory resource to use |
[edit] 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.