[libcxx-commits] [PATCH] D120135: [libc++] Overhaul std::quoted; fix its relationship to character traits.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 18 08:31:57 PST 2022


Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, libc++.
Quuxplusone added a project: libc++.
Herald added a subscriber: yaxunl.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

https://en.cppreference.com/w/cpp/io/manip/quoted

Move `__quoted_output_proxy` into the one file that uses it. (This was the top of the rabbit hole... :))

A `const char*` has no associated traits class, so `std::quoted("literal")` should be printable into any basic_ostream regardless of traits.

Use hidden-friend `operator<<` and `operator>>`, since we're permitted to. (The exact signature is unspecified because the class itself is unspecified.)

We shouldn't support `std::quoted("literal")` in C++03 or C++11 mode. (We do need `std::__quoted(s)` and `std::__quoted(cs)` in C++11 mode, because they're used by `std::__fs::filesystem::path`.)

Use `_LIBCPP_HIDDEN` and `_LIBCPP_HIDE_FROM_ABI` consistently.

Several places needed ADL-proofing. Drive-by reformatting.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120135

Files:
  libcxx/include/__filesystem/path.h
  libcxx/include/__string
  libcxx/include/iomanip
  libcxx/test/std/input.output/iostream.format/quoted.manip/quoted_traits.compile.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120135.409942.patch
Type: text/x-patch
Size: 19074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220218/9d74d546/attachment-0001.bin>


More information about the libcxx-commits mailing list