For example
class A {
public:
void fun(Array a);
void fun(Vector a);
/* Most codes in these two functions are same. */
/* Can certainly be merged into a template function if they were not member functions. */
}
Please note that I hope to have both these two versions of fun() in class A. Thanks.
Even if the class is not templated itself you can write a member function that is templated in the same manner that you would write a templated function that was not a method of a class.