Hacker News new | ask | show | jobs
by leni536 2209 days ago
The built-in comma operator has strict sequencing semantics:

Every value computation and side effect of the first (left) argument of the built-in comma operator , is sequenced before every value computation and side effect of the second (right) argument. [1]

The same sequencing guarantee is not applied to a user-defined comma operator.

For the similar reasons it's not a great idea to overload && and || either.

[1] https://en.cppreference.com/w/cpp/language/eval_order (point 9)