You declare a template... this makes the compiler happy.
But at link time, the calls can't be resolved as those functions have not been implemented (only called):
You have to tell the compiler that a specialization for int has to be compiled.
possible way to do it:
add
to class.cppQt Code:
template<> void Pattern::function(int a) { //code }To copy to clipboard, switch view to plain text mode
or just leave the implementation in class.hpp and save you the trouble.
(putting specializations into the .cpp will reduce code bloat, though.)




Reply With Quote

Bookmarks