From -3967522401193220077
X-Google-Thread: f78e5,52112cea9d2ccd4a
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news.maxwell.syr.edu!feed.news.tiscali.de!newsfeed.icl.net!newsfeed.fjserv.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: seewebsiteforemail@moderncppdesign.com ("Andrei Alexandrescu (See Website for Email)")
Newsgroups: comp.std.c++
Subject: Re: =?ISO-8859-1?Q?=A75=2E2=2E2/8_unspecified_evluation_od?=
 =?ISO-8859-1?Q?er=3F?=
Date: Thu,  4 Aug 2005 16:11:56 GMT
Organization: Computer Science & Engineering, U of Washington, Seattle
Lines: 75
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <42F22D0B.8010108@moderncppdesign.com>
References: <CsidnX1xcd4C73_fRVn-tA@speakeasy.net>   <42E4EB01.9020700@alumina.nl>   <42E64CCE.7030708@cs.york.ac.uk>   <42E68BDD.1050701@alumina.nl>   <1122649512.879866.38000@g44g2000cwa.googlegroups.com>   <3l12o0F10nuusU1@individual.net>   <0RfHe.2500$%a2.1721@trndny03>   <3l5u7qFvrvk8U1@individual.net>   <200508011747.j71HlbuC069360@horus.isnic.is>   <1122936886.396427.298260@g47g2000cwa.googlegroups.com>   <zMDHe.2564$%a2.2024@trndny03>   <1123012422.458492.183540@z14g2000cwz.googlegroups.com>   <200
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1123171921 8972 158.152.254.254 (4 Aug 2005 16:12:01 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 4 Aug 2005 16:12:01 +0000 (UTC)
X-Nntp-Posting-Host: cpe-24-29-158-198.nyc.res.rr.com
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.9) Gecko/20050711 Thunderbird/1.0.5 Mnenhy/0.7.1
X-Accept-Language: en-us, en
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j74GBu6K000953;
	Fri, 5 Aug 2005 02:11:56 +1000 (EST)
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++:1656

Hyman Rosen wrote:
> kuyper@wizard.net wrote:
> 
>> The constructs in C++ that guarantee a specific order of operation are 
>> few;
> 
> 
> Really? Let's count some.
> 
> 1) Sequence of statements:
>    f(); g(); h();
> 
> 2) Comma operator (but not if user-defined!):
>    f(), g(), h();
> 
> 3) Initializers:
>    int a = f(), b = g(), c = h();
>    int a[] = { f(), g(), h() };
> 
> 4) Constructors:
>    struct s { int a, b, c; s() : a(f()), b(g()), c(h()) { } };
> 
> 5) Function arguments:
>    p = strchr(++p, '.');
> 
> 6) Short-circuited boolean operators (but not if user-defined!):
>    f() && g() || h();
> 
> 7) ternary operator:
>    f() ? g() : h();
> 
> 8) Control constructs:
>    if (f()) g();
>    while (f()) g();
>    do f(); while(g());
> 
> 9) Combinations of user-defined operators (but not built-in ones!):
>    struct x { x &operator++(int) { return *this; }
>               x &operator=(const x &) { return *this; } };
>    x a;
>    a++ = a;

Heh, heh, heh. After having read Mr. Kuyper's post, I was like "said 
what???" and felt compelled to produce a similar list, just to see the 
one above a minute later. :o)

> Is it? With the language as it currently is, adopting this style
> means adding extra variable or reference declarations for intermediate
> expressions. With template metaprogramming so popular, it's possible
> that the types for those declarations aren't readily available, or are
> hideously long and complicated.

And then again, worst of all, the manifestation of forgetting to use 
the more verbose style (which I agree it seldom improves readability)
is not hard errors; it's soft errors and nonportable behavior that 
"works" by sheer luck on some machines and yields hard-to-track 
problems on others.

> If they can't see that having gratuitously unspecified constructs in
> something intended to drive the behavior of a machine makes absolutely
> no sense, there's nothing I can really do about it, except to keep
> plugging away and hope that their point of view becomes so in the
> minority that it will be ignored.

Speaking of which, are you planning to embark on a proposal?


Andrei

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



