[libcxx-commits] [PATCH] D107169: [libc++] Do not define views::all as a CPO since it isn't one

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 30 09:38:23 PDT 2021


ldionne added a comment.

In D107169#2916640 <https://reviews.llvm.org/D107169#2916640>, @Quuxplusone wrote:

> https://eel.is/c++draft/range.adaptor.object#2
>
>> A range adaptor object is a customization point object...

Hmm, fair enough, I missed that. However, I still stand by the fact that we don't need to use the `inline namespace` trick because we're not trying to "overload" a name that may already exist in the same namespace. In other words, `views::all` and `ranges::swap` are fundamentally different, because `views::all` is never expected to be customized by users. By the way, that makes me question why range adaptors are considered CPOs - am I missing something or do they really not need this inline namespace dance?

So I can change the commit message to not lie about `views::all` not being a CPO, but I'd still like someone to explain to me why a function object like `views::all` needs to be in an inline namespace. I understand why `ranges::swap` is, but not why `views::all` is. Anyone?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107169



More information about the libcxx-commits mailing list