This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] P0604, invoke_result and is_invocable
ClosedPublic

Authored by K-ballo on Oct 11 2017, 4:47 PM.

Details

Summary

Introduce a new form of result_of without function type encoding.

Rename and split is_callable/is_nothrow_callable into is_invocable/is_nothrow_invocable/is_invocable_r/is_nothrow_invocable_r (and associated types accordingly)

Change function type encoding of previous is_callable/is_nothrow_callable traits to conventional template type parameter lists.

Diff Detail

Repository
rL LLVM

Event Timeline

K-ballo created this revision.Oct 11 2017, 4:47 PM
K-ballo updated this revision to Diff 119764.Oct 21 2017, 10:02 AM

Fix synopsis

EricWF accepted this revision.Nov 6 2017, 6:39 PM

LGTM. Thanks.

@K-ballo I always forget. Do you have commit access?

This revision is now accepted and ready to land.Nov 6 2017, 6:39 PM

@K-ballo I always forget. Do you have commit access?

I do not. It's all yours.

bebuch accepted this revision.Dec 12 2017, 1:19 AM
bebuch added a subscriber: bebuch.

Please commit!

[...]test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp:118:9: error: static_assert failed due to requirement '!std::is_nothrow_invocable_r_v<int, Fn>' ""
        static_assert(!std::is_nothrow_invocable_r_v<int, Fn>, "");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
--

with Clang-5.0 and trunk. Can you reproduce?

bebuch rescinded a token.
[...]test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp:118:9: error: static_assert failed due to requirement '!std::is_nothrow_invocable_r_v<int, Fn>' ""
        static_assert(!std::is_nothrow_invocable_r_v<int, Fn>, "");
        ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
--

with Clang-5.0 and trunk. Can you reproduce?

I can reproduce.

It seems the intention was to match the tests from the previous section, so an extra int argument would be missing. I'll take care of it.

K-ballo updated this revision to Diff 126545.Dec 12 2017, 6:52 AM

Fixed incorrect test case.

This revision was automatically updated to reflect the committed changes.

That commit message generated from arc wasn't all that friendly :/
Thanks for the patch, and @K-ballo you should ask Chris for a commit bit :)

libcxx/trunk/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp