[libc++][format] Implements formattable concept.
authorMark de Wever <koraq@xs4all.nl>
Sat, 17 Sep 2022 11:34:00 +0000 (13:34 +0200)
committerMark de Wever <koraq@xs4all.nl>
Wed, 5 Oct 2022 20:21:00 +0000 (22:21 +0200)
commita1beb0a38262f2456e435d16cb00867e2cdbb432
tree48d55c73e01c34cd4be6356cc4f92d6be59d018c
parentff23599a0dfc857c4e80854a35026be4a29dd57c
[libc++][format] Implements formattable concept.

This concept is introduced in P2286, but was implemented in libc++
before. This implementation was used in the library internally. This
implementation lacked the resolution of LWG3636. The original formatter
had a non-const member function that wasn't trivial to make a const
member. The recent parser improvements made this member a const member
in preparation of LWG3636.

Note LWG3636 isn't voted in. Its status is Ready. P2286's concept has
been written as-if LWG3636 is accepted and refers to that LWG issue.

Updates some tests make format a const member function and removes a
tests that's mainly a duplicate of the formattable concept test.

Implements
- LWG3636 formatter<T>::format should be const-qualified

Implements parts of
- P2286R8 Formatting Ranges

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D134110
libcxx/docs/Status/Cxx2bIssues.csv
libcxx/docs/Status/FormatPaper.csv
libcxx/include/__format/concepts.h
libcxx/test/std/utilities/format/format.formattable/concept.formattable.compile.pass.cpp [moved from libcxx/test/libcxx/utilities/format/format.formatter/format.formatter.spec/formattable.compile.pass.cpp with 98% similarity]
libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.handle.pass.cpp
libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp [deleted file]
libcxx/test/std/utilities/format/format.functions/P2418.pass.cpp
libcxx/test/std/utilities/format/format.functions/format_tests.h