22#ifndef RIOT_THREAD_UTILS_HPP
23#define RIOT_THREAD_UTILS_HPP
40template <
long Max,
long Pos = 0,
typename Indices =
int_list<>>
46template <
long Pos,
long... Is>
57template <
long Max,
long Pos,
long... Is>
68template <
long To,
long From = 0>
76template <
class F,
long... Is,
class Tuple>
78 ->
decltype(f(std::get<Is>(tup)...)) {
79 return f(std::get<Is>(tup)...);
86template <
class F,
class Tuple,
class... Ts>
88 ->
decltype(f(std::forward<Ts>(args)...)) {
89 return f(std::forward<Ts>(args)...);
96template <
class F,
long... Is,
class Tuple,
class... Ts>
99 ->
decltype(f(std::forward<Ts>(args)..., std::get<Is>(tup)...)) {
100 return f(std::forward<Ts>(args)..., std::get<Is>(tup)...);
106template <
class F,
long... Is,
class Tuple,
class... Ts>
109 ->
decltype(f(std::get<Is>(tup)..., std::forward<Ts>(args)...)) {
110 return f(std::get<Is>(tup)..., std::forward<Ts>(args)...);
typename il_indices< Max, Pos+1, int_list< Is..., Pos > >::type type
Append Pos to list and increment for the next step.
Creates indices from Pos to Max.
A list of integers (wraps a long... template parameter pack).
il_indices< To, From >::type get_indices()
Function to create a list of indices from From to To.
auto apply_args_suffxied(F &f, detail::int_list< Is... >, Tuple &tup, Ts &&... args) -> decltype(f(std::get< Is >(tup)..., std::forward< Ts >(args)...))
Suffix the tuple with additional arguments.
auto apply_args_prefixed(F &f, detail::int_list<>, Tuple &, Ts &&... args) -> decltype(f(std::forward< Ts >(args)...))
Prefix the argument tuple with additional arguments.
auto apply_args(F &f, detail::int_list< Is... >, Tuple &&tup) -> decltype(f(std::get< Is >(tup)...))
Apply arguments in a tuple to function.