Le 05/09/15 04:38, Oliver Kowalke a écrit :
2015-09-05 0:53 GMT+02:00 Giovanni Piero Deretta
: or
2) boost::fiber::future is simply a tiny wrapper over boost::thread::future that overrides the wait policy.
the futures of boost.thread and boost.fiber differ efectivly only in the type of mutex and condition_variable (implementing the suspend/resume mechanism for threads/fibers)
a base implementation of future has to take the types of mutex and condition_variable as template arg.
template< typename T, typename Mutex, typename Condition > class base_future<> { };
template< typename T > using future = base_future< T, boost::mutex, boost::condition_variable >; // boost.thread
template< typename T > using future = base_future< T, boost::fibers::mutex, boost::fibers::condition_variable >; // boost.fiber
While this can be useful to have a common implementation, I don't think it solves the issue if interaction with different implementation of some concept Future. Vicente