Because completion handlers cause an inversion of the flow of control, sometimes other methods of attaching a continuation are desired. Networking provides the [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3747.pdf ['Universal Model for Asynchronous Operations]], providing a customizable means for transforming the signature of the initiating function to use other types of objects and methods in place of a completion handler callback. For example to call to write a string to a socket asynchronously, using a `std::future` to receive the number of bytes transferred thus looks like this:
Because completion handlers cause an inversion of the flow of control, sometimes other methods of attaching a continuation are desired. Networking provides the [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3747.pdf ['Universal Model for Asynchronous Operations]], providing a customizable means for transforming the signature of the initiating function to use other types of objects and methods in place of a completion handler callback. For example to call to write a string to a socket asynchronously, using a `std::future` to receive the number of bytes transferred thus looks like this: