Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-04-25 08:25:15


"Darin Adler" <darin_at_[hidden]> wrote in message
news:0D231E8E-57DB-11D6-87B5-0003935B80A2_at_bentspoon.com...
>
> On Wednesday, April 24, 2002, at 03:06 PM, Fernando Cacciola wrote:
>
> > I know as a fact that at least some version of the Borland compiler
> > (don't
> > remember which one), didn't get the fixup right without RTTI if 'base'
> > was
> > not a root type and the inheritance wasn't strictly simple.
> > Maybe this was just a compiler bug, but I've always been under the
> > impression that static casts were *guaranteed* to yield the correct
> > value
> > only when downcasting to a root type or without multiple and virtual
> > inheritance.
>
> But there's no static cast involved here, is there? This is just a
> conversion without a cast.
>
True, but what is the semantic of an implicit conversion?
In particular, if under a given circumstance, a static_cast<> yields the
wrong value, how could a conversion without a cast do it right? If the
compiler knows how to do it right for the implicit conversion (or for any
other conversion/cast without RTTI), then it would
certainly do it right for the static_cast<> too, wouldn't it?

--
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk