Giovanni Piero Deretta wrote:
auto f = when_any( f1, f2, f3, f4 ); // 2^4 options
The algorithm can be generic of course.
Can it be generic? Do you have a generic implementation of when_any?
You'll have the same problem if you want to mix different futures from separate libraries.
Yes, I know. Hence my preference for a single std::future that is _the_ future type.
You are right of course. The readiness notification is orthogonal, but in a shared future you need a mutex to synchronise the various consumers access to the shared state, so a condition variable becomes the obvious choice, while you can be more creative with plain futures.
No, in fact I do not need a mutex to synchronize consumers, as far I can see. Where would I need it? Consumers don't interfere with one another.