Comma Operator - Uses

Uses

There appear to be few practical uses of operator,.

Bjarne Stroustrup, The Design and Evolution of C++

The comma operator has relatively limited use cases. Because it discards its first operand, it is generally only useful where the first operand has desirable side effects. Further, because it is rarely used outside of specific idioms, and easily mistaken with other commas or the semicolon, it is potentially confusing and error-prone. Nevertheless, there are certain circumstances where it is commonly used, notably in for loops.

Read more about this topic:  Comma Operator