Is there a way to use a template with a function prototype specified in a class definition, the definition of which is found in another cpp file? Example
TEST.h
class TEST {
public:
TEST()=default;
template <class test_name>
test_name func();
private:
...
}
TEST.cpp
template <class test_name>
test_name func() {
...
}
As far as I know, the template cannot be used with function prototypes, it is necessary to define the function. But why? What are the benefits of this approach?