import std.stdio;

void myFunc(T)(in T val) {
    static if(is(T == string)) {
        writeln("string: ", val);
    }
    static if(is(T : long)) {
        writeln("long: ", val);
    }
    static if                         // WHAT HERE ?
        writeln("null");
    }
}

int main(string[] args)
{
    myFunc("abc");
    myFunc(123);
    myFunc(null);
    return 0;
}
//--------------------------------------------------
How to transfer <null> as parameter type?

Reply via email to