forked from fmtlib/fmt
Use correct Char type in std::filesystem::path (#3476)
Godbolt repro: https://godbolt.org/z/o4bjG6ddo Co-authored-by: Hans-Martin B. Jensen <haje@eposaudio.com>
This commit is contained in:
committed by
GitHub
parent
8abfc145be
commit
60fd9941c0
@ -89,9 +89,9 @@ inline void write_escaped_path<std::filesystem::path::value_type>(
|
|||||||
FMT_EXPORT
|
FMT_EXPORT
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
struct formatter<std::filesystem::path, Char>
|
struct formatter<std::filesystem::path, Char>
|
||||||
: formatter<basic_string_view<Char>> {
|
: formatter<basic_string_view<Char>, Char> {
|
||||||
template <typename ParseContext> FMT_CONSTEXPR auto parse(ParseContext& ctx) {
|
template <typename ParseContext> FMT_CONSTEXPR auto parse(ParseContext& ctx) {
|
||||||
auto out = formatter<basic_string_view<Char>>::parse(ctx);
|
auto out = formatter<basic_string_view<Char>, Char>::parse(ctx);
|
||||||
this->set_debug_format(false);
|
this->set_debug_format(false);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ struct formatter<std::filesystem::path, Char>
|
|||||||
typename FormatContext::iterator {
|
typename FormatContext::iterator {
|
||||||
auto quoted = basic_memory_buffer<Char>();
|
auto quoted = basic_memory_buffer<Char>();
|
||||||
detail::write_escaped_path(quoted, p);
|
detail::write_escaped_path(quoted, p);
|
||||||
return formatter<basic_string_view<Char>>::format(
|
return formatter<basic_string_view<Char>, Char>::format(
|
||||||
basic_string_view<Char>(quoted.data(), quoted.size()), ctx);
|
basic_string_view<Char>(quoted.data(), quoted.size()), ctx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user