File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/core/include/mp-units/ext Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -299,8 +299,13 @@ template<std::size_t N>
299299struct std ::hash<mp_units::fixed_u16string<N>> : std::hash<std::u16string_view> {};
300300template <std::size_t N>
301301struct std ::hash<mp_units::fixed_u32string<N>> : std::hash<std::u32string_view> {};
302+
303+ // NOTE: We use std::basic_string_view<wchar_t> instead of std::wstring_view because LLVM only makes std::wstring_view
304+ // available when the macro _LIBCPP_HAS_WIDE_CHARACTERS is set to 1. The `wchar_t` type can continue to be used
305+ // without that macro definition. To avoid requiring an additional macro, we simply use std::basic_string_view<wchar_t>,
306+ // which is the underlying definition of std::wstring_view.
302307template <std::size_t N>
303- struct std ::hash<mp_units::fixed_wstring<N>> : std::hash<std::wstring_view > {};
308+ struct std ::hash<mp_units::fixed_wstring<N>> : std::hash<std::basic_string_view< wchar_t > > {};
304309
305310#if MP_UNITS_HOSTED
306311// formatting support
You can’t perform that action at this time.
0 commit comments