[ADT] Remove `is_invocable` from `STLExtras.h`

As a follow-up of https://reviews.llvm.org/D132318, now that the callers have
been adjusted to use `std::is_invocable`, remove `llvm::is_invocable` and its
tests.

Differential Revision: https://reviews.llvm.org/D132321
This commit is contained in:
Joe Loser 2022-08-20 18:48:05 -06:00
parent 7e2cf2679e
commit 4a51b0c05b
2 changed files with 0 additions and 23 deletions

View File

@ -96,16 +96,6 @@ struct detector<std::void_t<Op<Args...>>, Op, Args...> {
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>

View File

@ -64,16 +64,3 @@ static_assert(is_detected<has_foo_method_t, HasFooMethod>::value,
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");