std::pmr::unsynchronized_pool_resource::unsynchronized_pool_resource
來自 cppreference.com
unsynchronized_pool_resource(); |
(1) | (C++17 起) |
explicit unsynchronized_pool_resource( std::pmr::memory_resource* upstream ); |
(2) | (C++17 起) |
explicit unsynchronized_pool_resource( const std::pmr::pool_options& opts ); |
(3) | (C++17 起) |
unsynchronized_pool_resource( const std::pmr::pool_options& opts, std::pmr::memory_resource* upstream ); |
(4) | (C++17 起) |
unsynchronized_pool_resource( const unsynchronized_pool_resource& ) = delete; |
(5) | (C++17 起) |
構造一個 unsynchronized_pool_resource
。
1-4) 使用指定的上游記憶體資源構造一個
不帶 opts 引數的過載使用預設構造的 pool_options 例項作為選項。不帶 upstream 引數的過載使用 std::pmr::get_default_resource() 的返回值作為上游記憶體資源。
unsynchronized_pool_resource
,並根據指定的選項進行調整。生成的物件持有 upstream 的副本,但不擁有 upstream 所指向的資源。不帶 opts 引數的過載使用預設構造的 pool_options 例項作為選項。不帶 upstream 引數的過載使用 std::pmr::get_default_resource() 的返回值作為上游記憶體資源。
5) 複製建構函式被刪除。
[編輯] 引數
opts | - | 一個 std::pmr::pool_options 結構體,包含建構函式選項 |
upstream | - | 要使用的上游記憶體資源 |
[編輯] 異常
1-4) 僅當對上游資源的
allocate()
函式呼叫丟擲異常時才丟擲。是否發生此呼叫以及在何種條件下發生此呼叫是未指定的。