
Daryle Walker wrote:
I don't think so. The comma used to separate function (call) arguments always overrides a comma operator. In fact, the docs for the block statement (as of 2005-Oct-13) mention that:
//===================================================================== Outside the square brackets, block statements should be grouped. For example:
//------------------------------------------ for_each(c.begin(), c.end(), ( do_this(arg1), do_that(arg1) ) ); //------------------------------------------ //=====================================================================
Wrapping a comma operator chain around a parentheses pair blocks the interpretation as an argument separator. The reason for the exception for the square bracket operator is that the operator always takes exactly one argument, so it "transforms" any attempt at multiple arguments with a comma operator chain (and spits out an error for zero arguments).
I think this is a good explanation. I updated the docs and added this. Thanks, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net