Optimize away immediately-called delegate literals?

Nick Sabalausky a at a.a
Sat Mar 10 22:29:01 PST 2012


Suppose you have a delegate literal and immediately call it:

auto a = x + (){ doStuff(); return y; }() + z;

Does DMD ever (or always?) optimize away a delegate if it's executed 
immediately and never stored into a variable? If not, can it, and would it 
be a simple change? Is something like this already on the table?




More information about the Digitalmars-d mailing list