string <-> null/bool implicit conversion

ponce via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 23 11:14:47 PDT 2015


On Thursday, 20 August 2015 at 16:45:18 UTC, Márcio Martins wrote:
> Hi!
>
>
> string a = "";
> string b;
>
> writeln(a ? "a" : "null");
> writeln(b ? "b" : "null");
>
>
> This program outputs:
> a
> null
>
>
>
> What?
>
> I suppose this is by design, but are there any plans to 
> deprecate this?

Sounds correct to me.




More information about the Digitalmars-d mailing list