72 static_assert(
sizeof...(Cs) > 0);
74 template<std::
size_t N>
75 using state_type_n =
typename std::tuple_element<N, std::tuple<
typename Cs::state_type...>>::type;
77 template<std::
size_t N>
78 using input_type_n =
typename std::tuple_element<N, std::tuple<
typename Cs::input_type...>>::type;
80 using state_type = state_type_n<
sizeof...(Cs) - 1>;
81 using input_type = input_type_n<0>;
82 using params_type = std::tuple<
typename Cs::params_type...>;
84 std::tuple<Cs...> controllers_;
90 : controllers_(std::forward<Cs>(cs)...) {}
96 : controllers_(std::apply(
97 [](auto&&... ps){
return std::make_tuple(Cs(std::forward<
decltype(ps)>(ps))...); },
107 auto current_input = input;
108 std::apply([&](
auto&... ctrls){
109 ((ctrls.update(current_input),
110 current_input = ctrls.state()), ...);
118 return std::get<
sizeof...(Cs) - 1>(controllers_).state();