Assume I have a std::tuple
, I'd like to write a function which receives a tuple and a variadic sequence outputting a subtuple containing the columns corresponding to those indexes.
Example usecase:
std::tuple<int, char, float, std::string> t{1, 'd', 3.14, "aaa"};
auto subtuple = extract_subtuple(t, 0, 2);
// returns std::tuple<int, float>(1, 3.14)
Is this possible ?
I had a look at this other question but in the end I didn't find what I was looking for.