Page MenuHomePhabricator

[libc++][format] Implement formatters.
Needs ReviewPublic

Authored by Mordante on Feb 14 2021, 6:01 AM.

Details

Reviewers
EricWF
ldionne
mclow.lists
miscco
curdeius
Group Reviewers
Restricted Project
Summary

This implements the initial version of the std::formatter class and its
specializations. It also implements the following formatting functions:

  • format
  • vformat
  • format_to
  • vformat_to
  • format_to_n
  • formatted_size

All functions have a char and wchar_t version. The locale overloaded
versions aren't implemented yet. Parsing the format-spec and using the
parsed format-spec hasn't been implemented. The code isn't optimized,
neither for speed, nor for size.

The goal is to have the rudimentary basics working, which can be used as a
basis to improve upon.

Implements parts of:

  • P0645 Text Formatting

Depends on D93593

Diff Detail

Event Timeline

Mordante created this revision.Feb 14 2021, 6:01 AM
Mordante requested review of this revision.Feb 14 2021, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2021, 6:01 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante updated this revision to Diff 323617.Feb 14 2021, 7:13 AM

Fixes a minor formatting error.
2 unit test with a last minute cleanup breakage
a unit test requiring clang-12 due since it requires e97e9851b227e
properly silence warnings about unused parameter pack arguments