Why not allow equality operators to operate on types?

is(==) expressions tend to create bracket noise and treat the two
arguments non-uniformly.

This would suggest a little parser update, so that eg. 'int', '(int*)'
and 'int[]' are accepted as valid expressions. (this also potentially
improves compiler error messages.)

void foo(T)(T arg){
    static if(T==int){
        ...
    }else{
        ...
    }

    static if(T!=double) ...
}

As far as I can see, this would be fully backwards-compatible.
(modulo compile-time introspection.)

Reply via email to