[libcxx-commits] [PATCH] D99041: [libcxx] moves `std::invoke` into `__functional_base`

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 21 15:49:08 PDT 2021


zoecarver added a comment.

In D99041#2640306 <https://reviews.llvm.org/D99041#2640306>, @cjdb wrote:

> In D99041#2640282 <https://reviews.llvm.org/D99041#2640282>, @Quuxplusone wrote:
>
>> - I'd like your opinion (and maybe @tcanens too?) on whether libc++  could just use `_VSTD::__invoke` inside all the invocable concepts, instead of `_VSTD::invoke`. Using `__invoke` wouldn't help much AFAICT. It would //very slightly, negligibly// lessen the compile-time burden, and it would reduce the coupling between these concepts and the rest of the C++17 library. (This would merely help libc++ support a "C++14 plus concepts" mode, which is a crazy and pointless idea.) But I'm still wondering whether it would hurt.
>
> Considered this, but chickened out because a change to `invoke` might not reflect updates to `invocable` without manual intervention. I'd prefer to keep concepts verbatim, even though I strongly suspect any changes to `invoke` will likely go through //`INVOKE`// Also note that @ldionne has strong opinions on keeping things as close to wording as possible.

If there are updates to invocable, then I assume we'd add new tests to reflect the change. Either the tests would pass, in which case we could keep using `__invoke` or they wouldn't and we'd update it then. Also, `std::invoke` is a one-liner that just calls `__invoke`, so I think we're OK.

That being said, I don't really see what we're getting from this change. Is it just that `<concepts>` would stop relying on `<functional>` (which very well might be worth it)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99041



More information about the libcxx-commits mailing list