【发布时间】:2015-10-16 15:39:20
【问题描述】:
问题的标题简单明了。这是代码:
class xxx : public Scheduled
{
long int _wait_time;
boost::function< void() > _cb;
mutable boost::mutex _mutex;
public:
xxx(boost::function< void() > callback, unsigned int wait_time = 10000000)
:_wait_time(wait_time),_cb(callback)
,Scheduled(Timer(_wait_time, 0))
{
this->stop();
}
};
虽然我尊重初始化的顺序,但这是我得到的警告:
---: In constructor ‘xxx::xxx(boost::function<void ()()>, unsigned int)’:
---: warning: ‘xxx::_cb’ will be initialized after
---: warning: base ‘Scheduled’
---: warning: when initialized here
有什么想法吗?谢谢
【问题讨论】:
标签: c++ boost-function