编译器错误 C3194
“member”:值类型不能具有赋值运算符
值类中不支持需要编译器自动调用的特殊成员函数,例如复制构造函数或复制赋值运算符。
示例
下面的示例生成 C3194。
// C3194.cpp
// compile with: /clr /c
value struct MyStruct {
MyStruct& operator= (const MyStruct& i) { return *this; } // C3194
};
ref struct MyStruct2 {
MyStruct2% operator= (const MyStruct2% i) { return *this; } // OK
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈