六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 49|回复: 0

为C++实现一个IDL (二)

[复制链接]

升级  98%

158

主题

158

主题

158

主题

举人

Rank: 3Rank: 3

积分
494
 楼主| 发表于 2013-2-4 23:44:43 | 显示全部楼层 |阅读模式
<div class="postText">说明:
要看懂后面那部分代码,即使用Typelist的部分,最好预先看过《C++设计新思维》,英文版名为《Modern C++ Design》。
If模板类在写完后想起来好像在哪见过,早晨去公司查阅了一下,在《产生式编程——方法、工具与应用》一书中有讲,英文名为《Generative Programming -- Methods, Tools, and Applications》基本和本篇中一个样。


前2篇乱七八糟地讲了一些,有一个遗留问题,函数原型的推导。

简要描述如下:
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee;">Method < void(in<int>in<char>, inout<string>out<short>> method;

// 同步调用
string str = "hello";
short value = 2;
method (
3'a', str, value);

// 异步调用1
method.async_call (3'a'"hello");

// 异步调用2
void test_func (intcharstringshort);
method.async_call (
3'a'"hello", test_func);
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表