just an idea (!! operator)

Daniel Murphy yebblies at nospamgmail.com
Thu Jul 12 09:24:08 PDT 2012


"Jonas Drewsen" <jdrewsen at nospam.com> wrote in message 
news:zwtvliaunccmtwmabxfz at forum.dlang.org...
>
> auto a = foo ?? new Foo();
>
> is short for:
>
> auto a = foo is null ? new Foo() : foo;
>
> /Jonas
>

Yeah, I've been planning to try and get this into D one day.  Probably 
something like:
(a ?: b) -> (auto __tmp = a, __tmp ? __tmp : b) 




More information about the Digitalmars-d mailing list