Skip to content

Commit

Permalink
Much simpler is_tuple_invocable_with_filtered implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
caugonnet committed Jan 3, 2025
1 parent c667083 commit ca7fe92
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions cudax/include/cuda/experimental/__stf/internal/void_interface.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -152,34 +152,9 @@ public:
/**
* @brief Check if a function can be invoked using std::apply while eliding tuple arguments with a void_interface type.
*/
template <typename Fun, typename Tuple>
struct is_tuple_invocable_with_filtered
{
private:
using filtered_tuple_t = remove_void_interface_from_tuple_t<Tuple>;

template <typename F, typename T>
static auto test(int) -> ::std::bool_constant<reserved::is_tuple_invocable_v<F, T>>
{
return {};
}

template <typename F>
static auto test(...) -> ::std::false_type
{
return {};
}

template <::std::size_t... Idx>
static auto check(::std::index_sequence<Idx...>)
{
return test<Fun, ::std::tuple_element_t<Idx, filtered_tuple_t>...>(0);
}

public:
static constexpr bool value =
decltype(check(::std::make_index_sequence<::std::tuple_size_v<filtered_tuple_t>>{}))::value;
};
template <typename F, typename Tuple>
struct is_tuple_invocable_with_filtered : is_tuple_invocable<F, remove_void_interface_from_tuple_t<Tuple>>
{};

/**
* @brief Strip tuple entries with a "void_interface" type
Expand Down

0 comments on commit ca7fe92

Please sign in to comment.