On 9 Sep 2014 at 15:03, Rodrigo Madera wrote:
About the language, I would totally look forward into C++11 and up design. Be aware that C++ 11, and especially C++ 17 as it currently is thought to become, consider future-promise as the sole way for i/o completion handlers to be invoked via the new future<T>.then(callable) function. In particular, 17's resumable function support *requires* that the function must return a future, so if you want language based coroutine support, you must use future<T>. Niall, C++17 is not done. There is a paper generalizing resumable functions, so that they can return other types than future<T>. This is very interesting, as it could be used also for expected
. The
Le 10/09/14 17:20, Niall Douglas a écrit : promise/future you are working on could be used also :)
As much as Chris and many ASIO users are opposed to that design choice, we must play with the hand we have been dealt by WG21. I will say that future-promise can be made constexpr and no-alloc, and that makes an awful lot of the inefficiency go away, though an implicit synchronisation is unavoidable as .then() must check if the operation has already completed.
Again nothing is fixed. Things evolve, and we don't know yet what the next concurrency TS will contain. The question is different if you want to make a proposal for the standard. Proposing a library for Boost don't need to follow whatever design would be defined supported in C++17. Boost is here to experiment also. Best, Vicente