The new ?? and ??? operators

Janice Caron caron800 at googlemail.com
Mon Sep 24 14:56:14 PDT 2007


On 9/24/07, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> It would be great to have a way to express
>
>    complicated_expression > 0 ? complicated_expression : default
>
> Without having to duplicate complicated_expression, while still
> remaining an expression overall.

(x = complicated_expression) > 0 ? x : default

You'd have to declare x first, but I don't see that as a major
problem, and it does seem more sensible to me than creating new
operators. (If there's one thing worse than keyword bloat, it's
operator bloat).



More information about the Digitalmars-d mailing list