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

Why does the call `print(1, 2.0, "three")` fail to even consider the second overload below, and which is selected?

void print() {} template <typename T, typename... Rest> void print(T first, Rest... rest) { /* (1) prints first, recurses */ print(rest...); } template <typename... Args> void print(Args... args) { /* (2) */ }