Isn't comma operator suppose to honor left-to-right associativity?
When I try it on this test case, it exhibits right-to-left associativity.
#include
struct CBI;
struct EC;
struct CET;
struct CBI {
CBI& operator,(const CBI& rhs)
{ return *const_cast(&rhs); }
};
struct E
On 04/02/2021 21:08, AJ D via Gcc wrote:
> Isn't comma operator suppose to honor left-to-right associativity?
>
> When I try it on this test case, it exhibits right-to-left associativity.
You are not talking about associativity - you are talking about
evaluation order. (The two things are often
On Feb 04 2021, David Brown wrote:
> For the built-in comma operator, you get guaranteed order of evaluation
> (or more precisely, guaranteed order of visible side-effects). But for
> a user-defined comma operator, you do not - until C++17, which has
> guaranteed evaluation ordering in some circu
On 04/02/2021 22:21, Andreas Schwab wrote:
> On Feb 04 2021, David Brown wrote:
>
>> For the built-in comma operator, you get guaranteed order of evaluation
>> (or more precisely, guaranteed order of visible side-effects). But for
>> a user-defined comma operator, you do not - until C++17, whi
Snapshot gcc-8-20210204 is now available on
https://gcc.gnu.org/pub/gcc/snapshots/8-20210204/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.
This snapshot has been generated from the GCC 8 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch
Nope, -std=c++17 didn’t help either.
On Thu, Feb 4, 2021 at 1:33 PM David Brown wrote:
>
>
> On 04/02/2021 22:21, Andreas Schwab wrote:
> > On Feb 04 2021, David Brown wrote:
> >
> >> For the built-in comma operator, you get guaranteed order of evaluation
> >> (or more precisely, guaranteed orde
Yes, there is only function argument which is the result of the comma
operator.
On Thu, Feb 4, 2021 at 2:46 PM AJ D wrote:
> Nope, -std=c++17 didn’t help either.
>
> On Thu, Feb 4, 2021 at 1:33 PM David Brown
> wrote:
>
>>
>>
>> On 04/02/2021 22:21, Andreas Schwab wrote:
>> > On Feb 04 2021, Da