Sunday 8 December 2019

c++ - Template functions in cpp

I am coding c++ in visual studio 2015. I have files called superpixel.h and superpixel.cpp. I wanted to use templates for some of the functions but I read that I cant define templates in cpp files. I don't want to define the templates in the header file because it will just make my code messy with definitions in header and cpp files.




Is there a work around to this ? Do I have to switch all my cpp files to hpp ?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...