读书人

种模板运用之实现委托类

发布时间: 2013-02-20 12:23:22 作者: rapoo

类模板运用之实现委托类

#include "header.h"class Test{public:void f( int a ){ cout << "Test:" << a << endl; }};int main(){Test *t = new Test;C<Test, int> c(t, &Test::f );c.invoke(3);delete t;}/*T1:class TestT2:void (__thiscall Test::*)(int)Test:3请按任意键继续. . .*/
强大的设计模式啊,超方便的说。。。



读书人网 >编程

热点推荐