Implicit conversion from null in custom type

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 28 09:50:12 PDT 2015


On Thursday, 28 May 2015 at 13:52:03 UTC, Vladimir Panteleev 
wrote:
> On Thursday, 28 May 2015 at 13:46:52 UTC, Meta wrote:
>> What about defining a static `nil` value for S?
>
> Might as well just use S.init. Again, doesn't help with 
> creating a drop-in replacement.

Yeah, it's more or less the same as init, except you have control 
over it and the struct doesn't default to it. We really do need 
some kind of implicit conversion facility when passing to and 
returning from functions, though.


More information about the Digitalmars-d-learn mailing list