I used the following to write my template inside a cpp instead of the header file because i prefer to keep the code clean.
Storing C++ template function definitions in a .CPP file
In .hpp
template <class obj_class> void plotLaser(int zoom, void * obj);
In .cpp
class visualizer {...};
class annotator : public visualizer {...};
template void plotLaser<visualizer>(int zoom, void * obj) {...};
Can I use the template to call plotLaser<annotator>(...);
or do I have to rewrite it?