How to declare an alias to a function literal type

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 12 09:34:00 PST 2016


On 12.01.2016 17:55, ParticlePeter wrote:
> When I pass a parameter to otherFunc I use this syntax for an anonymous
> function parameter:
>
> otherFunc( void function( ref int p1, float p2, ubyte p3 ) { myCode; } );

You don't. That's not valid code. You can be using this:

otherFunc( function void ( ref int p1, float p2, ubyte p3 ) { myCode; } );

Note the different position of the `function` keyword.


More information about the Digitalmars-d-learn mailing list