c++ 回调函数封装

std::function<void(int a,int b)> ha; //函数封装  当成参数用
callback  std::bind(&fun1,this,std::placeholders::_1,std::placeholders::_2)  //函数回调时使用

方便之处:类型安全。

posted @ 2015-12-09 16:42  晨祷  阅读(690)  评论(0编辑  收藏  举报