No longer need to forward declare the io_context implementation.

This commit is contained in:
Christopher Kohlhoff 2020-07-22 12:50:04 +10:00
parent 12b3c601c9
commit ad7209706d
2 changed files with 10 additions and 18 deletions

View File

@ -27,10 +27,10 @@
#include "asio/detail/push_options.hpp" #include "asio/detail/push_options.hpp"
#if !defined(GENERATING_DOCUMENTATION)
namespace asio { namespace asio {
#if !defined(GENERATING_DOCUMENTATION)
template <typename Service> template <typename Service>
inline Service& use_service(io_context& ioc) inline Service& use_service(io_context& ioc)
{ {
@ -48,22 +48,8 @@ inline detail::io_context_impl& use_service<detail::io_context_impl>(
return ioc.impl_; return ioc.impl_;
} }
} // namespace asio
#endif // !defined(GENERATING_DOCUMENTATION) #endif // !defined(GENERATING_DOCUMENTATION)
#include "asio/detail/pop_options.hpp"
#if defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_io_context.hpp"
#else
# include "asio/detail/scheduler.hpp"
#endif
#include "asio/detail/push_options.hpp"
namespace asio {
inline io_context::executor_type inline io_context::executor_type
io_context::get_executor() ASIO_NOEXCEPT io_context::get_executor() ASIO_NOEXCEPT
{ {

View File

@ -36,16 +36,22 @@
# include "asio/detail/signal_init.hpp" # include "asio/detail/signal_init.hpp"
#endif #endif
#if defined(ASIO_HAS_IOCP)
# include "asio/detail/win_iocp_io_context.hpp"
#else
# include "asio/detail/scheduler.hpp"
#endif
#include "asio/detail/push_options.hpp" #include "asio/detail/push_options.hpp"
namespace asio { namespace asio {
namespace detail { namespace detail {
#if defined(ASIO_HAS_IOCP) #if defined(ASIO_HAS_IOCP)
typedef class win_iocp_io_context io_context_impl; typedef win_iocp_io_context io_context_impl;
class win_iocp_overlapped_ptr; class win_iocp_overlapped_ptr;
#else #else
typedef class scheduler io_context_impl; typedef scheduler io_context_impl;
#endif #endif
struct io_context_bits struct io_context_bits