[libcxx-commits] [PATCH] D121138: [libc++][format] Adds formatter<charT[N], charT>.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 7 10:20:56 PST 2022


Mordante created this revision.
Herald added a project: All.
Mordante requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This formatter isn't in the list of required formatters in

[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>;

Since remove_cvref_t<const charT[N]> is charT[N] the formatter is
required by

[format.functions]/25

  Preconditions: formatter<remove_cvref_t<Ti>, charT> meets the
  BasicFormatter requirements ([formatter.requirements]) for each Ti in
  Args.

Depends on D120921 <https://reviews.llvm.org/D120921>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121138

Files:
  libcxx/include/__format/formatter_string.h
  libcxx/test/libcxx/utilities/format/format.formatter/format.formatter.spec/formattable.compile.pass.cpp
  libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
  libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121138.413545.patch
Type: text/x-patch
Size: 6772 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220307/3a35ad99/attachment.bin>


More information about the libcxx-commits mailing list