What this C++ template instantiation question tests
This is an easy C++ language-knowledge question that probes understanding of template instantiation and how the compiler resolves template definitions. It is the kind of question Google uses to ensure candidates have solid fundamentals in C++ template mechanics, not just library usage.
To answer correctly, you need to trace through the template definition, understand how arguments are substituted, and predict what code the compiler will generate. The question rewards careful reading of the code and mental execution—no external tools needed, but attention to detail is essential.
- Template parameter substitution
- Template specialization and overload resolution
- Compiler code generation from templates