From b14455df803deba32537c841f8ff9ff896a3a0e3 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 28 Mar 2019 20:48:24 -0400 Subject: [PATCH] macos compilation issue --- parallel_hashmap/phmap_fwd_decl.h | 20 +++++++++++--------- parallel_hashmap/phmap_utils.h | 3 +++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/parallel_hashmap/phmap_fwd_decl.h b/parallel_hashmap/phmap_fwd_decl.h index 9cf8dbc..068d68d 100644 --- a/parallel_hashmap/phmap_fwd_decl.h +++ b/parallel_hashmap/phmap_fwd_decl.h @@ -36,7 +36,6 @@ namespace std { - template class allocator; template struct pair; } @@ -64,36 +63,39 @@ namespace phmap { template using hash_default_eq = typename container_internal::HashEq::Eq; + template + using Allocator = typename phmap::Allocator; + } // namespace container_internal template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator> + class Alloc = phmap::container_internal::Allocator> class flat_hash_set; template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator>> + class Alloc = phmap::container_internal::Allocator>> class flat_hash_map; template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator> + class Alloc = phmap::container_internal::Allocator> class node_hash_set; template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator>> + class Alloc = phmap::container_internal::Allocator>> class node_hash_map; template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator, + class Alloc = phmap::container_internal::Allocator, size_t N = 4, // 2**N submaps class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks class parallel_flat_hash_set; @@ -101,7 +103,7 @@ namespace phmap { template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator>, + class Alloc = phmap::container_internal::Allocator>, size_t N = 4, // 2**N submaps class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks class parallel_flat_hash_map; @@ -109,7 +111,7 @@ namespace phmap { template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator, + class Alloc = phmap::container_internal::Allocator, size_t N = 4, // 2**N submaps class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks class parallel_node_hash_set; @@ -117,7 +119,7 @@ namespace phmap { template , class Eq = phmap::container_internal::hash_default_eq, - class Alloc = std::allocator>, + class Alloc = phmap::container_internal::Allocator>, size_t N = 4, // 2**N submaps class Mutex = phmap::NullMutex> // use std::mutex to enable internal locks class parallel_node_hash_map; diff --git a/parallel_hashmap/phmap_utils.h b/parallel_hashmap/phmap_utils.h index d188d2c..961ec25 100644 --- a/parallel_hashmap/phmap_utils.h +++ b/parallel_hashmap/phmap_utils.h @@ -44,6 +44,9 @@ namespace phmap template T phmap_min(T a, T b) { return a < b ? a : b; } template T phmap_max(T a, T b) { return a >= b ? a : b; } +template +using Allocator = typename std::allocator; + template struct EqualTo {