Templated class

For some reason unbenknownst (that’s an awesome word) to me, templated classes must not only be declared, but defined, in header files rather than C++ files. I assume this is becasue templating is done at compile time, and the compiler does not have access to other C++ files, that is done with the linker.
The upshot of this is that whenever modifying the functions in this, a compile of every other C++ file that sues this header has to be done. This slows down development time significantly. I can take long compiles, but it’s annoying when I’m only making small changes in one file.

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *