Yes, I believe this is a change between C++03 and C++11. I believe it was done for roughly the reason to which you allude -- that there's no particularly good reason a comma operator can't be part of a constant expression.
I believe the rule in C++03 originated from the rule in C (C90, §6.4):
Constant expressions shall not contain assignment, increment, decrement, function-call, or comma operators, except when they are contained within the operand of a sizeof operator.
As to why the comma operator was prohibited in constant expressions in C, I can only speculate. My immediate guess would be to assure that a definition like:
int x[5, 2];
...would be rejected. If it were allowed, it could lead the programmer to the mistaken belief that he'd defined a 5x2 element array (for a total of 10 elements), when (if a comma operator were allowed there) he'd really defined x
with only 2 elements (and the 5
was effectively ignored completely).
As to why the C++ committee considered this a more acceptable risk than the C committee, I'd guess it comes down to a fairly simple situation: C provides nearly no alternative, so arrays are used quite a bit. C++, on the other hand, provides both std::array
and std::vector
, leaving extremely few situations in which there's much reason to use a "raw" array, so the problem is a lot less likely to arise.