From bcde6e715ef0fd2ae3e092b4104cc9c79bd73cf6 Mon Sep 17 00:00:00 2001 From: Zhihao Yuan Date: Tue, 12 Dec 2017 18:42:04 +0000 Subject: [libcxx] P0604, invoke_result and is_invocable 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. Reviewers: EricWF, mclow.lists, bebuch Reviewed By: EricWF, bebuch Subscribers: lichray, bebuch, cfe-commits Differential Revision: https://reviews.llvm.org/D38831 llvm-svn: 320509 --- .../function.objects/func.not_fn/not_fn.pass.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp') diff --git a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp index 1543f3da7d8..7601ff9d147 100644 --- a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp @@ -438,26 +438,26 @@ void throws_in_constructor_test() void call_operator_sfinae_test() { { // wrong number of arguments using T = decltype(std::not_fn(returns_true)); - static_assert(std::is_callable::value, ""); // callable only with no args - static_assert(!std::is_callable::value, ""); + static_assert(std::is_invocable::value, ""); // callable only with no args + static_assert(!std::is_invocable::value, ""); } { // violates const correctness (member function pointer) using T = decltype(std::not_fn(&MemFunCallable::return_value_nc)); - static_assert(std::is_callable::value, ""); - static_assert(!std::is_callable::value, ""); + static_assert(std::is_invocable::value, ""); + static_assert(!std::is_invocable::value, ""); } { // violates const correctness (call object) using Obj = CopyCallable; using NCT = decltype(std::not_fn(Obj{true})); using CT = const NCT; - static_assert(std::is_callable::value, ""); - static_assert(!std::is_callable::value, ""); + static_assert(std::is_invocable::value, ""); + static_assert(!std::is_invocable::value, ""); } { // returns bad type with no operator! auto fn = [](auto x) { return x; }; using T = decltype(std::not_fn(fn)); - static_assert(std::is_callable::value, ""); - static_assert(!std::is_callable::value, ""); + static_assert(std::is_invocable::value, ""); + static_assert(!std::is_invocable::value, ""); } } -- cgit v1.2.3