問題1:str::tr1::bind作為參數(shù)我不知道在構(gòu)造函數(shù)的形參應(yīng)該如何表示,或者說我應(yīng)該去從哪方面入手查找資料,還望各位大神指點迷津。問題2:str::tr1::bind的第二個參數(shù)為this,是希望其它類也可以靈活調(diào)用Timer構(gòu)造函數(shù),應(yīng)該如何去判斷這個this指針類型呢?Timer.h#include <functional>namespace Timer{struct Id{int type, id, time;Id(int type, int id, int time) : type(type), id(id), time(time) {//TODO:}}class Timer{public:// std::tr1::function<void(void)> t 這個會報錯Timer(std::tr1::function<void(void)> t, Id id, Container* time, int start, int end);}}channel.cppnew Timer::Timer(std::tr1::bind(&Channel::channelEventTimer,this), Timer::Id(Timer::Types::ChannelEventTimer, 0, 0),getTimers(),0,60 * 1000);
以下是內(nèi)容是關(guān)于C++ Boost庫std::tr1::bind的使用問題,求解釋!
慕尼黑8549860
2021-11-04 07:07:24