[libcxx-commits] [PATCH] D96235: [libcxx] adds concepts `std::invocable` and `std::regular_invocable`

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 10 09:03:38 PST 2021

ldionne accepted this revision.
ldionne added inline comments.
This revision is now accepted and ready to land.

Comment at: libcxx/include/concepts:184
+concept invocable = requires(_Fn&& __fn, _Args&&... __args) {
+  _VSTD::invoke(std::forward<_Fn>(__fn), std::forward<_Args>(__args)...); // not required to be equality preserving
CaseyCarter wrote:
> ldionne wrote:
> > The Standard seems to say that we should call `invoke` unqualified: http://eel.is/c++draft/concept.invocable#concept:invocable.
> > 
> > This seems a bit weird to me - I assume I'm missing some context or mis-reading the paragraph prior to the concept definition?
> I suspect you're forgetting http://eel.is/c++draft/contents#3 "`meow` really means `::std::meow`". Please don't ask me why the Standard always says `std::move` / `std::forward` or my head will explode.
> Source comment: there's a weird mixture of `_VSTD::` and `std::` here - is that intended? (I have a vague notion that `std::` is used only for exceptions that are stable across ABIs or something?)
Oh, thanks.

The difference between `_VSTD::` and `std::` is unclear to me as well, to be entirely honest. Eric tried removing `_VSTD::` altogether at some point and the attempt was meant with push back by some people who use the `_VSTD` macro to completely different ends.

I think you might be mistaking this with the fact that we define exception types outside of the `__1` inline namespace so that they mangle the same as exceptions from libstdc++ (when interop between the two was necessary).

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list