forked from boostorg/beast
Refactor get_io_context
This commit is contained in:
@@ -34,7 +34,7 @@ inline
|
||||
net::io_context*
|
||||
get_io_context(net::io_context::executor_type const& ex)
|
||||
{
|
||||
return std::addressof(ex.context());
|
||||
return std::addressof(net::query(ex, net::execution::context));
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -42,8 +42,7 @@ net::io_context*
|
||||
get_io_context(net::strand<
|
||||
net::io_context::executor_type> const& ex)
|
||||
{
|
||||
return std::addressof(
|
||||
ex.get_inner_executor().context());
|
||||
return get_io_context(ex.get_inner_executor());
|
||||
}
|
||||
|
||||
template<class Executor>
|
||||
@@ -64,7 +63,7 @@ get_io_context(T const& ex)
|
||||
net::io_context::executor_type>();
|
||||
if(! p)
|
||||
return nullptr;
|
||||
return std::addressof(p->context());
|
||||
return get_io_context(*p);
|
||||
}
|
||||
|
||||
inline
|
||||
|
||||
Reference in New Issue
Block a user