Monday 8 March 2010

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.

No comments:

Post a Comment