diff --git a/include/fmt/ranges.h b/include/fmt/ranges.h index e28365d8..a4c102af 100644 --- a/include/fmt/ranges.h +++ b/include/fmt/ranges.h @@ -415,7 +415,7 @@ struct formatter< detail::range_formatter_type>; formatter_type underlying_; bool custom_specs_ = false; - bool use_brackets_ = true; + bool no_brackets_ = false; template FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { @@ -424,7 +424,7 @@ struct formatter< if (it == end || *it == '}') return it; if (*it == 'n') { - use_brackets_ = false; + no_brackets_ = true; ++it; } @@ -444,7 +444,7 @@ struct formatter< Char postfix = detail::is_set::value ? '}' : ']'; detail::range_mapper> mapper; auto out = ctx.out(); - if (use_brackets_) *out++ = prefix; + if (!no_brackets_) *out++ = prefix; int i = 0; auto it = detail::range_begin(range); auto end = detail::range_end(range); @@ -458,7 +458,7 @@ struct formatter< } ++i; } - if (use_brackets_) *out++ = postfix; + if (!no_brackets_) *out++ = postfix; return out; } };