Created on 2016-11-09.00:00:00 last changed 98 months ago
Proposed resolution:
This wording is relative to N4606.
A more formal formulation would be:
For any sv of type SV (being string_view, u16string_view, u32string_view, or wstring_view) and s of the corresponding type S (being string, u16string, u32string, or wstring), hash<SV>()(sv) == hash<S>()(s).
Edit [string.view.hash] as indicated:
template<> struct hash<string_view>; template<> struct hash<u16string_view>; template<> struct hash<u32string_view>; template<> struct hash<wstring_view>>;-1- The template specializations shall meet the requirements of class template hash ([unord.hash]). The hash values shall be the same as the hash values for the corresponding string class ([basic.string.hash]).
[ 2016-11-12, Issaquah ]
Resolved by P0513R0
Under certain conditions we want to be able to use string_view instead of string. As a consequence both types should behave the same as long we talk about value specific behavior (if possible). For this reason, we should require that both strings and string_view yield the same hash values.
Should be solved in C++17 to ensure that following this use does not require to change hash values (which is allowed but possibly unfortunate).History | |||
---|---|---|---|
Date | User | Action | Args |
2016-11-21 17:34:16 | admin | set | messages: + msg8681 |
2016-11-21 17:34:16 | admin | set | status: new -> resolved |
2016-11-09 19:27:52 | admin | set | messages: + msg8589 |
2016-11-09 00:00:00 | admin | create |