“event”:必须是方法,如果是托管事件,也可以是数据成员
原生事件和 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() {
}