Treat char8_t and std::byte as char types in hash_range

This commit is contained in:
Peter Dimov
2022-09-20 21:17:41 +03:00
parent 8a1335458a
commit e92eae9eb2
2 changed files with 16 additions and 0 deletions

View File

@@ -27,6 +27,14 @@ template<> struct is_char_type<char>: public boost::true_type {};
template<> struct is_char_type<signed char>: public boost::true_type {};
template<> struct is_char_type<unsigned char>: public boost::true_type {};
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
template<> struct is_char_type<char8_t>: public boost::true_type {};
#endif
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
template<> struct is_char_type<std::byte>: public boost::true_type {};
#endif
#endif
template<class It>

View File

@@ -48,5 +48,13 @@ int main()
test<float>();
test<double>();
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
test<char8_t>();
#endif
#if defined(__cpp_lib_byte) && __cpp_lib_byte >= 201603L
test<std::byte>();
#endif
return boost::report_errors();
}