"Warning: Comma within array index expression" 但逗号分隔函数参数

"Warning: Comma within array index expression" but comma is separating function arguments

MSVC 报告

warning C4709: comma operator within array index expression

在以下行中:

intersections[img::at(rotJ, rotI)];

在不知道更多的情况下,这个警告是否任何可能有效?

警告C4709: comma operator within array index expression is a rather buggy warning and has numerous reports all over the internet. See for e.g this or this or this(9岁)。

所以答案是误导。

请注意,如果有人在数组索引中使用逗号运算符:

int a[3] = {1, 2, 3};
cout << a[1, 2]; // outputs 3