T... args!

Salih Dincer salihdb at hotmail.com
Thu Dec 9 00:36:29 UTC 2021


On Wednesday, 8 December 2021 at 23:47:07 UTC, Adam Ruppe wrote:
> On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer 
> wrote:
>
> I think you meant to say
>
> void foo(string[] args...) {}

Not exactly...

```d
alias str = immutable(char)[];

void foo(str...)(str args) {
   foreach(ref a; args) {
     a.writeln('\t', typeof(a).stringof);
   }
   str s; // "Amazing! ---v";
   s.writeln(": ", typeof(s).stringof);
}
```



More information about the Digitalmars-d-learn mailing list