22.2 Delegate instantiation

原创 2006年06月22日 03:19:00
An instance of a delegate is created by a delegate-creation-expression (§14.
5.10.3). The newly created delegate
instance then refers to either:
? The static method referenced in the delegate-creation-expression, or
? The target object (which cannot be null) and instance method referenced in
the delegate-creationexpression,
or
? Another delegate
[Example: For example:
delegate void D(int x);
class Test
{
public static void M1(int i) {?}
public void M2(int i) {?}
}
class Demo
{
static void Main() {
D cd1 = new D(Test.M1); // static method
Test t = new Test();
D cd2 = new D(t.M2); // instance method
D cd3 = new D(cd2); // another delegate
}
}
end example]
Once instantiated, delegate instances always refer to the same target
object and method. [Note: Remember, when
two delegates are combined, or one is removed from another, a new delegate
results with its own invocation list;
the invocation lists of the delegates combined or removed remain unchanged.
end note]

C++学习笔记36 模版的显式具体化(template specialization)和显式实例化(template instantiation)

C++的模版有时候很可能无法处理某些类型。 例如: #include using namespace std; class man{ private: string name; int data...

spring quartz:Instantiation of bean failed; nested exception is java.lang.IncompatibleClassChangeErr

spring 调度类初始化失败,分析是jar包冲突,日志如下: org.springframework.beans.factory.BeanCreationException: Error creat...

从quatus内部启动modelsim进行后仿真 出现Instantiation of 'mt48lc32m16a2' failed. The design unit was not found.

问题:当我进行前仿真的时候,quatus编译成功,modelsim流畅运行,非常顺利,功能验证正确! 仿真方法:从quatus内部启动Modelsim SE进行仿真 但是当我进行后仿真的时候却一直出现...

Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser

在学习spring的过程中,运用c3p0作为数据源,练习配置bean的外部文件加载,出现如下错误: org.springframework.beans.factory.BeanCreatio...

erro: "Instantiation of '***' failed. The design unit was not found"

在FPGA的设计中,经常会遇到此类问题,如题目所示--"erro: Instantiation of '***' failed. The design unit was not found",之前在Q...

springmvc 中 Instantiation of bean failed实例化Bean失败错误

springmvc 中 Instantiation of bean failed实例化Bean失败错误 配置springMVC 项目时,启动tomcat服务器报错: 错误: 信息: In...

模板显式实例化 explicit template instantiation

众所周知,C++中模板的声明与定义分离时

CArray,CList,CMap如何实化(实例化,instantiation)

哎,这是乎又是一篇没有什么技术含量的应用性文章,但我,又能怎么样?虽然,我们在《CMap如何使用,用法举例》中,已经非常详细的说明了CMap参数的用法,也在其他的专题中介绍过了其它模板类的实化过程,不...

22.2 波形音频 II

摘录于《Windows程序(第5版,珍藏版).CHarles.Petzold 著》P1000 22.2.6  数字录音机         Windows 包含了一个叫做 Sound Recorder(...

算法导论 第22章 22.2-7

#include #include #include using namespace std; typedef struct Gnode { int color;//0 white,1 gray,...
  • zju2016
  • zju2016
  • 2016年04月21日 15:17
  • 161
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:22.2 Delegate instantiation
举报原因:
原因补充:

(最多只允许输入30个字)