编译器警告(等级 4)C4913
存在用户定义的二进制运算符“,”,但没有重载可以转换所有操作数,使用了默认的内置二进制运算符“,”
对内置逗号运算符的调用发生在同样具有重载的逗号运算符的程序中;你认为可能已发生的转换没有发生。
下面的示例生成 C4913:
// C4913.cpp
// compile with: /W4
struct A
{
};
struct S
{
};
struct B
{
// B() { }
// B(S &s) { s; }
};
B operator , (A a, B b)
{
a;
return b;
}
int main()
{
A a;
B b;
S s;
a, b; // OK calls user defined operator
a, s; // C4913 uses builtin comma operator
// uncomment the conversion code in B to resolve.
}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈