I thought we could leave off ()

Adam D. Ruppe destructionator at gmail.com
Thu Oct 17 11:32:32 UTC 2019


On Thursday, 17 October 2019 at 10:50:52 UTC, Brett wrote:
> 			auto n = (){ return Z[0]; };

that's a pointer, the optional () rule only applies to direct 
functions, not pointers/delegates.

so do

auto n () { return Z[0]; }

n.X

no assignment means function instead of pointer/delegate


More information about the Digitalmars-d-learn mailing list