编译器警告(等级 1)C4553

“operator”: 运算符不起任何作用;是否是有意使用“operator”的?

如果表达式语句在其顶部使用了没有副作用的运算符,则可能是一个错误。

以下示例生成 C4553:

// C4553.cpp
// compile with: /W1
int func()
{
   return 0;
}

int main()
{
   int i;
   i == func();   // C4553
   // try the following line instead
   // i = func();
}