Define std::hash specializations for C++17 PMR strings
authorJonathan Wakely <jwakely@redhat.com>
Wed, 3 Apr 2019 09:47:47 +0000 (10:47 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 3 Apr 2019 09:47:47 +0000 (10:47 +0100)
commit0cb78ef4bcd216413199f9f27eed0ea0a56dd8da
treec4d7fd4a00fd3526c53a1055a9e91973a4a0fd1e
parent3a3976b14e329421e51a2aa43e516a6871cb5e6b
Define std::hash specializations for C++17 PMR strings

These hash specializations should have been added when the pmr::string
and related typedefs were added.

* include/std/string (__hash_string_base): New class template defining
operator() for hashing strings.
(hash<pmr::string>, hash<pmr::u8string>, hash<pmr::u16string>)
(hash<pmr::u32string>, hash<pmr::wstring>): Define for C++17.
* testsuite/21_strings/basic_string/hash/hash.cc: New test.
* testsuite/21_strings/basic_string/hash/hash_char8_t.cc: New test.

From-SVN: r270116
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/string
libstdc++-v3/testsuite/21_strings/basic_string/hash/hash.cc [new file with mode: 0644]
libstdc++-v3/testsuite/21_strings/basic_string/hash/hash_char8_t.cc [new file with mode: 0644]