Template params: decl vs instantiation syntax

Ellery Newcomer ellery-newcomer at utulsa.edu
Wed Oct 6 19:48:16 PDT 2010


I have accidentally inserted the bang in the template decl so many times..

There's no grammatical reason to leave it out

On 10/06/2010 09:02 PM, Nick Sabalausky wrote:
> A trivial thing, but something I've been wondering about for awhile:
>
> Function parameter syntax:
>      Declare: foo(bar)
>      Call: foo(bar)
>
> Template parameter syntax in C++/C#/etc:
>      Declare: foo<bar>
>      Instantiate: foo<bar>
>
> Template parameter syntax in D:
>      Declare: foo(bar)
>      Instantiate: foo!(bar)
>
> Why the difference in syntax between declaring and instantiating? Why not
> use the exclamation for declaration too? Would that create a grammar
> ambiguity? Some other reason? No particular reason?
>
> Obviously it's not a big issue, just curious.
>
>


More information about the Digitalmars-d mailing list