Flipping flag polarity.

This commit is contained in:
Barry Revzin 2022-07-10 13:52:57 -05:00
parent 8632c30404
commit c3585af6d8

View File

@ -415,7 +415,7 @@ struct formatter<
detail::range_formatter_type<Char, detail::uncvref_type<range_type>>; detail::range_formatter_type<Char, detail::uncvref_type<range_type>>;
formatter_type underlying_; formatter_type underlying_;
bool custom_specs_ = false; bool custom_specs_ = false;
bool use_brackets_ = true; bool no_brackets_ = false;
template <typename ParseContext> template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
@ -424,7 +424,7 @@ struct formatter<
if (it == end || *it == '}') return it; if (it == end || *it == '}') return it;
if (*it == 'n') { if (*it == 'n') {
use_brackets_ = false; no_brackets_ = true;
++it; ++it;
} }
@ -444,7 +444,7 @@ struct formatter<
Char postfix = detail::is_set<R>::value ? '}' : ']'; Char postfix = detail::is_set<R>::value ? '}' : ']';
detail::range_mapper<buffer_context<Char>> mapper; detail::range_mapper<buffer_context<Char>> mapper;
auto out = ctx.out(); auto out = ctx.out();
if (use_brackets_) *out++ = prefix; if (!no_brackets_) *out++ = prefix;
int i = 0; int i = 0;
auto it = detail::range_begin(range); auto it = detail::range_begin(range);
auto end = detail::range_end(range); auto end = detail::range_end(range);
@ -458,7 +458,7 @@ struct formatter<
} }
++i; ++i;
} }
if (use_brackets_) *out++ = postfix; if (!no_brackets_) *out++ = postfix;
return out; return out;
} }
}; };