bearophile bearophileh...@lycos.com wrote in message
news:jd6sbg$qb6$1...@digitalmars.com...
Steve Teale:
My reading of the current documentation on casts leaves me with the
impression that D now has only the equivalent of the C++ dynamic_cast.
I'd like this in Phobos:
I'll try again on this.
My reading of the current documentation on casts leaves me with the
impression that D now has only the equivalent of the C++ dynamic_cast.
This seems unreasonably restrictive given that C++ has traditional C-
style cast, dynamic_cast, static_cast, and reinterpret_cast -
On Sunday, 25 December 2011 at 08:37:21 UTC, Steve Teale wrote:
I'll try again on this.
My reading of the current documentation on casts leaves me with
the impression that D now has only the equivalent of the C++
dynamic_cast.
This seems unreasonably restrictive given that C++ has
Steve Teale:
My reading of the current documentation on casts leaves me with the
impression that D now has only the equivalent of the C++ dynamic_cast.
I'd like this in Phobos:
http://d.puremagic.com/issues/show_bug.cgi?id=5559
Bye,
bearophile
On Sun, 25 Dec 2011 08:37:21 +, Steve Teale wrote:
So what do you think is happening here?
ColorSelectionDialog csd = new ColorSelectionDialog(Choose a
Color);
writefln(csd %s, csd);
void* vp = cast(void*) csd.getColorSelection();
ColorSelection cs = cast(ColorSelection) vp;
On Sunday, 25 December 2011 at 13:39:15 UTC, Steve Teale wrote:
The segfault is presumably because Widget does not have a
setCurrentColor method, but why is the cast being ignored? Is
the compiler optimizing the intermediate cast to void away? I
don't find the asm from obj2asm helpful.
I
On Sun, 25 Dec 2011 15:01:31 +0100, Vladimir Panteleev wrote:
I don't understand. Casting a void* to a class bypasses all static type
checks. This is one of those cases where you tell the compiler that you
know what you're doing - and if you try to call a method that wasn't in
the original