[cxx-abi-dev] trivial __dynamic_cast fails?
David Baraff
deb at pixar.com
Mon Mar 1 16:05:05 UTC 2004
Begin forwarded message:
> From: David Abrahams <dave at boost-consulting.com>
> Date: March 1, 2004 4:36:28 AM PST
> To: David Baraff <deb at pixar.com>
> Cc: Daveed Vandevoorde <daveed at edg.com>, cxx-abi-dev at codesourcery.com,
> Daniel Wallin <dalwan01 at student.umu.se>
> Subject: Re: [cxx-abi-dev] trivial __dynamic_cast fails?
>
> David Baraff <deb at pixar.com> writes:
>
>>>
>> David Abrahams wrote:
>>> I think it's probably more widely neededthan you'd guess, at the
>>> boundary between statically and dynamically-typed systems. I doubt
>>> anyone else has had the insanity to try to simulate it in conforming
>>> code,
>>
>> I did it in standards-conforming code, so either doing it made me
>> insane, or I am insane for doing it...
>
> Didn't you say that you were computing byte offsets for Base <-->
> Derived translations?
No, I instantiate a function templated on Base and Derived which does
the cast.
( I was thinking of caching the offset after the first time I found it.
That would be non-portable I guess.)
> If these classes can be non-POD, that's not
> portable according to the standard.
>
> Incidentally, my system stores those offsets as an optimization for
> all platforms that can handle it (which so far is everything) but if
> you want to be strict about portable conformance you have to walk
> through the cast graph.
>
I do, so I end up calling the synthesized cast functions several times
in a single cast.
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
More information about the cxx-abi-dev
mailing list