I think that the comma operator returns the rightmost expression so 10, 12, 15 returns 15. However, I have a few questions about the operator.
Firstly, are commas in initialisation lists comma operators. I can see that this would not cause a problem, but on the other hand it doesn't achieve anything either as far as I can see.
Also, I can think of one acceptable (I think!) use of the comma operator, (and one bad one). Are there any other important uses of it that I'm missing?
The only valid use I've ever seen of the comma operator was in some template metaprogramming code that determined at compile time whether or not operator<< existed for a given type. Unfortunately I cannot remember the actual code.
I think using the comma operator is valid in the initialization and repeat parts of for loops. You don't need the values of the expressions there, just the side effects, and there are situations in which you might want to have multiple statements there. I know this is avoidable in most cases, but in some cases the alternative is just ugly.
That makes sense: I can see where one would use the comma operator when the values aren't needed. As for situations when the value is needed, I think that using the comma operator would end up being too messy (as in my second example above). I think I'm just about clear on it now anyway.