编译器错误 C3911
“event_accessor_method”:函数必须具有“signature”类型
未正确声明事件的访问器方法。
有关详细信息,请参阅事件。
以下示例生成 C3911:
// C3911.cpp
// compile with: /clr
using namespace System;
delegate void H(String^, int);
ref class X {
event H^ E1 {
void add() {} // C3911
// try the following line instead
// void add(H ^ h) {}
void remove(){}
// try the following line instead
// void remove(H ^ h) {}
void raise(){}
// try the following line instead
// void raise(String ^ s, int i) {}
};
};
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈