Commit d8933b83 by Lawrence Wolf-Sonkin Committed by Copybara-Service

[absl] Update documentation to reflect hash support for std::wstring,…

[absl] Update documentation to reflect hash support for std::wstring, std::u16string and std::u32stringstrings

PiperOrigin-RevId: 515726337
Change-Id: I08e184ec1f7169835c034ac45a7e87293dc53078
parent ed842801
...@@ -110,9 +110,10 @@ ABSL_NAMESPACE_BEGIN ...@@ -110,9 +110,10 @@ ABSL_NAMESPACE_BEGIN
// * std::unique_ptr and std::shared_ptr // * std::unique_ptr and std::shared_ptr
// * All string-like types including: // * All string-like types including:
// * absl::Cord // * absl::Cord
// * std::string // * std::string (as well as any instance of std::basic_string that
// * std::string_view (as well as any instance of std::basic_string that // uses one of {char, wchar_t, char16_t, char32_t} and its associated
// uses char and std::char_traits) // std::char_traits)
// * std::string_view
// * All the standard sequence containers (provided the elements are hashable) // * All the standard sequence containers (provided the elements are hashable)
// * All the standard associative containers (provided the elements are // * All the standard associative containers (provided the elements are
// hashable) // hashable)
......
...@@ -516,14 +516,14 @@ H AbslHashValue(H hash_state, const std::shared_ptr<T>& ptr) { ...@@ -516,14 +516,14 @@ H AbslHashValue(H hash_state, const std::shared_ptr<T>& ptr) {
// the same character sequence. These types are: // the same character sequence. These types are:
// //
// - `absl::Cord` // - `absl::Cord`
// - `std::string` (and std::basic_string<char, std::char_traits<char>, A> for // - `std::string` (and std::basic_string<T, std::char_traits<T>, A> for
// any allocator A) // any allocator A and any T in {char, wchar_t, char16_t, char32_t})
// - `absl::string_view` and `std::string_view` // - `absl::string_view` and `std::string_view`
// //
// For simplicity, we currently support only `char` strings. This support may // For simplicity, we currently support only strings built on `char`, `wchar_t`,
// be broadened, if necessary, but with some caution - this overload would // `char16_t`, or `char32_t`. This support may be broadened, if necessary, but
// misbehave in cases where the traits' `eq()` member isn't equivalent to `==` // with some caution - this overload would misbehave in cases where the traits'
// on the underlying character type. // `eq()` member isn't equivalent to `==` on the underlying character type.
template <typename H> template <typename H>
H AbslHashValue(H hash_state, absl::string_view str) { H AbslHashValue(H hash_state, absl::string_view str) {
return H::combine( return H::combine(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment