Closed BurningEnlightenment closed 1 year ago
Describe the bug The following code fails to compile with std::pmr::polymorphic_allocator or any allocator without a swap implementation: https://github.com/greg7mdp/parallel-hashmap/blob/f5e1638a912cdb83fde49ed4611acf9832b54586/parallel_hashmap/phmap.h#L1660-L1665
std::pmr::polymorphic_allocator
swap
To Reproduce Compile the following code with C++17 or higher
#include <memory_resource> #include <utility> #include <parallel_hashmap/phmap.h> template <typename K, typename T> using pmrmap = phmap::flat_hash_map<K, T, std::hash<K>, std::equal_to<>, std::pmr::polymorphic_allocator<std::pair<const K, T>>>; int main() { pmrmap<int, int> m1; pmrmap<int, int> m2; using std::swap; swap(m1, m2); }
Expected behavior No compiler errors (the UB in case of mismatching allocators is fine, however, in this case we do have matching allocators).
Additional context This is sort of a continuation of #128.
Thanks for the report, @BurningEnlightenment , issue should be fixed now. I'm closing it, but feel free to reopen if not fully fixed.
Describe the bug The following code fails to compile with
std::pmr::polymorphic_allocator
or any allocator without aswap
implementation: https://github.com/greg7mdp/parallel-hashmap/blob/f5e1638a912cdb83fde49ed4611acf9832b54586/parallel_hashmap/phmap.h#L1660-L1665To Reproduce Compile the following code with C++17 or higher
Expected behavior No compiler errors (the UB in case of mismatching allocators is fine, however, in this case we do have matching allocators).
Additional context This is sort of a continuation of #128.