一旦你将类的对象指针和成员函数指针转化为标准形式,实现单一目标的委托(single-target delegate)就比较容易了(虽然做起来感觉冗长乏味)。你只要为每一种具有不同参数的函数制作相应的模板类就行了。
基于4个网页-相关网页
Once we have a delegate type in the metadata and a target function we'd like to call, we must form an instance of the delegate over a target.
在一个元数据中,一旦我们有了一个委托类型和一个我们想要调用的目标函数,我们必须从目标形成一个实例。
The constructor is used to form a delegate over a target object and a function pointer.
这构造器用来通过一个目标对象和一个函数指针形成一个委托。
Our delegate can then be formed over a target, passed around, and then invoked at some point in the future.
我们的委托可以通过一个目标形成、传递并在将来适当的时候被调用。
应用推荐