user defined literals

Trass3r un at known.com
Fri Mar 25 11:39:34 PDT 2011


>> It is indeed capable of doing that :) But it only does it if you force
>> it to (e.g. via enum z). With auto it will perform 2 opBinaryRight calls
>> at runtime.
>
> Even when you compile with -O?

Yep.
It doesn't even seem to optimize away an unused variable:

void main()
{
     auto z = 5.0 + 3*I;
}

Or I've done something wrong.


More information about the Digitalmars-d mailing list