#include #include using namespace std; //creating explicit function tempate specializations // Function template prototype template T myFunct1(T &a, T &b); // Specialization for int,double and string data types template<>int myFunct1(int &a, int &b); template<>double myFunct1(double &a, double &b); template<>string myFunct1(string &a, string &b); int main() { int n1 =12; int n2 = 24; double d1= 24.25; string str1= "Hello", str2 = " World"; cout<< " Integer Special : " << myFunct1(n1, n2)<< endl; cout<< " double Special : " << myFunct1(d1, d1)<< endl; cout<< " string Special : " << myFunct1(str1, str2)<< endl; return 0; } template<> int myFunct1(int &a, int &b){ int n3 = a>b ? a : b; cout << "\n Integer Data Type : " << n3 ; return a>b ? a : b; } template<> double myFunct1(double &a, double &b){ cout << "\n Double Data type : "; return (a+b); } template<> string myFunct1(string &a, string &b){ cout << "\n String Data Type : "; return (a+b); }