Do not use the u8string and u8string_view typedefs, because char8_t availability does not guarantee their presence

This commit is contained in:
Peter Dimov
2022-10-30 03:01:05 +02:00
parent 0865c1d230
commit f51f68fe93
3 changed files with 4 additions and 4 deletions

View File

@@ -643,7 +643,7 @@ namespace boost
// boost::is_integral<char8_t> is false, but should be true (https://github.com/boostorg/type_traits/issues/175)
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
template<> struct hash_is_avalanching< boost::hash< std::u8string > >: boost::true_type {};
template<> struct hash_is_avalanching< boost::hash< std::basic_string<char8_t> > >: boost::true_type {};
#endif
#if !defined(BOOST_NO_CXX17_HDR_STRING_VIEW)
@@ -651,7 +651,7 @@ namespace boost
template<class Ch> struct hash_is_avalanching< boost::hash< std::basic_string_view<Ch> > >: boost::is_integral<Ch> {};
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
template<> struct hash_is_avalanching< boost::hash< std::u8string_view > >: boost::true_type {};
template<> struct hash_is_avalanching< boost::hash< std::basic_string_view<char8_t> > >: boost::true_type {};
#endif
#endif

View File

@@ -45,7 +45,7 @@ int main()
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::u8string> > ));
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash< std::basic_string<char8_t> > > ));
#endif

View File

@@ -50,7 +50,7 @@ int main()
#if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash<std::u8string_view> > ));
BOOST_TEST_TRAIT_TRUE(( hash_is_avalanching< boost::hash< std::basic_string_view<char8_t> > > ));
#endif