remove #include <functional> from phmap_fwd_decl.h

This commit is contained in:
greg
2020-01-03 14:19:55 -05:00
parent c0a33e39cd
commit 942403f0db
3 changed files with 27 additions and 6 deletions
+13 -1
View File
@@ -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)>;