I’m running into an issue with a variadic function template. I need to examine each element of a parameter pack, package the element, then stuff all the packaged elements into a tuple and return that. Here’s the general idea of what I’d like to do (return types are just placeholders, not sure what they’d be):
template<typename A>
sometype func_helper(A a) {
//examine a, depending on type, do different stuff with it.
return modified_a;
}
template<typename... Args>
tuple<sometypes...> func(Args... args) {
return make_tuple(func_helper...(args));
}
Any ideas?
You can use deduced return type. Sadly it has code reduplication: