Implicit conversion from null in custom type
Vladimir Panteleev via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu May 28 06:06:13 PDT 2015
On Thursday, 28 May 2015 at 12:37:52 UTC, Andrea Fontana wrote:
> What's the problem with ctor taking typeof(null)?
> I've just used it, maybe I missed something?
It doesn't work:
////////// test.d /////////
struct S
{
this(typeof(null) p) {}
}
void fun(S s) {}
void main() { fun(null); }
///////////////////////////
test.d(7): Error: function test.fun (S s) is not callable using
argument types (typeof(null))
More information about the Digitalmars-d-learn
mailing list