Skip to content

Conversation

@barcharcraz
Copy link
Contributor

  • adds _Parse_format_string
  • adds _Parse_replacement_field
  • adds _Specs_setter and _Basic_format_specs
  • adds _Specs_checker, and _Numeric_specs_checker
  • adds _Format_handler (note that _On_format_specs is incomplete)
  • adds vformat_to definition
  • adds basic_format_args::get

in total this is enough to get vformat_to instantiations to compile, although we can't run them without a few more basic_format_arg and basic_format_args related things.

Note that this vformat_to is the C++ 20 version of vformat_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.

@barcharcraz barcharcraz requested a review from a team as a code owner February 3, 2021 04:55
@StephanTLavavej StephanTLavavej added cxx20 C++20 feature format C++20/23 format labels Feb 3, 2021
@CaseyCarter CaseyCarter self-assigned this Feb 3, 2021
Comment on lines +437 to +558
_CharT _Ch = _CharT{};
if (_Begin != _End) {
_Ch = *_Begin;
}
Copy link
Contributor

@miscco miscco Feb 12, 2021

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

Suggested change
_CharT _Ch = _CharT{};
if (_Begin != _End) {
_Ch = *_Begin;
}
if (_Begin == _End) {
throw format_error("Missing '}' in format string.");
}
const _CharT _Ch = *_Begin;

@barcharcraz barcharcraz force-pushed the format_string_parsing branch from 18fa4dc to d0e5304 Compare February 17, 2021 20:30
Copy link
Contributor

@CaseyCarter CaseyCarter left a 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.

@barcharcraz barcharcraz merged commit 286fe46 into microsoft:feature/format Feb 18, 2021
@CaseyCarter CaseyCarter removed their assignment Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cxx20 C++20 feature format C++20/23 format

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants