How is this code supposed to work?
AndreasDavour
andreas.davour at protonmail.ch
Fri Jan 25 14:25:33 UTC 2019
On Friday, 25 January 2019 at 12:11:51 UTC, AndreasDavour wrote:
> On Friday, 25 January 2019 at 12:09:34 UTC, AndreasDavour wrote:
>> On Friday, 25 January 2019 at 09:36:24 UTC, rikki cattermole
>> wrote:
>>> On 25/01/2019 10:34 PM, AndreasDavour wrote:
>>>> [...]
>>>
>>> auto point3 = getResponse!(Point!int)("What's the point? ");
>>>
>>>> [...]
>>
>> I thought about that option, if it was unclear to the parser
>> that Point!int was the type to instantiate upon. Changing to
>> the other syntax made me wonder what would happen when
>> getResponse is calling itself, which in self was something I
>> am a bit unsure of how to understand. Because we get the same
>> syntax issue there and it does not seem to work.
>
> https://run.dlang.io/is/a4oDFZ is an example of how this looks.
> I feel like there's more to these templates than meet the eye.
To clarify. I really don't understand the thinking behind these
templates, and wonder a bit about why a tutorial text like that
contains examples that doesn't compile. There must be a
conceptual unclarity somewhere I feel, not just where the
parenthesis goes.
More information about the Digitalmars-d-learn
mailing list