代码之家  ›  专栏  ›  技术社区  ›  Justin

从增压1.37降到1.34

  •  0
  • Justin  · 技术社区  · 15 年前

    我必须更新一个应用程序来使用Boost1.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_时间也不在1.34之内。

    有人知道等价的boost 1.34函数调用吗?

    2 回复  |  直到 15 年前
        1
  •  2
  •   bdonlan    15 年前

    boost::thread::sleep 采取了 struct xtime 1.34.1.试试这个:

    struct xtime timeout;
    timeout.sec = 0;
    timeout.nsec = 500 * 1000000;
    boost::thread::sleep(timeout);
    
        2
  •  1
  •   Ivan G.    15 年前

    boost::thread::sleep(boost::posix_time::ptime(…);