Empty functions

rikki cattermole rikki at cattermole.co.nz
Thu Oct 29 09:11:26 UTC 2020


On 29/10/2020 10:06 PM, Jan Hönig wrote:
> On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
>> This would mean, that this one should work as well.
> 
> It does not work as I intended, as `() => {}` has not the return type of 
> `void`.
> 
> (I don't know how to print: `ReturnType!(() => {})`)

alias RT = void function();
alias Type = RT function();

() => 7;

is equivalent to:

int func() {
	return 7;
}

Or:

() { return 7; }


More information about the Digitalmars-d-learn mailing list