Is there a way to use same template function for performing operation on int and std::string, eg:
template<typename T>
T add(typename a, typename b)
{
return (a+b); // incase for int
return a.append(b); // incase for std::string
}
Any help is appreciated.
a+bwon't work for strings if a and b both are strings ?a + bfor both.