Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++variadic templatesSingle-choice MCQ

What is the result of this code that uses a fold over the comma operator to apply a function to each pack element?

template <typename... Args> void print_all(Args&&... args) { std::size_t n = 0; ((std::cout << args << ' ', ++n), ...); std::cout << "[" << n << "]"; } int main() { print_all(10, 20, 30); }