Currently, I have an implementation like this in order to transform all values of a tuple using a function bar() that takes in each element of the tuple.
template<typename ... Args>
void foo(const std::tuple<Args...>& a)
{
std::tuple<Args...> transformedTuple = std::make_tuple(bar(std::get<Args>(a))...);
}
The problem with this is that this will no longer work if Args contains duplicate types. Hence, I would like to change the std::get<> call to use numerical indices into the tuple instead of using types. Given that my development environment is stuck on C++14, is there any way of getting this to work? Thanks!