From 8bfe5f8e145c95efb3f65ccd248c2edc452dc240 Mon Sep 17 00:00:00 2001 From: Kenneth Weiss Date: Tue, 3 Jan 2023 12:32:51 -0800 Subject: [PATCH] Adds arg_formatter contructor using default locale This avoids the need to pass a temporary (default) locale_ref. --- include/fmt/format.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 5808635b0eb41..577f7952ca98c 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3583,9 +3583,12 @@ template struct arg_formatter { const format_specs& specs; locale_ref locale; + arg_formatter(buffer_appender it, const format_specs& s) + : out(it), specs(s) {} + arg_formatter(buffer_appender it, const format_specs& s, locale_ref l) - : out{it}, specs{s}, locale{l} {} + : out(it), specs(s), locale(l) {} template FMT_CONSTEXPR FMT_INLINE auto operator()(T value) -> iterator {