On Tuesday, 12 January 2016 at 16:00:37 UTC, Daniel Kozak wrote:
V Tue, 12 Jan 2016 15:41:02 +0000
ParticlePeter via Digitalmars-d-learn
<digitalmars-d-learn@puremagic.com> napsáno:

I have a function type and variable and assign a function to it:

void function( int i ) myFunc;
myFunc = void function( int i ) { myCode; }

How would I declare an alias for void function( int i ) such that the case above would work like this:

// alias MF = void function( int i );  // not working
// alias void function( int i ) MF;  // not working

MF myFunc;
myFunc = MF { myCode };

Please, if possible, also show me where I should have found the answer (D Reference, Alis book, etc. )

alias void MF(int i);

That does not work:
alias void MF(int i);
MF mf; // Error: variable mf cannot be declared to be a function


Reply via email to