I have a simple question related to function template. Assuming I have a header containing a class with a template method called f
:
class test
{
public:
template < class T > void f(T t) {}
};
If this header is included in several .cpp files, and each of these .cpp calls f
with the same type (let's say int), can I take the pointer of the function somewhere else in the code? Considering there are potentially several definitions, will the linker keep only one?