#include using namespace std; //Clasa template template class myPair { private: T a, b; //Atribute de tip T public: myPair(T first, T second) { a = first; b = second; } //Constructor cu parametrii T getMax(); //Functie template }; template T myPair::getMax() { return (a > b) ? a : b; } int main () { myPair Obj(100, 75); cout << Obj.getMax() << endl; //Se va afisa 100 return 0; }