betterC question

rikki cattermole rikki at cattermole.co.nz
Thu Nov 19 00:18:54 UTC 2020


On 19/11/2020 1:11 PM, Dibyendu Majumdar wrote:
> On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe wrote:
>> On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu Majumdar wrote:
>>> int function() fp = test;
>>
>> This tries to *call* the function test and assign its return value to fp.
>>
> 
> Really? why does it do that?

You don't need the brackets to call a function (and with a little help 
from UFCS):

void main() {
	import std.stdio;
	
	"Hello!".writeln;
	writeln;
}


More information about the Digitalmars-d-learn mailing list