Enum arguments?

bearophile bearophileHUGS at lycos.com
Wed Mar 31 04:37:49 PDT 2010


> void convolve(float[N][M] mask, N, M)(float[][] a, float[][] b) {

That's quite wrong anyway. This looks a bit better:
void convolve(float[N][M] mask)(float[][] a, float[][] b) {


> You have to use an alias plus static asserts:

Or better a template constraint:

void convolve(alias mask)(float[][] a, float[][] b) if
  (__traits(isStaticArray, typeof(mask)) && __traits(isStaticArray, typeof(mask[0]))) {
    //...
}

Bye,
bearophile



More information about the Digitalmars-d mailing list