> void bar(int N, int M)(ref int[N][M] buf) {} But for a matrix this is often better: void bar(int N, int M)(ref int[N][M] buf) { Or even: pure void bar(int N, int M)(ref const int[N][M] buf) { Bye, bearophile