Skip to main content Link Search Menu Expand Document (external link)

Function Templates vs Regular Functions Quiz

Question

Why are there 3 fooNonTemplate functions and no fooTemplate in the executable?

Because the fooNonTemplate is called 3 times, while fooTemplate is never called

The compiler only instantiates those templates that are actually used. It creates as many instances as there different argument types with a template function is called.

Because the compiler instantiates all non-template functions, but only the used template functions

Correct!