12 #ifndef ESTD_APPLY_HPP_ 13 #define ESTD_APPLY_HPP_ 39 template<
typename Function,
typename Tuple, std::size_t... Indexes>
41 decltype(
estd::invoke(std::forward<Function>(
function), std::get<Indexes>(std::forward<Tuple>(tuple))...))
43 return estd::invoke(std::forward<Function>(
function), std::get<Indexes>(std::forward<Tuple>(tuple))...);
62 template <
typename Function,
typename Tuple>
63 constexpr
auto apply(Function&&
function, Tuple&& tuple) ->
64 decltype(
internal::apply(std::forward<Function>(
function), std::forward<Tuple>(tuple),
67 return internal::apply(std::forward<Function>(
function), std::forward<Tuple>(tuple),
73 #endif // ESTD_APPLY_HPP_ Collection of useful templates.
Definition: DmaChannel.hpp:121
MakeIntegerSequence< std::size_t, N > MakeIndexSequence
Generator of IndexSequence types.
Definition: IntegerSequence.hpp:212
Compile-time sequence of integers.
Definition: IntegerSequence.hpp:30
IntegerSequence template class header.
constexpr auto apply(Function &&function, Tuple &&tuple, estd::IndexSequence< Indexes... >) -> decltype(estd::invoke(std::forward< Function >(function), std::get< Indexes >(std::forward< Tuple >(tuple))...))
Implementation of apply()
Definition: apply.hpp:40
auto invoke(Function &&function, Args &&... args) -> decltype(internal::invoke(std::forward< Function >(function), std::forward< Args >(args)...))
Invokes callable object in an appropriate way.
Definition: invoke.hpp:139
constexpr auto apply(Function &&function, Tuple &&tuple) -> decltype(internal::apply(std::forward< Function >(function), std::forward< Tuple >(tuple), estd::MakeIndexSequence< std::tuple_size< typename std::decay< Tuple >::type >
Invokes callable object with a tuple of arguments.
Definition: apply.hpp:63