|
|
<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 (int, char, string, short);
method.async_call (3, 'a', "hello", test_func); |
|