"Jonas Drewsen" , dans le message (digitalmars.D:172039), a écrit : > On Wednesday, 11 July 2012 at 11:18:21 UTC, akaz wrote: >> if needed, the operator !! (double exclamation mark) could be >> defined. >> >> ... > > Or the operator?? could be borrowed from c# > > auto a = foo ?? new Foo(); > > is short for: > > auto a = foo is null ? new Foo() : foo;
or maybe: auto a = ! ! foo ? foo : new Foo(); || could be redifined to have this a behavior, but it would break code.
