Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the comma operator have to be left-associative?

According to this precedence table, the comma operator is left-associative. That is, a, b, c is parsed as (a, b), c. Is that a necessity? Wouldn't a, (b, c) have the exact same behavior?

like image 645
fredoverflow Avatar asked Dec 23 '12 11:12

fredoverflow


1 Answers

Since overloadable operator, exists, no, it's not the same behavior. a, (b, c) could call different overloads than (a, b), c.

like image 95
Pubby Avatar answered Sep 22 '22 06:09

Pubby