just an idea (!! operator)
Christophe Travert
travert at phare.normalesup.org
Thu Jul 12 05:23:04 PDT 2012
"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.
More information about the Digitalmars-d
mailing list