[libcxx-commits] [PATCH] D115686: [libc++] [P0849R8] Introduce _LIBCPP_AUTO_CAST(x) for auto(x)

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Dec 17 10:31:18 PST 2021


Quuxplusone updated this revision to Diff 395162.
Quuxplusone marked an inline comment as done.
Quuxplusone retitled this revision from "[libc++] [ranges] Introduce _LIBCPP_AUTO_CAST(x) for auto(x)" to "[libc++] [P0849R8] Introduce _LIBCPP_AUTO_CAST(x) for auto(x)".
Quuxplusone added a comment.

Mark P0849 <https://wg21.link/p0849r8> as "Complete," which means replacing the remaining `__decay_copy`s e.g. in `<thread>` with `_LIBCPP_AUTO_CAST`. I believe these diffs end up being no-ops. Then, there are no `__decay_copy`s left anywhere in the codebase, so just remove the helper entirely.

Now, P0849 <https://wg21.link/p0849r8> goes out of its way to //not// remove the uses of `decay-copy` in http://eel.is/c++draft/range.all.general#2.1 and http://eel.is/c++draft/range.take#overview-2.1 , but that's just a specification hack. `decay-copy(E)` is the same thing as `auto(forward<T>(t))` whenever `E` is of reference type `T&&`, and this hack is basically just saying "yes, LWG understands that for this particular usage there's going to be a perfect-forwarding."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115686/new/

https://reviews.llvm.org/D115686

Files:
  libcxx/docs/Status/Cxx2bPapers.csv
  libcxx/include/CMakeLists.txt
  libcxx/include/__ranges/access.h
  libcxx/include/__ranges/all.h
  libcxx/include/__ranges/size.h
  libcxx/include/__utility/auto_cast.h
  libcxx/include/__utility/decay_copy.h
  libcxx/include/future
  libcxx/include/module.modulemap
  libcxx/include/thread
  libcxx/include/utility
  libcxx/test/libcxx/diagnostics/detail.headers/utility/auto_cast.module.verify.cpp
  libcxx/test/libcxx/diagnostics/detail.headers/utility/decay_copy.module.verify.cpp
  libcxx/test/std/ranges/range.access/range.access.begin/begin.pass.cpp
  libcxx/test/std/ranges/range.access/range.access.end/end.pass.cpp
  libcxx/test/std/ranges/range.access/range.prim/size.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115686.395162.patch
Type: text/x-patch
Size: 18843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211217/95bc286e/attachment-0001.bin>


More information about the libcxx-commits mailing list