Empty functions

rikki cattermole rikki at cattermole.co.nz
Thu Oct 29 08:48:59 UTC 2020


(Params){ FunctionBody; }

Rule: ref|opt ParameterWithMemberAttributes FunctionLiteralBody

https://dlang.org/spec/expression.html#function_literals




void function()

Is a type https://dlang.org/spec/type.html#delegates




() => {}

Is actually:

() => Expression

Rule: ref|opt ParameterWithMemberAttributes => AssignExpression

https://dlang.org/spec/expression.html#lambdas


More information about the Digitalmars-d-learn mailing list