The new ?? and ??? operators
Stewart Gordon
smjg_1998 at yahoo.com
Sun Sep 23 15:28:17 PDT 2007
"Derek Parnell" <derek at psych.ward> wrote in message
news:1lomy00la8rsl.1fa6pft3qx480$.dlg at 40tude.net...
<snip>
> How would this evaluate in "long hand" code?
>
> int a = b() > c() ??? d() >= e() ??? f() != g();
>From what I can make out:
int a = b() > c();
if (!a) a = (d() >= e());
if (!a) a = (f() != g());
This is slightly simpler than usual because it's an initialiser (and because
int.init happens to be 0). But in the general case where it's being
assigned after declaration, you'd need a bit more:
int temp = b() > c();
if (!temp) temp = (d() >= e());
if (!temp) temp = (f() != g());
if (temp) a = temp;
Stewart.
--
My e-mail address is valid but not my primary mailbox. Please keep replies
on the 'group where everybody may benefit.
More information about the Digitalmars-d
mailing list