This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: value not set via reference
- From: Conrad S <conradsand dot arma at gmail dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 30 Jan 2015 17:23:10 +1000
- Subject: Re: value not set via reference
- Authentication-results: sourceware.org; auth=none
- References: <CAONgOD78zQFEZf2h9O97tGL9t5XW4FpzYa9atbS8EL1SL4Nz4w at mail dot gmail dot com> <CAKNGpgrc3+Z2bQs5C+5K6KChnUBiPCKU1frvHFVGFbEV=JpGsw at mail dot gmail dot com>
On 30 January 2015 at 16:58, James Dennett wrote:
> It's hardly just a loophole: C++ doesn't specify the order of evaluation,
> so the code is wrong (i.e., non-portable, as you've found).
>
> Arguably this is a design problem with IOStreams, given how
> tempting it can be to write code that assumes left-to-right evaluation,
> but it's not a compiler bug.
Okay, but what is the reason for changing the "expected"
(left-to-right) order of evaluation? Is there an optimisation
benefit?
If not, why change the order to something unexpected?