Deutsch   English   Français   Italiano  
<v594ve$ban8$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c,comp.lang.c++
Subject: Re: Can you please verify that the analysis of these C functions is
 correct?
Date: Sun, 23 Jun 2024 14:38:06 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <v594ve$ban8$2@dont-email.me>
References: <v4obkj$f9p5$2@dont-email.me>
 <v4pg5p$morv$1@raubtier-asyl.eternal-september.org>
 <v54s1p$3boc5$1@dont-email.me> <v5684p$3n50u$1@dont-email.me>
 <v56gs1$3olbi$3@dont-email.me> <v56lar$onl4$7@i2pn2.org>
 <v56uij$3rako$1@dont-email.me> <v57155$onl3$10@i2pn2.org>
 <v573g3$3s8q3$2@raubtier-asyl.eternal-september.org>
 <v576d0$onl3$13@i2pn2.org>
 <v58gmi$7p22$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 23 Jun 2024 14:38:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5355e1e2ebba64f698c289003534b1d6";
	logging-data="371432"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19PG6M20T+lUPdUh9NQ9hkc5eMadwKWDNM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FdAFs3gSThmatv4y/uuxCMSrb8M=
Content-Language: en-GB
In-Reply-To: <v58gmi$7p22$1@raubtier-asyl.eternal-september.org>
Bytes: 2589

On 23/06/2024 08:52, Bonita Montero wrote:
> Am 22.06.2024 um 20:50 schrieb Richard Damon:
> 
>> Prior to that, it was allowed to compute the order of the terms being 
>> output in any order, as the call to operator <<(ostream& strm, T& 
>> value) was allowd to compute value before resolving stream (as the 
>> value from the previous operator <<, which caught enough people off 
>> guard.
> 
> With a left-associative operator the result of the left part has to be
> calculated before it can be used with the right part.

Both the left part and the right part need to be evaluated before the 
operator between them can be evaluated - but the two parts can be 
evaluated in either order (or even interleaved in their evaluation). 
Associativity is irrelevant.


Before C++17 (which added the rules for sequencing for shifts, and made 
a few other changes), if you had:

	foo() << bar()

then the compiler could evaluate bar() then foo(), or foo() then bar(). 
It can still happily arrange them as it wants for "foo() + bar()".

<https://en.cppreference.com/w/cpp/language/eval_order>