-
Notifications
You must be signed in to change notification settings - Fork 1.6k
std::format parsing callbacks and machinery #1616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
std::format parsing callbacks and machinery #1616
Conversation
| _CharT _Ch = _CharT{}; | ||
| if (_Begin != _End) { | ||
| _Ch = *_Begin; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that if _Begin == _End we will always end up in the throw error case.
At least for me It would be clearer if we would write it like that
| _CharT _Ch = _CharT{}; | |
| if (_Begin != _End) { | |
| _Ch = *_Begin; | |
| } | |
| if (_Begin == _End) { | |
| throw format_error("Missing '}' in format string."); | |
| } | |
| const _CharT _Ch = *_Begin; |
18fa4dc to
d0e5304
Compare
CaseyCarter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge as-is and make changes in a later PR.
_Parse_format_string_Parse_replacement_field_Specs_setterand_Basic_format_specs_Specs_checker, and_Numeric_specs_checker_Format_handler(note that_On_format_specsis incomplete)vformat_todefinitionbasic_format_args::getin total this is enough to get
vformat_toinstantiations to compile, although we can't run them without a few morebasic_format_argandbasic_format_argsrelated things.Note that this
vformat_tois the C++ 20 version ofvformat_to, NOT the proposed C++23 version (they have different ABIs)Also note that this PR contains merge commits, they should go away if it's squashed, however.