Pretty please: Named arguments

Steven Schveighoffer schveiguy at yahoo.com
Mon Feb 28 07:02:43 PST 2011


On Mon, 28 Feb 2011 09:55:54 -0500, Michel Fortin  
<michel.fortin at michelf.com> wrote:

> On 2011-02-28 09:34:30 -0500, spir <denis.spir at gmail.com> said:
>
>> So, let's use ':'.
>
> Note however that ':' already has a meaning in templates arguments.  
> Using ':' for named function arguments would preclude having named  
> template arguments (or force template arguments to use yet another  
> syntax).

I think you are confusing template declarations with template  
instantiations.  ':' is not used in instantiations (that I know of)

e.g. the usage would be:

template foo(T = int, U = string) {...}

foo!(U : int)...;

-Steve


More information about the Digitalmars-d mailing list