3 ms·
Hi, Author here - I went to lambdas because I got some compilation issues... because some stupid mistakes the code with std::apply(printImpl<Args...>, tp) didn'
by joebaf 5y ago
Hi, Author here - I went to lambdas because I got some compilation issues... because some stupid mistakes the code with std::apply(printImpl<Args...>, tp) didn't compile...
But now I see the issue and it's improved. So the version:
template <typename... Args>
void printTupleApplyFn(const std::tuple<Args...>& tp) {
std::cout << "(";
std::apply(printImpl<Args...>, tp); // <<
std::cout << ")";
}
is fine and probably the easiest