mercredi 24 mai 2017

boost::unique_future unwrapping constructor not defined

I am trying to construct a unique_future from another unique_future<unique_future<>> object, but the code below doesn't compile with a linker error saying the unwrapping constructor is not defined

auto prom_one = boost::promise<boost::unique_future<int>>{};
auto fut_one = prom_one.get_future();
auto inner_fut_unwrap = boost::unique_future<int>{std::move(fut_one)};

I have boost 1.63 from the official download link here http://ift.tt/2qXcs6D I found the following line in boost/thread/future.hpp

inline explicit BOOST_THREAD_FUTURE(
    BOOST_THREAD_RV_REF(
        BOOST_THREAD_FUTURE<BOOST_THREAD_FUTURE<R> >) other); // EXTENSION

That is a declaration, but there is no definition for that constructor. I have defined the BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION preprocessor symbol, is there anything else I need to do to get that constructor to work?

Aucun commentaire:

Enregistrer un commentaire