Actual code for a template function is generated when —
2022
Actual code for a template function is generated when —
- A.
the function declaration appears in the source code
- B.
the function definition appears in the source code
- C.
a call to the function appears in the source code
- D.
the function is executed at runtime
Attempted by 195 students.
Show answer & explanation
Correct answer: C
C++ templates are instantiated only when the function is called , not when declared or defined.