Why does it not compile?

Daniel Gibson metalcaedes at gmail.com
Thu Mar 24 03:55:39 PDT 2011


Am 24.03.2011 11:49, schrieb Morlan:
> I did not ask what to do to compile it. I knew that 54L would do. The problem is
> that in the example I explicitely specify the template parameter as long* so there
> is no reason for the compiler to try and guess T from the type of the function
> argument. There is something wrong here.

I agree.

void fun(long l) {}

void main() {
   long foo = 54;

   fun(42);
}

works, so that should work without an explicit cast as well.

Cheers,
- Daniel


More information about the Digitalmars-d mailing list