D delegate
来源:互联网 发布:java自行车是哪个国家 编辑:程序博客网 时间:2024/06/05 15:01
D语言:
void delegate(TCPEvent) delegate(AsyncTCPConnection) del; == return (viod delegate(TCPEvent)) input AsyncTCPConnection ;
Like as:
C:
void (*fp)(TCPEvent);fp (*del)(AsyncTCPConnection);
Delegates
There are no pointers-to-members in D, but a more useful concept called delegates are supported. Delegates are an aggregate of two pieces of data: an object reference and a pointer to a non-static member function, or a pointer to a closure and a pointer to a nested function. The object reference forms the this pointer when the function is called.
Delegates are declared similarly to function pointers, except that the keyword delegate takes the place of (*), and the identifier occurs afterwards:
官方的注解,简单的来说就相当于C语言中的函数指针~~用来回调
0 0
- D delegate
- Unity-3D 委托Delegate
- delegate
- delegate
- Delegate
- delegate
- Delegate
- Delegate
- Delegate
- Delegate
- delegate
- Delegate
- Delegate
- Delegate
- Delegate
- delegate
- Delegate
- delegate
- Android启动模式之singleTask解析
- 在AndroidStudio编译过程中遇到Error:duplicate files during packaging of APK问题的解决方法
- Redis高可用部署及监控
- Material Note 开源了!!!!
- Java 调用Hive 自定义UDF
- D delegate
- 黑马程序员——Java基础---循环语句
- 云计算学习笔记(四):使用云
- shell判断和比较
- 变量命名法
- java网络编程入门教程
- 找出重复次数最多的数字
- CentOS 6.5 下安装 Redis 2.8.7
- 批处教程 for /f 中的Delims和Tokens总结