Can You Expand Arrays into an Argument List?

Dennis dkorpel at gmail.com
Fri May 15 19:43:21 UTC 2020


On Friday, 15 May 2020 at 19:19:59 UTC, H. S. Teoh wrote:
> Here's how to do it:
>
> 	int add(int[] args...) {
> 		... // access `args` here as an array
> 	}

Beware that that language feature, typesafe variadic functions, 
might become deprecated:
https://github.com/dlang/dmd/pull/11124


More information about the Digitalmars-d-learn mailing list