In c++, how can I implement a function with an int template argument indicating the tuple length and produce a std::tuple with that length?
E.g.
func<
The plain old recursion is your friend:
template auto array_tuple() { return std::tuple_cat(std::tuple{}, array_tuple()); } template<> auto array_tuple<0>() { return std::tuple<>{}; }