读书人

boost:bind的返回值类型是什么额解决方

发布时间: 2012-08-09 15:59:21 作者: rapoo

boost::bind的返回值类型是什么额

C/C++ code
boost::bind的返回值类型是什么额//这个函数内部用到了bindvoid CSyncTask::execute_at( LPTHREAD_START_ROUTINE lpStartAddress,LPVOID lpParameter,time_t t){    assert(lpStartAddress);    execute_at(boost::bind(&ThreadProc,lpStartAddress,lpParameter),t);            //look here}static void ThreadProc(LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter)    //look here{    assert(lpStartAddress);    lpStartAddress(lpParameter);}boost::bind(&ThreadProc,lpStartAddress,lpParameter)的返回值类型为:function<void(LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter)>;但是成员函数execute_at的类型确实:void execute_at( TaskFunction fun,time_t t);     //typedef boost::function<void()> TaskFunction;这是怎么回事


[解决办法]
探讨

多谢。


确实神奇,_bi::bind_t<R, F, list_type> (f, list_type(a1, a2));

和TaskFunction 对应起来。

代码不是我的,我是看代码,类似的很多。有些困惑。




引用:
引用:

引用:
C/C++ code

#ifdef _WIN32

……

读书人网 >C++

热点推荐