我在 C# 中有这样一个类和委托:
public delegate void Super();
public class Event
{
public event Super activate ;
public void act()
{
if (activate != null)
activate();
}
}
我需要用 C++/CLI 重写它。但我有一个错误 -usage requires Event::activate to be data member
public delegate void Super();
public ref class Event
{
public:
event Super ^activate;
void act()
{
if (activate!=nullptr)
activate();
}
};
是不是activate()
通话有问题?