Skip to content

Commit

Permalink
Adds arg_formatter contructor using default locale
Browse files Browse the repository at this point in the history
This avoids the need to pass a temporary (default) locale_ref.
  • Loading branch information
kennyweiss committed Jan 3, 2023
1 parent 7dd990e commit 8bfe5f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -3583,9 +3583,12 @@ template <typename Char> struct arg_formatter {
const format_specs<Char>& specs;
locale_ref locale;

arg_formatter(buffer_appender<Char> it, const format_specs<Char>& s)
: out(it), specs(s) {}

arg_formatter(buffer_appender<Char> it, const format_specs<Char>& s,
locale_ref l)
: out{it}, specs{s}, locale{l} {}
: out(it), specs(s), locale(l) {}

template <typename T>
FMT_CONSTEXPR FMT_INLINE auto operator()(T value) -> iterator {
Expand Down

0 comments on commit 8bfe5f8

Please sign in to comment.