3 #ifndef DUNE_COMMON_STD_APPLY_HH 4 #define DUNE_COMMON_STD_APPLY_HH 6 #if DUNE_HAVE_CXX_APPLY 8 #elif DUNE_HAVE_CXX_EXPERIMENTAL_APPLY 9 #include <experimental/tuple> 24 #if DUNE_HAVE_CXX_APPLY 28 #elif DUNE_HAVE_CXX_EXPERIMENTAL_APPLY 38 template<
class F,
class ArgTuple, std::size_t... i>
39 decltype(
auto) applyHelper(F&& f, ArgTuple&& args, std::index_sequence<i...>)
41 return f(std::get<i>(args)...);
57 template<
class F,
class ArgTuple>
58 decltype(
auto)
apply(F&& f, ArgTuple&& args)
60 auto indices = std::make_index_sequence<std::tuple_size<std::decay_t<ArgTuple>>::value>();
61 return Impl::applyHelper(std::forward<F>(f), std::forward<ArgTuple>(args), indices);
69 #endif // #ifndef DUNE_COMMON_STD_APPLY_HH decltype(auto) apply(F &&f, ArgTuple &&args)
Apply function with arguments given as tuple.
Definition: apply.hh:58
Dune namespace.
Definition: alignedallocator.hh:9