Chromium Code Reviews| Index: base/files/file_path.h |
| diff --git a/base/files/file_path.h b/base/files/file_path.h |
| index 0be0ad0b1049e6809574ec5dcd372462cd106d41..56dfc216ad93ab0e01dd459cf0a8be5c19769bc6 100644 |
| --- a/base/files/file_path.h |
| +++ b/base/files/file_path.h |
| @@ -472,6 +472,8 @@ void PrintTo(const FilePath& path, std::ostream* out); |
| // Provide a hash function so that hash_sets and maps can contain FilePath |
| // objects. |
| +// |
| +// TODO(brettw) remove this when base::hash_map is removed. |
|
Łukasz Anforowicz
2017/04/24 18:46:10
I don't understand why we need to wait for removal
brettw
2017/04/25 23:32:36
I missed the forwarding to std::hash. I'll remove.
|
| namespace BASE_HASH_NAMESPACE { |
| template<> |
| @@ -483,4 +485,17 @@ struct hash<base::FilePath> { |
| } // namespace BASE_HASH_NAMESPACE |
| +namespace std { |
| + |
| +template <> |
| +struct hash<base::FilePath> { |
| + typedef base::FilePath argument_type; |
| + typedef std::size_t result_type; |
| + result_type operator()(argument_type const& f) const { |
| + return hash<base::FilePath::StringType>()(f.value()); |
| + } |
| +}; |
| + |
| +} // namespace std |
| + |
| #endif // BASE_FILES_FILE_PATH_H_ |