[Issue 1868] Interface pointer casts
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 1 00:53:18 PST 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1868
bugzilla at digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
------- Comment #1 from bugzilla at digitalmars.com 2008-03-01 02:53 -------
All pointer casts do is 'paint' a new type over the old one - no change in the
bits ever occurs. To get the correct change in the bits for up/down inheritance
casting, you have to cast the actual interface or class (which are reference
types).
This is working as designed. It's not a bug.
You'll see exactly the same behavior in C++ when you do things like:
I* i;
C** pc = (C**)&i;
--
More information about the Digitalmars-d-bugs
mailing list