3 #ifndef DUNE_COMMON_STD_APPLY_HH 4 #define DUNE_COMMON_STD_APPLY_HH 8 #elif __cpp_lib_experimental_apply 9 #include <experimental/tuple> 28 #elif __cpp_lib_experimental_apply 36 template<
class F,
class ArgTuple, std::size_t... i>
37 decltype(
auto)
applyHelper(F&& f, ArgTuple&& args,
std::index_sequence<i...>)
39 return f(std::get<i>(args)...);
53 template<
class F,
class ArgTuple>
54 decltype(
auto)
apply(F&& f, ArgTuple&& args)
56 auto indices = std::make_index_sequence<std::tuple_size<std::decay_t<ArgTuple>>::value>();
57 return Impl::applyHelper(std::forward<F>(f), std::forward<ArgTuple>(args), indices);
65 #endif // #ifndef DUNE_COMMON_STD_APPLY_HH
decltype(auto) apply(F &&f, ArgTuple &&args)
Apply function with arguments given as tuple.
Definition: apply.hh:54
Dune namespace.
Definition: alignment.hh:10
decltype(auto) applyHelper(F &&f, ArgTuple &&args, std::index_sequence< i... >)
Definition: apply.hh:37