What this C++ template-knowledge question tests
This is an easy C++ question that probes your understanding of how the language handles template instantiation and code generation. It asks you to trace through a code snippet and predict its behaviour—a skill that separates candidates who can read and reason about modern C++ from those who merely memorize syntax.
The question rewards careful attention to how templates are resolved at compile time, including function overloads, type deduction, and the order in which the compiler considers candidate templates. Getting this right requires understanding that templates are not "magic"—they follow strict, deterministic rules.
- Template specialization and overload resolution
- Type deduction and substitution
- Compile-time vs. runtime behaviour in templated code