編譯器錯誤 C3736
'event': 必須是方法,或者,在 Managed 事件的情況下,選擇性地是數據成員
原生和 COM 事件必須是方法。 .NET 事件也可以是數據成員。
下列範例會產生 C3736:
// C3736.cpp
struct A {
__event int e();
};
struct B {
int f; // C3736
// The following line resolves the error.
// int f();
B(A* a) {
__hook(&A::e, a, &B::f);
}
};
int main() {
}