問題1:str::tr1::bind作為參數我不知道在構造函數的形參應該如何表示,或者說我應該去從哪方面入手查找資料,還望各位大神指點迷津。問題2:str::tr1::bind的第二個參數為this,是希望其它類也可以靈活調用Timer構造函數,應該如何去判斷這個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);
以下是內容是關于C++ Boost庫std::tr1::bind的使用問題,求解釋!
慕尼黑8549860
2021-11-04 07:07:24