D lang newbie ..what does syntax func_name !() represent ??

Andy Balba pwplus7 at gmail.com
Sat Jul 25 01:39:00 UTC 2020


On Saturday, 25 July 2020 at 00:42:04 UTC, Adam D. Ruppe wrote:
> On Saturday, 25 July 2020 at 00:36:19 UTC, Andy Balba wrote:
>> I keep running into statements like  `func_name!()`
>> and cant figure out what !() could possibly mean .
>
> That's a template instance, like foo<int> in C++.
>
> Though D can pass a lot more than just types to its templates 
> so you might see like foo!"bar" too, but it is the same idea - 
> passing that string as a template argument to foo.
>
> BTW if there is just one simple argument, you can leave the 
> parentehsis out like I did there.

many thanks


More information about the Digitalmars-d mailing list