The ABC's of Templates in D

Mike Parker aldacron at gmail.com
Sat Aug 29 10:20:40 UTC 2020


On Saturday, 29 August 2020 at 09:18:56 UTC, Robert M. Münch 
wrote:
> A bit late... but I don't understand this part:
>
>> "Unlike x, p is not a member of the template. The 
>> type Pair is a member, so we can’t refer to it without the 
>> prefix."
>
> * Why is it not a member of the template (specification)?

The variable p is declared outside of the template. The type of p 
is a template member, it's declared inside the template, but p 
itself is not.


> * Later it is a member... of what if not of the template 
> (specification)?

I don't understand what you mean. p is not a member of anything.

>
> Confusing...




More information about the Digitalmars-d-announce mailing list