DIP 1030--Named Arguments--Community Review Round 1 Discussion
Steven Schveighoffer
schveiguy at gmail.com
Fri Feb 7 05:00:16 UTC 2020
Replying to Timon's post on the feedback thread:
On 2/6/20 10:49 PM, Timon Gehr wrote:
> This introduces syntax like:
>
> import std.typecons;
> alias t=AliasSeq!(c:1, a:2, b:3); // valid according to DIP
> void foo(int a,int b,int c){
> writeln(a," ",b," ",c);
> }
>
> void main(){
> foo(t);
> }
Does it? AliasSeq's template parameter (singular) is named TList, not a,
b, or c.
So I would expect this to fail to compile.
This does bring up a valid point though. The DIP talks about variadic
parameters, but template variadic parameters actually have a name.
So what does this mean? Is it valid?
AliasSeq!(TList: 1, 2, 3)
-Steve
More information about the Digitalmars-d
mailing list