Skip to content

Commit

Permalink
♻️ fixed index_apply's tparam argument deduction
Browse files Browse the repository at this point in the history
  • Loading branch information
lamarrr committed Dec 5, 2024
1 parent 5d78d88 commit 6b1cacf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions ashura/std/tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,15 @@ constexpr decltype(auto) apply(F && f, Tuple && t)
template <typename F, usize... I>
constexpr decltype(auto) impl_index_apply(F && f, std::index_sequence<I...>)
{
return f.template operator()<I...>();
return static_cast<F &&>(f).template operator()<I...>();
}

template <typename F, usize N>
template <usize N, typename F>
constexpr decltype(auto) index_apply(F && f)
{
return impl_index_apply(static_cast<F &&>(f), std::make_index_sequence<N>{});
}

template <typename F, typename... Tuples>
constexpr decltype(auto) zip_apply(F && f, Tuples &&... tuples)
{
// [ ] impl
// apply over Index
}

template <usize I, typename Tuple, typename... In>
constexpr decltype(auto) impl_fold_reduce(Tuple & fns, In &&... in)
{
Expand Down

0 comments on commit 6b1cacf

Please sign in to comment.