Named Value Sequence

Walter Bright newshound2 at digitalmars.com
Tue Jan 9 00:55:20 UTC 2024


On 1/5/2024 1:48 AM, Dennis wrote:
> ## Named value sequence?
> 
> So if we can't implicitly give a `T...` names, can we explicitly? We already saw 
> a `__parameters` type tuple can have names, this could be expanded to value 
> sequences:
> 
> ```D
> logAndCall!f(args: AliasSeq!(y: 1, x: 0));
> ```
> 
> This syntax is ambiguous with named template parameters however: According to 
> DIP 1030, this should try to set template parameters `y` and `x` of the 
> `AliasSeq` template. Is there a way to make forwarding named arguments work?

Make that an error and leave it to some future design.



More information about the Digitalmars-d mailing list