[libcxx-commits] [PATCH] D116569: [libc++] [ranges] Add namespace __cpo to ranges::{advance, next, prev}.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 3 17:53:33 PST 2022


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

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.

This makes these three niebloids more consistent with the other Ranges niebloids we've already implemented, such as `ranges::begin` and `ranges::uninitialized_default_construct`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116569

Files:
  libcxx/include/__iterator/advance.h
  libcxx/include/__iterator/next.h
  libcxx/include/__iterator/prev.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116569.397168.patch
Type: text/x-patch
Size: 13893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220104/4ae34fc7/attachment.bin>


More information about the libcxx-commits mailing list