Skip to content

Commit

Permalink
Temp
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed May 27, 2024
1 parent 5e5bd30 commit 3ad0f17
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ struct range_formatter<
}

public:
bool string_or_debug_string = false;
FMT_CONSTEXPR range_formatter() {}

FMT_CONSTEXPR auto underlying() -> detail::range_formatter_type<Char, T>& {
Expand All @@ -453,15 +454,8 @@ struct range_formatter<
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
auto it = ctx.begin();
auto end = ctx.end();
switch (range_format_kind<T, Char>::value) {
case range_format::debug_string:
case range_format::string:
break;
default:
if (!string_or_debug_string)
detail::maybe_set_debug_format(underlying_, true);
break;
}

if (it == end) return underlying_.parse(ctx);

switch (detail::to_ascii(*it)) {
Expand Down Expand Up @@ -544,6 +538,7 @@ struct formatter<
range_formatter_.set_brackets(detail::string_literal<Char, '"'>{},
detail::string_literal<Char, '"'>{});
range_formatter_.set_separator({});
range_formatter_.string_or_debug_string = true;
break;
}
case range_format::set: {
Expand All @@ -554,6 +549,7 @@ struct formatter<
case range_format::string: {
range_formatter_.set_brackets({}, {});
range_formatter_.set_separator({});
range_formatter_.string_or_debug_string = true;
break;
}
default: {
Expand Down

0 comments on commit 3ad0f17

Please sign in to comment.