On Wednesday, 17 June 2015 at 20:06:54 UTC, Alex Parrill wrote:


Try:

void foo(T)(T[] arg) {
// In here, T should be the element type, and T[] the array type.
}

Not a general solution, but you mentioned that you wanted this for a function parameter.

I don't think this works for multi-dimensional arrays. I tried

void foo(T)(T[] arg)
        if (isArray!(T[]) && is(T == real))
{
    writeln("foo has run for ", arg);
}

and it only worked on the one-dimensional one.

Reply via email to