mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 16:40:39 +08:00
remove #include <functional> from phmap_fwd_decl.h
This commit is contained in:
Vendored
+13
-1
@@ -755,6 +755,7 @@ namespace container_internal {
|
||||
StringBtreeDefaultLess(std::less<std::string>) {} // NOLINT
|
||||
#if PHMAP_HAVE_STD_STRING_VIEW
|
||||
StringBtreeDefaultLess(std::less<std::string_view>) {} // NOLINT
|
||||
StringBtreeDefaultLess(phmap::Less<std::string_view>) {} // NOLINT
|
||||
|
||||
phmap::weak_ordering operator()(std::string_view lhs,
|
||||
std::string_view rhs) const {
|
||||
@@ -810,6 +811,11 @@ namespace container_internal {
|
||||
using type = StringBtreeDefaultLess;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct key_compare_to_adapter<phmap::Less<std::string>> {
|
||||
using type = StringBtreeDefaultLess;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct key_compare_to_adapter<std::greater<std::string>> {
|
||||
using type = StringBtreeDefaultGreater;
|
||||
@@ -821,6 +827,11 @@ namespace container_internal {
|
||||
using type = StringBtreeDefaultLess;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct key_compare_to_adapter<phmap::Less<std::string_view>> {
|
||||
using type = StringBtreeDefaultLess;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct key_compare_to_adapter<std::greater<std::string_view>> {
|
||||
using type = StringBtreeDefaultGreater;
|
||||
@@ -1071,7 +1082,8 @@ namespace container_internal {
|
||||
using use_linear_search = std::integral_constant<
|
||||
bool,
|
||||
std::is_arithmetic<key_type>::value &&
|
||||
(std::is_same<std::less<key_type>, key_compare>::value ||
|
||||
(std::is_same<phmap::Less<key_type>, key_compare>::value ||
|
||||
std::is_same<std::less<key_type>, key_compare>::value ||
|
||||
std::is_same<std::greater<key_type>, key_compare>::value)>;
|
||||
|
||||
|
||||
|
||||
Vendored
+9
@@ -80,6 +80,15 @@ struct EqualTo
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct Less
|
||||
{
|
||||
inline bool operator()(const T& a, const T& b) const
|
||||
{
|
||||
return std::less<T>()(a, b);
|
||||
}
|
||||
};
|
||||
|
||||
namespace type_traits_internal {
|
||||
|
||||
template <typename... Ts>
|
||||
|
||||
Vendored
+5
-5
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <functional>
|
||||
|
||||
#if defined(PHMAP_USE_ABSL_HASH)
|
||||
namespace absl { template <class T> struct Hash; };
|
||||
@@ -35,6 +34,7 @@ namespace phmap {
|
||||
#endif
|
||||
|
||||
template <class T> struct EqualTo;
|
||||
template <class T> struct Less;
|
||||
template <class T> using Allocator = typename std::allocator<T>;
|
||||
template<class T1, class T2> using Pair = typename std::pair<T1, T2>;
|
||||
|
||||
@@ -128,19 +128,19 @@ namespace phmap {
|
||||
class parallel_node_hash_map;
|
||||
|
||||
// ------------- forward declarations for btree containers ----------------------------------
|
||||
template <typename Key, typename Compare = std::less<Key>,
|
||||
template <typename Key, typename Compare = phmap::Less<Key>,
|
||||
typename Alloc = phmap::Allocator<Key>>
|
||||
class btree_set;
|
||||
|
||||
template <typename Key, typename Compare = std::less<Key>,
|
||||
template <typename Key, typename Compare = phmap::Less<Key>,
|
||||
typename Alloc = phmap::Allocator<Key>>
|
||||
class btree_multiset;
|
||||
|
||||
template <typename Key, typename Value, typename Compare = std::less<Key>,
|
||||
template <typename Key, typename Value, typename Compare = phmap::Less<Key>,
|
||||
typename Alloc = phmap::Allocator<phmap::container_internal::Pair<const Key, Value>>>
|
||||
class btree_map;
|
||||
|
||||
template <typename Key, typename Value, typename Compare = std::less<Key>,
|
||||
template <typename Key, typename Value, typename Compare = phmap::Less<Key>,
|
||||
typename Alloc = phmap::Allocator<phmap::container_internal::Pair<const Key, Value>>>
|
||||
class btree_multimap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user