From 8249947029669509300
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,51be5305f0d11752
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-02-28 09:00:20 PST
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!171.64.14.106!newsfeed.stanford.edu!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Resent-From: fjh@cs.mu.OZ.AU
Resent-Message-Id: <200102281444.BAA20204@hg.cs.mu.oz.au>
From: "Ken Hagan" <K.Hagan@thermoteknix.co.uk>
Newsgroups: comp.std.c++
Subject: Re: Proposal: change to condition ? value1 : value2
Message-ID: <newscache$wlzg9g$qvm$1@firewall.thermoteknix.co.uk>
References: <200102251739.JAA32287@mail18.bigmailbox.com> <newscache$6sue9g$v1i$1@firewall.thermoteknix.co.uk> <anQm6.5$5t5.4475@burlma1-snr2>
X-NNTP-Posting-Host: mailgate.thermoteknix.com:62.49.255.234
X-Trace: news.demon.co.uk 983368005 nnrp-01:28581 NO-IDENT mailgate.thermoteknix.com:62.49.255.234
X-Complaints-To: abuse@demon.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
Resent-Date: Thu, 1 Mar 2001 01:44:40 +1100
Resent-To: fjh+csc-submit@cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Wed, 28 Feb 2001 10:59:56 CST
Lines: 26
Xref: supernews.google.com comp.std.c++:3665

I asked, "isn't this what the logical OR gives us?"

"Barry Margolin" <barmar@genuity.net> wrote...
>
> No, because that always coerces the result to a boolean,
> returning either 1 or 0.

Ah yes, silly me. We'd need...

    (/*something*/ = cond) || (/*something*/ = expr2);

...but this can't be used as a initialising expression for
"something".

    T const something = (.... ? .... : ....);

Besides, using || purely for its short-circuit evaluation
property (rather than its result) is slightly evil.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]



