How does this template work?

aliak something at something.com
Mon Jun 17 20:53:28 UTC 2019


On Monday, 17 June 2019 at 18:25:24 UTC, Robert M. Münch wrote:
> On 2019-06-16 15:14:37 +0000, rikki cattermole said:
>
>> observerObject is an eponymous template.
>> 
>> What this means (in essence) is the symbol inside the template 
>> block == template block.
>
> Hmm... ok. Is there any reason to have these "eponymous 
> templates"? I don't see any benefit...

Less typing for one. Otherwise you'd have to write:

auto observer = observerObject!int.observerObject(TestObserver());




More information about the Digitalmars-d-learn mailing list