 |
|
|
|
Actions
|
|
[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [cxx-abi-dev] trivial __dynamic_cast fails?
- To: David Abrahams <dave@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [cxx-abi-dev] trivial __dynamic_cast fails?
- From: David Baraff <deb@xxxxxxxxx>
- Date: Mon, 1 Mar 2004 08:05:05 -0800
Begin forwarded message:
From: David Abrahams <dave@xxxxxxxxxxxxxxxxxxxx>
Date: March 1, 2004 4:36:28 AM PST
To: David Baraff <deb@xxxxxxxxx>
Cc: Daveed Vandevoorde <daveed@xxxxxxx>, cxx-abi-dev@xxxxxxxxxxxxxxxx,
Daniel Wallin <dalwan01@xxxxxxxxxxxxxx>
Subject: Re: [cxx-abi-dev] trivial __dynamic_cast fails?
David Baraff <deb@xxxxxxxxx> 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
|
|