mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-29 16:40:39 +08:00
small cleanups.
This commit is contained in:
Vendored
+13
@@ -51,6 +51,19 @@
|
||||
|
||||
namespace phmap {
|
||||
|
||||
template <class T> using Allocator = typename std::allocator<T>;
|
||||
|
||||
template<class T1, class T2> using Pair = typename std::pair<T1, T2>;
|
||||
|
||||
template <class T>
|
||||
struct EqualTo
|
||||
{
|
||||
inline size_t operator()(const T& a, const T& b) const
|
||||
{
|
||||
return std::equal_to<T>()(a, b);
|
||||
}
|
||||
};
|
||||
|
||||
namespace type_traits_internal {
|
||||
|
||||
template <typename... Ts>
|
||||
|
||||
Vendored
+2
-34
@@ -15,51 +15,20 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Includes work from abseil-cpp (https://github.com/abseil/abseil-cpp)
|
||||
// with modifications.
|
||||
//
|
||||
// Copyright 2018 The Abseil Authors.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
//#include <cstddef>
|
||||
#include <functional>
|
||||
#define PHMAP_HASH_CLASS std::hash
|
||||
|
||||
namespace phmap
|
||||
{
|
||||
|
||||
template <class T> using Allocator = typename std::allocator<T>;
|
||||
|
||||
template<class T1, class T2> using Pair = typename std::pair<T1, T2>;
|
||||
|
||||
template <class T>
|
||||
struct EqualTo
|
||||
{
|
||||
inline size_t operator()(const T& a, const T& b) const
|
||||
{
|
||||
return std::equal_to<T>()(a, b);
|
||||
}
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct Hash
|
||||
{
|
||||
inline size_t operator()(const T& __v) const
|
||||
{
|
||||
return PHMAP_HASH_CLASS<T>()(__v);
|
||||
return std::hash<T>()(__v);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -231,10 +200,9 @@ template <class T> struct Combiner<T, 8>
|
||||
template <class T>
|
||||
inline void hash_combine(std::size_t& seed, T const& v)
|
||||
{
|
||||
phmap::Hash<T> hasher;
|
||||
Combiner<std::size_t, sizeof(std::size_t)> combiner;
|
||||
|
||||
combiner(seed, hasher(v));
|
||||
combiner(seed, phmap::Hash<T>()(v));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user