[libcxx-commits] [PATCH] D116384: [libc++] Eliminate `__function_like`.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Dec 29 12:02:01 PST 2021


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

As prefigured in the comments on D115315 <https://reviews.llvm.org/D115315>.

In the test files, replace the old-style tests with a simple `static_assert`, matching the current style as depicted in e.g. `libcxx/test/std/utilities/memory/specialized.algorithms/uninitialized.construct.default/ranges_uninitialized_default_construct.pass.cpp`.

This gives us one unified style for all niebloids, simplifies the tests, and also simplifies the modulemap: it's important that we do this simplification before the modulemap gets completely out of hand.

Also normalize the indentation of `inline namespace __cpo`.

I'll plan a followup PR to fix the remaining TODOs, i.e. to rename `__advance_fn`, `__next_fn` `__prev_fn` to `__advance::__fn`, `__next::__fn`, `__prev::__fn`. The reason for those nested namespaces is explained in D115315 <https://reviews.llvm.org/D115315>:

> AIUI, this keeps the CPO's own type from ADL'ing into the `std::ranges` namespace; e.g. `foobar(std::ranges::uninitialized_default_construct)` should not consider `std::ranges::foobar` a candidate, even if `std::ranges::foobar` is not a CPO itself.
> Also, of course, consistency (Chesterton's Fence, the economist's hundred-dollar bill): if it were safe to omit the namespace, we'd certainly want to do it everywhere, not just here.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116384

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__function_like.h
  libcxx/include/__iterator/advance.h
  libcxx/include/__iterator/next.h
  libcxx/include/__iterator/prev.h
  libcxx/include/__memory/ranges_uninitialized_algorithms.h
  libcxx/include/module.modulemap
  libcxx/test/libcxx/diagnostics/detail.headers/function_like.h.module.verify.cpp
  libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.advance/special_function.compile.pass.cpp
  libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.next/special_function.compile.pass.cpp
  libcxx/test/std/iterators/iterator.primitives/range.iter.ops/range.iter.ops.prev/special_function.compile.pass.cpp
  libcxx/test/support/test_standard_function.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116384.396563.patch
Type: text/x-patch
Size: 27590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211229/2714d365/attachment-0001.bin>


More information about the libcxx-commits mailing list