diff options
author | davidben <davidben@chromium.org> | 2014-10-10 17:13:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-11 00:14:14 +0000 |
commit | 254bd40b3f63b8d1e484a5c88a2255681ea54e45 (patch) | |
tree | c75dfd0f1160ba33aab3cdef30fbbcca8b2bce46 /tools | |
parent | 45097b2058e1a0d5049c9b7789a91aa9ea4f09ae (diff) | |
download | chromium_src-254bd40b3f63b8d1e484a5c88a2255681ea54e45.zip chromium_src-254bd40b3f63b8d1e484a5c88a2255681ea54e45.tar.gz chromium_src-254bd40b3f63b8d1e484a5c88a2255681ea54e45.tar.bz2 |
Align base::hash_map with C++11, part 1.
C++11's std::hash provides a default hash for T* that hashes by pointer value.
So does MSVC's stdext::hash_value, but not GCC's __gnu_cxx::hash (and STLPort's
std::hash). To align non-MSVC with both MSVC and the standard, provide a
default hash for pointers. This removes a lot of GCC-specific hash definitions.
Confusingly, all three provide a default hash for const char * that hashes as C
string, while not changing their equality. This CL does not change this on any
platform.
BUG=420242
Review URL: https://codereview.chromium.org/630503002
Cr-Commit-Position: refs/heads/master@{#299217}
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gn/target.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/tools/gn/target.h b/tools/gn/target.h index 947edc2..5b19aad 100644 --- a/tools/gn/target.h +++ b/tools/gn/target.h @@ -315,20 +315,4 @@ class Target : public Item { DISALLOW_COPY_AND_ASSIGN(Target); }; -namespace BASE_HASH_NAMESPACE { - -#if defined(COMPILER_GCC) -template<> struct hash<const Target*> { - std::size_t operator()(const Target* t) const { - return reinterpret_cast<std::size_t>(t); - } -}; -#elif defined(COMPILER_MSVC) -inline size_t hash_value(const Target* t) { - return reinterpret_cast<size_t>(t); -} -#endif // COMPILER... - -} // namespace BASE_HASH_NAMESPACE - #endif // TOOLS_GN_TARGET_H_ |