编译器错误 C2582
“function”函数在“type”中不可用
尝试对没有赋值运算符的对象赋值。
以下示例生成 C2582:
// C2582.cpp
// compile with: /clr
using namespace System;
struct N {};
ref struct O {};
ref struct R {
property O prop; // C2582
property O ^ prop2; // OK
};
int main() {
String ^ st1 = gcnew String("");
^st1 = gcnew String(""); // C2582
st1 = "xxx"; // OK
}
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈