Static array with parameter based size?

Jack Applegame via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 12 11:49:23 PDT 2017


On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
> Also what is it possible in D to write a function that accepts 
> an static array of any size?

void foo(size_t N)(ref int[N] arr) {
     ...
}

int[10] arr;
foo(arr);



More information about the Digitalmars-d-learn mailing list