Thanks for replying. I am confused with your second example, shouldn't it be the other way around like in the first example? My understanding is that it is allowed to point to a child class where a parent type is expected but not the other way around?

I think your example is of no use to me, because in my case the pointer to be checked is not known. More specifically, the reference to be checked (which is initally defined as a reference to a base class) can be referenced to any child class at the implementation and the compiler will be happy about it:

At this point what I want is to ensure that the developer has supplied a child class (case 2) and generate an error if otherwise. That is why my intention is to confirm whether rReferenceToBeChecked is a subclass of a CLS_BaseClass.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum