Say you have a templated class:
And you want to declare two myClass objects something like this:Code:template <typname T> class myClass { ... };
And you want to be able to assign and compare the two objects...Code:int main(void) { myClass<int> intMyObj; myClass<short> shortMyObj; }
i.e.:
obviously involves operator overloading, but how do you make the two types compatible?Code:intMyObj+=shortMyObj;