pointer equality and inheritance

From: sb (spam_bait101_at_yahoo.com)
Date: 04/01/04


Date: 1 Apr 2004 13:28:43 -0800

Given this relationship,

class Base {
 //...
};

class Derived : public Base {
 //...
 bool myself(const void* p) { return p == this}
};

Is there a guarantee in the standard that

Derived d;
Base* p = &d;
d.myself((void*)p); // - ?

will be always true?



Relevant Pages