forked from boostorg/asio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add is_async_operation trait and async_operation concept.
The is_async_operation trait may be used to determine if a function object, and optional arguments, may be called to initiate an asynchronous operation. For example, when using asio::deferred auto d = my_timer.async_wait(asio::deferred); static_assert(asio::is_async_operation<decltype(d)>::value); or with a handcrafted asynchronous operation: struct my_async_op { asio::ip::tcp::socket& socket_ = ...; template <typename Token> auto operator()(asio::const_buffer data, Token&& token) { return asio::async_write(socket_, data, std::forward<Token>(token)); } }; static_assert( asio::is_async_operation< my_async_op, asio::const_buffer>::value);
- Loading branch information
1 parent
af93ac1
commit 73efb74
Showing
2 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters