HomePhabricator

[libc++][format] Adds string formatter.

Authored by Mordante on Dec 14 2020, 8:39 AM.

Description

[libc++][format] Adds string formatter.

Implements the formatter for all string types.
[format.formatter.spec]/2.2
For each charT, the string type specializations

template<> struct formatter<charT*, charT>;
template<> struct formatter<const charT*, charT>;
template<size_t N> struct formatter<const charT[N], charT>;
template<class traits, class Allocator>
  struct formatter<basic_string<charT, traits, Allocator>, charT>;
template<class traits>
  struct formatter<basic_string_view<charT, traits>, charT>;

This removes the stub implemented in D96664.

Implements parts of:

  • P0645 Text Formatting
  • P1868 width: clarifying units of width and precision in std::format

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103425

Details

Committed
MordanteOct 7 2021, 8:03 AM
Reviewer
Restricted Project
Differential Revision
D103425: [libc++][format] Adds string formatter.
Parents
rG9072183cb634: [llvm-objdump] Fix --prefix and --prefix-strip
Branches
Unknown
Tags
Unknown