#include
using namespace std;
template class MyClass {
T x, y;
public:
MyClass(T a, T b) {
x = a;
y = b;
}
T div() { return x/y; }
};
int main()
{
MyClass d_ob(10.0, 3.0 ); // doubles.
cout << "double division: " << d_ob.div() << "\n";
MyClass i_ob(10, 3); // for ints.
cout << "integer division: " << i_ob.div() << "\n";
return 0;
}
double division: 3.33333
integer division: 3