"Judith" <ju*****@inet.co.za> wrote in message news:4d**************************@posting.google.c om...
GCC complains with "passing 'B**' as argument 1 of 'foo(A**)'"
Upcasting through one level of reference is most common, why is this different?
Didn't we just answer this (look around on the group).
class Base { };
class Derived : public Base { };
Base b, *bp, **bpp;
Derived d, *dp, **dpp;
dp = &d;
bp = dp; // fine, we know how to convert from Derived* to Base* and can do so in this operation.
bpp = &dpp; // we convert from Derived** to Base** ok, but how does the value *dpp get converted
// to *bpp?
It's not a safe conversion because the compiler at the time *bpp is used doesn't know
what conversion might be needed to apply to the value to make it really a Base* value.