to**@donotspamme.ar wrote:
A derived class can override a method in the base class it inherits
for, and even my dog knows that. More incredibly, I know and
understand it too.
But, can a (of course virtual in this case) method be overriden in an
instance instead? For example, to provide some callbacks to a class.
No. For that you usually store pointers to [member] functions and assign
them different values based on the need, per instance.
Should I use virtual functions instead?
Instead of what? Instead of virtual functions? Uh... Yes!.. I mean,
no... I mean... Could you rephrase, please?
How do I pass the this pointer
when casting it from or to in any useful way seems to break every C++
language rule? As a normal parameter? But then it doesn't really look
so OOP anymore.
Huh? I think I don't understand (where does it place me relative to
your dog?), could you give an example in C++?
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask