From 8565131272983160479
X-Google-Thread: f78e5,52112cea9d2ccd4a
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: hyrosen@mail.com (Hyman Rosen)
Newsgroups: comp.std.c++
Subject: Re: =?ISO-8859-1?Q?=A75=2E2=2E2/8_unspecified_evluation_od?=
 =?ISO-8859-1?Q?er=3F?=
Date: Tue, 26 Jul 2005 01:52:56 GMT
Lines: 39
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <200507252159.j6PLxJtN026883@mailbox4.ucsd.edu>
References: <CsidnX1xcd4C73_fRVn-tA@speakeasy.net>
 <42e41533$0$11001$9a6e19ea@news.newshosting.com>
 <E1Dx5no-0007Lc-00@chx400.switch.ch> <42E5536F.8050407@tiscali.nl>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1122342787 13187 158.152.254.254 (26 Jul 2005 01:53:07 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 26 Jul 2005 01:53:07 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v1.3 on mailbox4.ucsd.edu;
	Mon, 25 July 2005 14:59:22 -0700 (PDT)
X-Accept-Language: en-us, en
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j6Q1qu7k018669;
	Tue, 26 Jul 2005 11:52:56 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@ucar.edu
X-Spamscanner: mailbox4.ucsd.edu  (v1.6 Apr  6 2005 07:48:50, 1.8/5.0 3.0.0)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 16659 j6PLxJtN026883 mailbox4.ucsd.edu)
Xref: g2news1.google.com comp.std.c++:1491

Marc Schoolderman wrote:
> Then, you'll still have problems in cases like these;
>   istream_iterator<int> w(cin);
>   if( *w++ < *w++ ) ...

No I won't. I advocate that C++ must have a fully specified
order of evaluation, including the completion of side-effects.
This order is essentially Java's - strictly left-to-right,
operands before operation. In the expression above, if w has
class type then the expression is
     if (*w.operator++(1) < *w.operator++(1))
and it will be evaluated as-if the following:
     auto r1 = w.operator++(1);
     auto v1 = *r1;
     auto r2 = w.operator++(1);
     auto v2 = *r2;
     if (v1 < v2) ...

If w has built-in type, then as-if the following:
     auto r1 = w++;
     auto v1 = *r1;
     auto r2 = w++;
     auto v2 = *r2;
     if (v1 < v2) ...

I'm using the 'auto var' notation to mean temporary variables
of the appropriate result type of the operators.

Also, if any expression is an lvalue, its object identity is
captured when it is evaluated and remains fixed thereafter:

     i = 0; a[i++] = ++i; // a[0] = 2;

---
[ 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.jamesd.demon.co.uk/csc/faq.html                       ]



