On 06/29/2014 11:04 PM, John Colvin wrote:
[...]

mixin(`alias real` ~ (real.sizeof*8).stringof ~ ` = real;`);

is more useful to me.

Be careful : this code is tricky ! real.sizeof is the storage size, ie 16 bytes on x86_64.

The following happily compiles ;-)

import std.conv: to;

mixin(`alias real` ~ to!string(real.sizeof*8) ~ ` = real;`);

static assert(real128.mant_dig == 64);

void main() {

        real128 x = 1.0;
}

Reply via email to