From a1e1eedbb5ccf8d41c83f1c945a673fc28844f35 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 27 Jan 2024 14:00:13 -0800 Subject: [PATCH] Minor cleanup --- include/fmt/base.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 3850871b..8333d516 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2925,12 +2925,12 @@ FMT_INLINE auto format_to_n(OutputIt out, size_t n, format_string fmt, return vformat_to_n(out, n, fmt, fmt::make_format_args(args...)); } -template +template struct format_to_result { /** Iterator pointing to just after the last succesful write in the range. */ OutputIt out; /** Sentinel indicating the end of the output range. */ - OutputSen out_last; + Sentinel out_last; FMT_CONSTEXPR operator OutputIt&() & noexcept { return out; } FMT_CONSTEXPR operator const OutputIt&() const& noexcept { return out; } @@ -2939,16 +2939,15 @@ struct format_to_result { } }; -template -auto vformat_to(char (&out)[Size], string_view fmt, format_args args) +template +auto vformat_to(char (&out)[N], string_view fmt, format_args args) -> format_to_result { - format_to_n_result result = vformat_to_n(out, Size, fmt, args); - return {result.out, out + Size}; + return {vformat_to_n(out, N, fmt, args).out, out + N}; } -template -FMT_INLINE auto format_to(char (&out)[Size], format_string fmt, - T&&... args) -> format_to_result { +template +FMT_INLINE auto format_to(char (&out)[N], format_string fmt, T&&... args) + -> format_to_result { return vformat_to(out, fmt, fmt::make_format_args(args...)); }