How is this code supposed to work?

Steven Schveighoffer schveiguy at gmail.com
Sat Jan 26 00:14:51 UTC 2019


On 1/25/19 11:19 AM, Neia Neutuladh wrote:
> On Fri, 25 Jan 2019 09:34:47 +0000, AndreasDavour wrote:
>>     auto point3 = getResponse!Point!int("What's the point? ");
> 
> This could be:
> 
>      getResponse!(Point!int)
> 
> or:
> 
>      (getResponse!Point)!int
> 
> D requires this to be disambiguated at the parsing stage, before the
> compiler works out what getResponse might be.

Interestingly, It's not possible to do the second form, so it's a bit 
curious why we don't just drop the requirements for nested parentheses...

-Steve


More information about the Digitalmars-d-learn mailing list