Date
2022-07-25.20:32:58
Message id
12647

Content

Proposed resolution:

This wording is relative to N4910.

  1. Modify [string.syn], header <string> synopsis, as indicated:

    […]
    
    // [basic.string.hash], hash support
    template<class T> struct hash;
    template<> struct hash<string>;
    template<> struct hash<u8string>;
    template<> struct hash<u16string>;
    template<> struct hash<u32string>;
    template<> struct hash<wstring>;
    template<> struct hash<pmr::string>;
    template<> struct hash<pmr::u8string>;
    template<> struct hash<pmr::u16string>;
    template<> struct hash<pmr::u32string>;
    template<> struct hash<pmr::wstring>;
    template<class A> struct hash<basic_string<char, char_traits<char>, A>>;
    template<class A> struct hash<basic_string<char8_t, char_traits<char8_t>, A>>;
    template<class A> struct hash<basic_string<char16_t, char_traits<char16_t>, A>>;
    template<class A> struct hash<basic_string<char32_t, char_traits<char32_t>, A>>;
    template<class A> struct hash<basic_string<wchar_t, char_traits<wchar_t>, A>>;
    
    […]
    
  2. Modify [basic.string.hash] as indicated:

    template<> struct hash<string>;
    template<> struct hash<u8string>;
    template<> struct hash<u16string>;
    template<> struct hash<u32string>;
    template<> struct hash<wstring>;
    template<> struct hash<pmr::string>;
    template<> struct hash<pmr::u8string>;
    template<> struct hash<pmr::u16string>;
    template<> struct hash<pmr::u32string>;
    template<> struct hash<pmr::wstring>;
    template<class A> struct hash<basic_string<char, char_traits<char>, A>>;
    template<class A> struct hash<basic_string<char8_t, char_traits<char8_t>, A>>;
    template<class A> struct hash<basic_string<char16_t, char_traits<char16_t>, A>>;
    template<class A> struct hash<basic_string<char32_t, char_traits<char32_t>, A>>;
    template<class A> struct hash<basic_string<wchar_t, char_traits<wchar_t>, A>>;
    

    -1- If S is one of these string types, SV is the corresponding string view type, and s is an object of type S, then hash<S>()(s) == hash<SV>()(SV(s))