File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -17713,12 +17713,13 @@
17713
17713
// Parses a width argument id in the format \tcode{\{} \fmtgrammarterm{digit} \tcode{\}}.
17714
17714
constexpr auto parse(format_parse_context& ctx) {
17715
17715
auto iter = ctx.begin();
17716
+ auto is_digit = [](auto c) { return c >= '0' && c <= '9'; };
17716
17717
auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; };
17717
17718
if (get_char() != '{')
17718
17719
return iter;
17719
17720
++iter;
17720
17721
char c = get_char();
17721
- if (!isdigit (c) || (++iter, get_char()) != '}')
17722
+ if (!is_digit (c) || (++iter, get_char()) != '}')
17722
17723
throw format_error("invalid format");
17723
17724
width_arg_id = c - '0';
17724
17725
ctx.check_arg_id(width_arg_id);
17735
17736
else
17736
17737
return value;
17737
17738
});
17738
- return format_to(ctx.out(), "{0:x< {1}}", s.value, width);
17739
+ return format_to(ctx.out(), "{0:x> {1}}", s.value, width);
17739
17740
}
17740
17741
};
17741
17742
You can’t perform that action at this time.
0 commit comments