I'm trying to drop from one pedigree to another, say:
myClass<MoreAbstract> anItem = myclass<DerivateFromMoreAbstract> anotherObject;
Or do something like
aFunction(anotherObject);
where is the function signature
aFunction(myClass<MoreAbstract> item);
In fact, myClass is actually a simplified implementation of shared_ptr that I found on the Internet. I am wondering if it is possible in some way to switch from one type of pointer to another, which will be encapsulated.
Is there any way to do this casting? If so, what would be the right way to do this?
If this helps someone, VC ++ gives me this error:
Error 1 error C2440: 'type cast' : cannot convert from 'myClass<T>' to 'myClass<T>'
tomzx source
share