Issue with
g++ and template classes (other than STL classes).
The g++ compiler still has difficulty with user-defined template
classes. (The STL appears to be implemented perfectly and just work.)
To make g++ happy, and avoid multiple definitions, etc:
Files using the templated class (e.g., the one containing main)
#include both "class.h" AND "class.cpp"
This forces template instantiation at the right time.
No big deal for getting student projects to work. (Possible show
stopper in big 100,000+ LOC industrial project with zillions of
files).
NOTE: header file of templated class does NOT include the code file.
(That would lead to multiple definition problems.)