Skip to content

Commit

Permalink
Add basic_stream::rebind_executor
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Oct 31, 2019
1 parent 7cc8759 commit d64e5f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Version 275:

* Async init-fns use the executor's default token
* Add basic_stream::rebind_executor

--------------------------------------------------------------------------------

Expand Down
9 changes: 9 additions & 0 deletions include/boost/beast/core/basic_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ class basic_stream
*/
using executor_type = beast::executor_type<socket_type>;

/// Rebinds the stream type to another executor.
template<class Executor1>
struct rebind_executor
{
/// The stream type when rebound to the specified executor.
using other = basic_stream<
Protocol, Executor1, RatePolicy>;
};

/// The protocol type.
using protocol_type = Protocol;

Expand Down

0 comments on commit d64e5f7

Please sign in to comment.