On Tue, 2008-06-03 at 12:16 -0400, Alan Conway wrote:
> Robert Greig wrote:
> > 2008/6/3 Robert Greig <[EMAIL PROTECTED]>:
> > 
> >> be, well, private). It is a while since I have done any C++ but I seem
> >> to recall that Microsoft tightened up VS 2005 so that it rejected
> >> this.

As I've said elsewhere, this is not about casting to private bases at
all. The issue is about _dynamic_casting_ when private bases are
involved.

Of course the only thing that can cast to a private base is the class
itself, that's not the issue here.

> > 
> > In fact I just searched MSDN and found this page which confirms that
> > VS 2005 and later do not allow this:
> > 
> > http://msdn.microsoft.com/en-us/library/ms235606.aspx
> > 
> > RG
> 
> Yup, I'm pretty sure gcc is wrong here, except for a very confusing 
> discussion I 
> found on comp.std.c++. What is obvious though is that portable code should 
> not 
> depend on dynamic_casting to private bases.

I've no idea if gcc is wrong, but the only casting to a private base in
the code is allowed by the Sun compiler too.

The issue is about the dynamic typing not the static typing.

Andrew


> 
> 

Reply via email to