Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <boost/system/error_code.hpp>
  2. #include <boost/asio/async_result.hpp>
  3. #include <boost/asio/detail/handler_type_requirements.hpp>
  4.  
  5. template<
  6. class ReadHandler>
  7. BOOST_ASIO_INITFN_RESULT_TYPE(
  8. ReadHandler, void(boost::system::error_code, std::size_t))
  9. async_read(ReadHandler&& handler)
  10. {
  11. // If you get an error on the following line it means that your handler does
  12. // not meet the documented type requirements for a ReadHandler.
  13. BOOST_ASIO_READ_HANDLER_CHECK(ReadHandler, handler) type_check;
  14.  
  15. boost::asio::async_completion<ReadHandler,
  16. void(boost::system::error_code, std::size_t)> init(handler);
  17. return init.result.get();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement