| // Copyright 2024 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef COMPONENTS_PREFS_TRANSPARENT_UNORDERED_STRING_MAP_H_ |
| #define COMPONENTS_PREFS_TRANSPARENT_UNORDERED_STRING_MAP_H_ |
| struct StringViewHasher : public std::hash<std::string_view> { |
| using is_transparent = void; |
| // A `std::unordered_map` from `std::string` to `ValueType` that allows |
| // copy-less find for `std::string_view`. |
| template <typename ValueType> |
| using TransparentUnorderedStringMap = |
| std::unordered_map<std::string, |
| internal::StringViewHasher, |
| #endif // COMPONENTS_PREFS_TRANSPARENT_UNORDERED_STRING_MAP_H_ |