From 2421642048262747966
X-Google-Thread: f78e5,174aa7b34b06a51
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.speakeasy.net!news.speakeasy.net.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 12 Dec 2005 10:50:04 -0600
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: "Momchil Velikov" <momchil.velikov@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: Is this really unspecified behavior?
Organization: http://groups.google.com
Message-ID: <1134377938.542144.99440@z14g2000cwz.googlegroups.com>
References: <1132759176.368850.264850@g43g2000cwa.googlegroups.com>
   <H1phf.161529$zb5.99785@bgtnsc04-news.ops.worldnet.att.net>
   <1132933832.802917.153350@g14g2000cwa.googlegroups.com>
   <1133551647.532929.325730@z14g2000cwz.googlegroups.com>
   <1133583412.951239.208510@g49g2000cwa.googlegroups.com>
   <E1EjGBD-0005T8-00@chx400.switch.ch>
   <1133910546.716987.80030@g14g2000cwa.googlegroups.com>
   <E1EjzL6-0006ic-00@chx400.switch.ch>
   <0l5ep1ppfhdj5p1pcu7e4na4ub0vjajlq3@4ax.com>
   <IrB3v9.1y0F@beaver.cs.washington.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050906 Firefox/1.0.6 (Debian package 1.0.6-4),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: z14g2000cwz.googlegroups.com; posting-host=84.22.10.178;
   posting-account=Fh11Bw0AAAB0-wFbEALShd0KZmegcXjp
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Date: Mon, 12 Dec 2005 10:44:56 CST
Lines: 41
NNTP-Posting-Host: 65.182.171.162
X-Trace: sv3-dAbZzReQsq++3iN3qfHNrvqggGYjZSdF3jZDTbZzPfONiJD53uP2Qnl6AI63iWav620ONvEeQh+/0YJ!Nyb6mE3QJvtBaKogntLg4u6rDOA2G61e9mX+QHQY/1LWd6+p90uZGLx0pJoZwJWXihckY9lC8MXr!gzzEE4YVt13FWY4qJv6NezitjWn/BeYE4b/5knTMPQ==
X-Complaints-To: abuse@speakeasy.net
X-DMCA-Complaints-To: abuse@speakeasy.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.32
Xref: g2news1.google.com comp.std.c++:2742

"Andrei Alexandrescu See Website For Email wrote:
> Momchil Velikov wrote:
> > "Andrei Alexandrescu See Website For Email wrote:
> >
> >>So the jury is still out on finding cases (that are not source-level
> >>optimizable in an obvious way) in which a specified order of argument
> >>evaluation forces the compiler to generate pessimized code.
> >
> >   How about finding cases in which the order of evaluation is not
> > enforceable at the source level in an obvious way ?
>
> Not sure I understand.

Just presenting the opposite view.  I'm not sure proponents of the
unspecifed
evaluation order should be put in a defensive position, like your
posting suggests.

> For the call (expr0)(arg1, arg2, ..., argn) the
> evaluation algorithm should be as if the following happens:
>
> 1. Evaluate expr0 resulting in a function f
> 2. For each i in 1..n in this order, evaluate argi resulting in a value vi
> 3. Invoke f(v1, v2, ..., vn)
>
> It's a pity that the intended semantics can't be easily expressed as a
> source-to-source transformation. (The problem is that rvalue and lvalue
> expressions would lead to different types of temporaries.)

Then maybe *this* is the problem to solve. Is it related to the
"forwarding problem"
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm ?

~velco

---
[ 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                       ]



