d optimization: delegates vs. mixin

bearophile bearophileHUGS at lycos.com
Wed Oct 21 12:03:43 PDT 2009


zoli:
> Can the compiler optimize the delegates (foo) to form an inline code, or the mixin version is prefered?<

Today D compilers are in general not smart enough yet (like the Scala compiler, for example) to inline delegates. But there's an alternative to string mixins, in D2 you can pass a templated function, even one where you omit the type of the arguments :-)
There's no shortage of tricks in D2.

Bye,
bearophile



More information about the Digitalmars-d mailing list