From -4553220852652161963
X-Google-Thread: f78e5,52112cea9d2ccd4a
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news4.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!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: Mon, 25 Jul 2005 19:11:06 GMT
Lines: 23
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <E1Dx5no-0007Lc-00@chx400.switch.ch>
References: <CsidnX1xcd4C73_fRVn-tA@speakeasy.net>
 <42e41533$0$11001$9a6e19ea@news.newshosting.com>
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 1122318672 6561 158.152.254.254 (25 Jul 2005 19:11:12 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 25 Jul 2005 19:11:12 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
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 j6PJB65B002981;
	Tue, 26 Jul 2005 05:11:06 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:1482

Ron Natalie wrote:
> The unspecified order of execution doesn't change the fact that your 
> code is unsafe.   Even if it was guaranteed that the first argument
> always was fully evaluated, a sequence point occurs, and then the
> second, if the second argument threw, the first would be lost.

But if the called function was written to take a pair of smart
pointers rather than plain pointers then things would be fine
(in a properly defined C++, that is). Evaluation should proceed
left-to-right. First the function name or expression itself is
evaluated, then each parameter is initialized in turn from its
argument expression, and that expression is fully evaluated with
all side effects completed before evaluation of the next begins.
If an exception is thrown during this process, then all already-
initialized parameters are destructed. That is the only sane and
sensible way to define the process.

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



