Using boost::future with “then” continuations

后端 未结 4 1557
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 12:35

The C++ 11 std::future lacks a then method to attach continuations to the future.

The Boost boost::future provides this, and t

4条回答
  •  天涯浪人
    2020-12-24 13:34

    This defining of macros seems to work for very small trivial programs however, it does not work well for large programs. In particular, some other file in the include path can incidentally include boost/thread.hpp or boost/thread/future.hpp. This can even come from an include in a third party library. As a result it breaks the usage of the macros as the header gets included before the macros are defined. Is there a way when building boost to tell boost to define these macros in one of its config.hpp files so that this problem can be avoided?

提交回复
热议问题