Since i cant explain this very well, i will start with a small example right away:
template <class T> void Print(const T& t){t.print1();}
template <class T> void Print(const T& t){t.print2();}
This does not compile:
error C2995: 'void Print(const T &)' : function template has already been defined
So, how can i create a template function which takes any type T
as long as that type has a print1
memberfunction OR a print2
memberfunction (no polymorphism) ?