I read few questions here on SO about this topic which seems yet confusing to me. I\'ve just begun to learn C++ and I haven\'t studied templates yet or operator overloading
As stated before, templates are overkill in this case, but it is still an option worth mentioning.
class My { public: template T get(int); }; template<> int My::get(int); template<> char My::get(int);