Hi,
I'm trying to cast from one generic to another, say:
myClass<MoreAbstract> anItem = myclass<DerivateFromMoreAbstract> anotherObject;
Or do something like
aFunction(anotherObject); // myclass<DerivateFromMoreAbstract> anotherObject
where aFunction signature is
aFunction(myClass<MoreAbstract> item);
In fact, myClass is actually a simplified implementation of shared_ptr I found online. I'm wondering if there's any way I can actually switch from one pointer type to another being encapsulated.
Is there any way to do such casting? If so, what would be the correct way to do it?
If it helps anyone, VC++ gives me this error:
Error 1 error C2440: 'type cast' : cannot convert from 'myClass<T>' to 'myClass<T>'