CS210 Lab: Templates--Hint for Using with Visual C++
Overview:
If you try to define templates in multiple files, it is likely that you will
come across a linker error in Visual C++.
The error might be something like the following:
error LNK2019: unresolved external symbol "public: __thiscall my_class
::my_class(int,int)" (??0?$my_class@H@@QAE@HH@Z)
To get rid of this error, you need to add the following at the end of .cpp file,
so at the end of the swapperclass.cpp, add the following:
template class my_class <int>;
template class my_class <char>;
template class my_class <double>;