Why must templates usually be defined in header files?
- A The compiler needs the definition at each point of instantiation
- B Headers compile faster
- C It is a style convention only
- D Linkers cannot handle templates
Answer
The compiler needs the definition at each point of instantiation
Each instantiation generates separate code, so the definition must be visible. This is why standard library headers are so large.





