From 8fc1bb41ef44284ba2fa2b4ac60f0fcacd3939d6 Mon Sep 17 00:00:00 2001 From: greg Date: Sun, 12 May 2019 11:36:49 -0400 Subject: [PATCH] fix compilation warnings with vs2017+, std=c++17 --- parallel_hashmap/phmap_base.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/parallel_hashmap/phmap_base.h b/parallel_hashmap/phmap_base.h index 4f0479a..ed546c9 100644 --- a/parallel_hashmap/phmap_base.h +++ b/parallel_hashmap/phmap_base.h @@ -1417,11 +1417,12 @@ struct RebindAlloc { using type = typename RebindFirstArg::type; }; -template -struct RebindAlloc { - using type = typename T::template rebind::other; +template +struct RebindAlloc { + using type = typename std::allocator_traits::template rebind_alloc; }; + } // namespace memory_internal template @@ -1632,7 +1633,7 @@ private: static auto construct_impl(int, A& a, // NOLINT(runtime/references) Args&&... args) -> decltype(a.construct(std::forward(args)...)) { - a.construct(std::forward(args)...); + std::allocator_traits::construct(a, std::forward(args)...); } template @@ -1643,7 +1644,7 @@ private: template static auto destroy_impl(int, A& a, // NOLINT(runtime/references) T* p) -> decltype(a.destroy(p)) { - a.destroy(p); + std::allocator_traits::destroy(a, p); } template static void destroy_impl(char, Alloc&, T* p) {