Sunday, January 27, 2013

C++ Templates: Separating declaration from implementation

I found out the hard way that it isn't as easy to separate declaration and implementation of template classes (via .h and .cpp files) as it is for regular classes. In fact, it's not even possible to do so. The following questions and answers on StackOverflow shed some light on why this limitation exists: