diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index b112f76e991c3..4c702c20e7280 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -427,7 +427,7 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc, char format, char modifier = 0) -> OutputIt { auto&& buf = get_buffer(out); do_write(buf, time, loc, format, modifier); - return buf.out(); + return get_iterator(buf); } template ::value)> inline Int to_nonnegative_int(T value, Int upper) { FMT_ASSERT(std::is_unsigned::value || - (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), + (value >= 0 && to_unsigned(value) <= to_unsigned(upper)), "invalid value"); (void)upper; return static_cast(value); diff --git a/include/fmt/format.h b/include/fmt/format.h index 3734b4198ed04..311783c411a53 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2089,8 +2089,9 @@ FMT_CONSTEXPR auto make_write_int_arg(T value, sign_t sign) return {abs_value, prefix}; } -template struct loc_writer { - buffer_appender out; +template > +struct loc_writer { + OutputIt out; const basic_format_specs& specs; std::basic_string sep; std::string grouping; diff --git a/include/fmt/xchar.h b/include/fmt/xchar.h index 5fb5c8154fd66..ca82b3a669bd3 100644 --- a/include/fmt/xchar.h +++ b/include/fmt/xchar.h @@ -33,7 +33,7 @@ auto write_loc(OutputIt out, basic_format_arg> val, auto grouping = numpunct.grouping(); if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep()); return visit_format_arg( - loc_writer{out, specs, separator, grouping, {}}, val); + loc_writer{out, specs, separator, grouping, {}}, val); #endif return false; }