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

Why does this attempt to index a parameter pack fail to compile?

template <typename... Ts> auto first(Ts... ts) { return ts[0]; // intend to get the first pack element }