id summary reporter owner description type status milestone component version severity resolution keywords cc 11192 boost::future<>::then() with an executor doesn't compile when the callback returns a future konrad.zemek@… viboes "As noted in the title, when the scheduler overload of {{{boost::future<>::then()}}} is used, and the callback given returns a future, the code doesn't compile. I'm observing this behavior using Boost 1.58 beta 1. The minimal code to reproduce: {{{#!c++ #define BOOST_THREAD_VERSION 4 #define BOOST_THREAD_PROVIDES_EXECUTORS #include #include #include boost::future p(boost::future) { return boost::make_ready_future(); } int main() { // compiles boost::make_ready_future().then(&p); boost::basic_thread_pool executor; // doesn't compile boost::make_ready_future().then(executor, &p); } }}} I'm getting the following error messages when compiling with GCC 4.9.2: {{{ In file included from /usr/include/boost/thread.hpp:24:0, from example.cpp:4: /usr/include/boost/thread/future.hpp: In instantiation of 'boost::future boost::detail::make_future_executor_continuation_shared_state(Ex&, boost::unique_lock&, F&&, Fp&&) [with Ex = boost::executors::basic_thread_pool; F = boost::future; Rp = boost::future; Fp = boost::future (*)(boost::future)]': /usr/include/boost/thread/future.hpp:4628:12: required from 'boost::future)>::type> boost::future::then(Ex&, F&&) [with Ex = boost::executors::basic_thread_pool; F = boost::future (*)(boost::future); R = void; typename boost::result_of)>::type = boost::future]' example.cpp:18:49: required from here /usr/include/boost/thread/future.hpp:1629:13: error: 'boost::future >::future(boost::future >::future_ptr) [with R2 = void; boost::future >::future_ptr = boost::shared_ptr > >]' is private BOOST_THREAD_FUTURE(future_ptr a_future): ^ In file included from /usr/include/boost/thread.hpp:24:0, from example.cpp:4: /usr/include/boost/thread/future.hpp:4531:37: error: within this context return BOOST_THREAD_FUTURE(h); }}}" Bugs closed Boost 1.60.0 thread Boost 1.58.0 Problem fixed future then executor nested