Casting Pointers?

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Thu May 12 15:23:38 PDT 2016


Am Thu, 12 May 2016 09:32:17 +0000
schrieb Rene Zwanenburg <renezwanenburg at gmail.com>:

> In this case, you can use a union:
> 
> union DL
> {
> 	double d;
> 	long l;
> }
> 
> auto dl = DL(1.0);
> writeln(dl.l);

The pointer cast solution is specifically supported at CTFE,
because /unions/ don't work there. :p

-- 
Marco



More information about the Digitalmars-d mailing list