Re:C++17 and other future highlights of C++
by gpderetta on Friday March 11, 2016 @05:33AM
(#11265785)
What's wrong with ASIO interface? My only issue with it is that once a socket is bound to an io_service it can't be easily rebound to another one.
For many applications where C++ is used, promises and futures introduce unnecessary overhead. On the other hand an ASIO-like interface works just fine.
Additionally, ASIO, and by extension the network proposal, have transparent opt-in support for futures via a special callback type.
Example terrible API: You have to create a socket for a new connection before calling async_accept. Try using this with coroutines.
> opt-in support for futures via a special callback type.
Which is ugly. The coroutines opt-in as well. Coroutines actually have the potential to be faster than callbacks.
Instead we'll get something carved out of ASIO, which is a complete mess full of gross unintuitive APIs and callbacks.