On 12.01.2016 16:41, ParticlePeter wrote:
// alias MF = void function( int i );  // not working
// alias void function( int i ) MF;  // not working

These are both fine. The first one is the preferred style.


MF myFunc;
myFunc = MF { myCode };

This line doesn't work. Function literals don't take a type before the curly braces. They have their own syntax. See http://dlang.org/spec/expression.html (search for "Function Literals").

Since most of the stuff in function literals can be inferred from the context, something as simple as this works:
myFunc = (i) { myCode };

Reply via email to