我必须更新应用程序以使用Boost 1.34而不是1.37,这给我带来了很多麻烦。
目前最大的问题之一是我不太了解Boost线程。 1.34,我得到......
error C2039: 'this_thread' : is not a member of 'boost'
...代码
boost::this_thread::sleep(boost::posix_time::milliseconds(500));
boost :: posix_time也不在1.34。
有没有人知道等效的Boost 1.34函数调用?
答案 0 :(得分:2)
boost::thread::sleep
在1.34.1中占用struct xtime
。试试这个:
struct xtime timeout;
timeout.sec = 0;
timeout.nsec = 500 * 1000000;
boost::thread::sleep(timeout);
答案 1 :(得分:1)
升压::螺纹::睡眠(升压::了posix_time ::的ptime(...));