[libcxx-commits] [PATCH] D102020: [libcxx][ranges] Add class ref_view.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 4 13:00:50 PDT 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.ref.view.pass.cpp:98-105
+template<class R>
+concept EmptyInvocable = requires (std::ranges::ref_view<R> view) { view.empty(); };
+
+template<class R>
+concept SizeInvocable = requires (std::ranges::ref_view<R> view) { view.size(); };
+
+template<class R>
----------------
zoecarver wrote:
> Quuxplusone wrote:
> > Naming nit: `EmptyIsInvocable`, or `HasEmpty`; but let's avoid any potential confusion with the jargon use of `Invocable` as a noun. I'd go with `HasEmpty`, myself; it's shortest.
> We're not really asking if the member exists, it always does exist. We're asking whether we can call/invoke it. Also, I don't really see how `EmptyIsInvocable` is any better than `EmptyInvocable`. (Not done.)
> Also, I don't really see how EmptyIsInvocable is any better than EmptyInvocable.

As I said, it's better in that it avoids (confusion with) the jargon use of "invocable" as a noun. I understand what `regular_invocable<R>` means, but what is `EmptyInvocable<R>`? What is an "empty invocable"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102020



More information about the libcxx-commits mailing list