개요
Template Classes/Functions
- Templates are more complex because their actual code is not generated until the template is instantiated with specific types. This instantiation typically happens in the files that use the template.
Key Points
- The compiler needs the complete template definition to instantiate it.
- If the definition is not visible at the point of instantiation, the compiler cannot generate the necessary code.
Templates require the full definition to be available at the point of instantiation, which is why their implementation is typically included in the header file.
Reference
https://hwan-shell.tistory.com/253