Why does it not compile?

bearophile bearophileHUGS at lycos.com
Thu Mar 24 03:44:17 PDT 2011


Morlan:

> ...

This compiles, 54 is an int:

import std.stdio;

void Foo(T: T*)(T arg) if(!is(T == int)) {
    writeln("Arg of Foo: ", arg, " ", typeid(T));
}

void Foo(T: T*)(T arg) if(is(T == int)) {
    writeln("int Foo!");
}

void main() {
  Foo!(long*)(54L);
}

Generally for questions like this, there is the D.learn newsgroup.

Bye,
bearophile


More information about the Digitalmars-d mailing list