Variadic function with parameters all of a specific type

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jun 18 01:15:59 PDT 2016


On Friday, 17 June 2016 at 21:20:01 UTC, Timon Gehr wrote:
> void foo(T[] a...)@nogc{}
>
> void bar()@nogc{
>     foo(1,2,3);
> }

Ahh, cool. I was completely unaware of this feature.

Doc here: 
https://dlang.org/spec/function.html#typesafe_variadic_functions


More information about the Digitalmars-d-learn mailing list