[PATCH] D132321: [ADT] Remove `is_invocable` from `STLExtras.h`
Joe Loser via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 21 06:57:22 PDT 2022
jloser updated this revision to Diff 454308.
jloser added a comment.
Rebase to make sure CI failure is unrelated
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132321/new/
https://reviews.llvm.org/D132321
Files:
llvm/include/llvm/ADT/STLExtras.h
llvm/unittests/ADT/TypeTraitsTest.cpp
Index: llvm/unittests/ADT/TypeTraitsTest.cpp
===================================================================
--- llvm/unittests/ADT/TypeTraitsTest.cpp
+++ llvm/unittests/ADT/TypeTraitsTest.cpp
@@ -64,16 +64,3 @@
static_assert(!is_detected<has_foo_method_t, NoFooMethod>::value,
"expected no foo method to be detected");
} // end anonymous namespace
-
-//===----------------------------------------------------------------------===//
-// is_invocable
-//===----------------------------------------------------------------------===//
-
-void invocable_fn(int);
-
-static_assert(is_invocable<decltype(invocable_fn), int>::value,
- "expected function to be invocable");
-static_assert(!is_invocable<decltype(invocable_fn), void *>::value,
- "expected function not to be invocable");
-static_assert(!is_invocable<decltype(invocable_fn), int, int>::value,
- "expected function not to be invocable");
Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -97,16 +97,6 @@
template <template <class...> class Op, class... Args>
using is_detected = typename detail::detector<void, Op, Args...>::value_t;
-namespace detail {
-template <typename Callable, typename... Args>
-using is_invocable =
- decltype(std::declval<Callable &>()(std::declval<Args>()...));
-} // namespace detail
-
-/// Check if a Callable type can be invoked with the given set of arg types.
-template <typename Callable, typename... Args>
-using is_invocable = is_detected<detail::is_invocable, Callable, Args...>;
-
/// This class provides various trait information about a callable object.
/// * To access the number of arguments: Traits::num_args
/// * To access the type of an argument: Traits::arg_t<Index>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132321.454308.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220821/8dd868c3/attachment.bin>
More information about the llvm-commits
mailing list