A
Anargyros L. Papadopoulos
given:
class A {
// ...
};
class B : public class A {
// ...
}
void some_fun()
{
B b;
A *pa = &b;
B *pb = &b;
if ((void *)pa == (void *)pb) {
;
} else {
// is it possible ??
;
}
}
is it guarantee (from the standard), assuming single inheritance, that it is
impossible to reach the else statement in the above code?
class A {
// ...
};
class B : public class A {
// ...
}
void some_fun()
{
B b;
A *pa = &b;
B *pb = &b;
if ((void *)pa == (void *)pb) {
;
} else {
// is it possible ??
;
}
}
is it guarantee (from the standard), assuming single inheritance, that it is
impossible to reach the else statement in the above code?