Recent posts

Where to implement C++ function templates

1 minute read

I was implementing a template function inside a class. As usual, I wrote the prototype in .h file and the definition in a .cpp file. This templated method is then called in other part of the software. When I hit the compile button, the compiler complained about an undefined reference where I called the template function.