How do I pass multidimensional static arrays to functions expecting dynamic arrays?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Aug 29 18:43:39 PDT 2011


Right, but I was just trying to temporarily avoid GC allocation so
I've used a static array instead of a dynamic ones. Also, I don't know
of another term that is used to describe a int[][] array, other than
multidimensional.

Anyway this works fine for me (int wasn't a requirement in this case):

void foo(T)(T val) if (isArray!T)
void bar(T)(T val) if (isArray!T && isArray!(ElementType!T))


More information about the Digitalmars-d-learn mailing list