From 640aef361d67189e99a7d2ee2bc4e0f889071294 Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Sat, 14 Dec 2024 19:14:37 -0500 Subject: [PATCH] Fix issue with `std::pmr::polymorphic_allocator` --- parallel_hashmap/phmap_base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parallel_hashmap/phmap_base.h b/parallel_hashmap/phmap_base.h index 0c79dc0..c845706 100644 --- a/parallel_hashmap/phmap_base.h +++ b/parallel_hashmap/phmap_base.h @@ -2774,7 +2774,9 @@ class node_handle_base node_handle_base& operator=(node_handle_base&& other) noexcept { destroy(); if (!other.empty()) { - alloc_ = other.alloc_; + if (other.alloc_) { + alloc_.emplace(other.alloc_.value()); + } PolicyTraits::transfer(alloc(), slot(), other.slot()); other.reset(); }