diff --git a/include/boost/process/v2/bind_launcher.hpp b/include/boost/process/v2/bind_launcher.hpp index 158244816..e63260c51 100644 --- a/include/boost/process/v2/bind_launcher.hpp +++ b/include/boost/process/v2/bind_launcher.hpp @@ -71,7 +71,7 @@ struct bound_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits) -> basic_process @@ -88,7 +88,7 @@ struct bound_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -103,8 +103,8 @@ struct bound_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -120,8 +120,8 @@ struct bound_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -138,7 +138,7 @@ struct bound_launcher auto invoke(detail::index_sequence, ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits) -> basic_process @@ -156,7 +156,7 @@ struct bound_launcher ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -172,8 +172,8 @@ struct bound_launcher auto invoke(detail::index_sequence, Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -190,8 +190,8 @@ struct bound_launcher Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process diff --git a/include/boost/process/v2/detail/config.hpp b/include/boost/process/v2/detail/config.hpp index 40fe2e087..0dbf5a993 100644 --- a/include/boost/process/v2/detail/config.hpp +++ b/include/boost/process/v2/detail/config.hpp @@ -7,12 +7,8 @@ #if defined(BOOST_PROCESS_V2_STANDALONE) -#define BOOST_PROCESS_V2_ASIO_NAMESPACE asio + #define BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(Sig) ASIO_COMPLETION_TOKEN_FOR(Sig) -#define BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN_TYPE(Executor) ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor) -#define BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(Token, Signature) ASIO_INITFN_AUTO_RESULT_TYPE(Token, Signature) -#define BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN(Executor) ASIO_DEFAULT_COMPLETION_TOKEN(Executor) -#define BOOST_PROCESS_V2_INITFN_DEDUCED_RESULT_TYPE(x,y,z) ASIO_INITFN_DEDUCED_RESULT_TYPE(x,y,z) #include #include @@ -38,14 +34,14 @@ #define BOOST_PROCESS_V2_END_NAMESPACE } #define BOOST_PROCESS_V2_NAMESPACE process_v2 +namespace asio {} +BOOST_PROCESS_V2_BEGIN_NAMESPACE +namespace net = ::asio; +BOOST_PROCESS_V2_END_NAMESPACE + #else -#define BOOST_PROCESS_V2_ASIO_NAMESPACE boost::asio #define BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(Sig) BOOST_ASIO_COMPLETION_TOKEN_FOR(Sig) -#define BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN_TYPE(Executor) BOOST_ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(Executor) -#define BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(Token, Signature) BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(Token, Signature) -#define BOOST_PROCESS_V2_DEFAULT_COMPLETION_TOKEN(Executor) BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor) -#define BOOST_PROCESS_V2_INITFN_DEDUCED_RESULT_TYPE(x,y,z) BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(x,y,z) #include #include @@ -94,6 +90,11 @@ #define BOOST_PROCESS_V2_END_NAMESPACE } } } #define BOOST_PROCESS_V2_NAMESPACE boost::process::v2 +namespace boost { namespace asio {} } +BOOST_PROCESS_V2_BEGIN_NAMESPACE +namespace net = ::boost::asio; +BOOST_PROCESS_V2_END_NAMESPACE + #endif BOOST_PROCESS_V2_BEGIN_NAMESPACE diff --git a/include/boost/process/v2/detail/process_handle_fd.hpp b/include/boost/process/v2/detail/process_handle_fd.hpp index 7a94dd0d0..9a0363355 100644 --- a/include/boost/process/v2/detail/process_handle_fd.hpp +++ b/include/boost/process/v2/detail/process_handle_fd.hpp @@ -34,7 +34,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE namespace detail { -template +template struct basic_process_handle_fd { using native_handle_type = int; @@ -56,7 +56,7 @@ struct basic_process_handle_fd basic_process_handle_fd(ExecutionContext &context, typename std::enable_if< std::is_convertible::value>::type * = nullptr) + net::execution_context &>::value>::type * = nullptr) : pid_(-1), descriptor_(context) { } @@ -275,25 +275,16 @@ struct basic_process_handle_fd return pid_ != -1; } - template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type)) - async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) - { - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( - async_wait_op_{descriptor_, pid_}, handler, descriptor_); - } - private: template friend struct basic_process_handle_fd; pid_type pid_ = -1; - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_stream_descriptor descriptor_; + net::posix::basic_stream_descriptor descriptor_; struct async_wait_op_ { - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_descriptor &descriptor; + net::posix::basic_descriptor &descriptor; pid_type pid_; template @@ -304,7 +295,7 @@ struct basic_process_handle_fd native_exit_code_type exit_code{}; int wait_res = -1; if (pid_ <= 0) // error, complete early - ec = BOOST_PROCESS_V2_ASIO_NAMESPACE::error::bad_descriptor; + ec = net::error::bad_descriptor; else { wait_res = ::waitpid(pid_, &exit_code, WNOHANG); @@ -315,8 +306,7 @@ struct basic_process_handle_fd if (!ec && (wait_res == 0)) { - descriptor.async_wait( - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::descriptor_base::wait_read, std::move(self)); + descriptor.async_wait(net::posix::descriptor_base::wait_read, std::move(self)); return; } @@ -331,8 +321,7 @@ struct basic_process_handle_fd self.complete(ec, code); } }; - BOOST_PROCESS_V2_ASIO_NAMESPACE::post(descriptor.get_executor(), - completer{ec, exit_code, std::move(self)}); + net::post(descriptor.get_executor(), completer{ec, exit_code, std::move(self)}); } @@ -346,6 +335,18 @@ struct basic_process_handle_fd std::move(self).complete(ec, exit_code); } }; + public: + + template> + auto async_wait(WaitHandler &&handler = net::default_completion_token_t()) + -> decltype(net::async_compose( + async_wait_op_{descriptor_, pid_}, handler, descriptor_)) + { + return net::async_compose( + async_wait_op_{descriptor_, pid_}, handler, descriptor_); + } + }; } diff --git a/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp b/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp index 97d9400a0..5c2416765 100644 --- a/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp +++ b/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp @@ -37,7 +37,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE namespace detail { -template +template struct basic_process_handle_fd_or_signal { using native_handle_type = int; @@ -59,7 +59,7 @@ struct basic_process_handle_fd_or_signal basic_process_handle_fd_or_signal(ExecutionContext &context, typename std::enable_if< std::is_convertible::value + net::execution_context &>::value >::type * = nullptr) : pid_(-1), descriptor_(context) { @@ -70,7 +70,7 @@ struct basic_process_handle_fd_or_signal pid_type pid, typename std::enable_if< std::is_convertible::value + net::execution_context &>::value >::type * = nullptr) : pid_(pid), descriptor_(context) { @@ -81,7 +81,7 @@ struct basic_process_handle_fd_or_signal pid_type pid, native_handle_type process_handle, typename std::enable_if< std::is_convertible::value + net::execution_context &>::value >::type * = nullptr) : pid_(pid), descriptor_(context, process_handle) { @@ -305,31 +305,22 @@ struct basic_process_handle_fd_or_signal return pid_ != -1; } - template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type)) - async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) - { - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( - async_wait_op_{descriptor_, signal_set_, pid_}, handler, descriptor_); - } - private: template friend struct basic_process_handle_fd_or_signal; pid_type pid_ = -1; - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_stream_descriptor descriptor_; - BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set signal_set_{descriptor_.get_executor(), SIGCHLD}; + net::posix::basic_stream_descriptor descriptor_; + net::basic_signal_set signal_set_{descriptor_.get_executor(), SIGCHLD}; struct async_wait_op_ { - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_descriptor &descriptor; - BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set &handle; + net::posix::basic_descriptor &descriptor; + net::basic_signal_set &handle; pid_type pid_; bool needs_post = true; - template void operator()(Self && self) { self.reset_cancellation_state(asio::enable_total_cancellation()); @@ -342,7 +333,7 @@ struct basic_process_handle_fd_or_signal native_exit_code_type exit_code{}; int wait_res = -1; if (pid_ <= 0) // error, complete early - ec = BOOST_PROCESS_V2_ASIO_NAMESPACE::error::bad_descriptor; + ec = net::error::bad_descriptor; else { wait_res = ::waitpid(pid_, &exit_code, WNOHANG); @@ -355,7 +346,7 @@ struct basic_process_handle_fd_or_signal needs_post = false; if (descriptor.is_open()) descriptor.async_wait( - BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::descriptor_base::wait_read, + net::posix::descriptor_base::wait_read, std::move(self)); else handle.async_wait(std::move(self)); @@ -377,12 +368,22 @@ struct basic_process_handle_fd_or_signal const auto exec = self.get_executor(); completer cpl{ec, exit_code, std::move(self)}; if (needs_post) - BOOST_PROCESS_V2_ASIO_NAMESPACE::post(exec, std::move(cpl)); + net::post(exec, std::move(cpl)); else - BOOST_PROCESS_V2_ASIO_NAMESPACE::dispatch(exec, std::move(cpl)); + net::dispatch(exec, std::move(cpl)); } }; + public: + template> + auto async_wait(WaitHandler &&handler = net::default_completion_token_t()) + -> decltype(net::async_compose( + async_wait_op_{descriptor_, signal_set_, pid_}, handler, descriptor_)) + { + return net::async_compose( + async_wait_op_{descriptor_, signal_set_, pid_}, handler, descriptor_); + } }; } diff --git a/include/boost/process/v2/detail/process_handle_signal.hpp b/include/boost/process/v2/detail/process_handle_signal.hpp index ca486b343..6cf5ec893 100644 --- a/include/boost/process/v2/detail/process_handle_signal.hpp +++ b/include/boost/process/v2/detail/process_handle_signal.hpp @@ -34,7 +34,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE namespace detail { -template +template struct basic_process_handle_signal { struct native_handle_type @@ -61,7 +61,7 @@ struct basic_process_handle_signal basic_process_handle_signal(ExecutionContext &context, typename std::enable_if< std::is_convertible::value + net::execution_context &>::value >::type * = nullptr) : pid_(-1), signal_set_(context, SIGCHLD) { @@ -87,7 +87,7 @@ struct basic_process_handle_signal { pid_ = handle.id(); signal_set_.~basic_signal_set(); - using ss = BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set; + using ss = net::basic_signal_set; new (&signal_set_) ss(handle.get_executor(), SIGCHLD); handle.pid_ = -1; return *this; @@ -269,24 +269,15 @@ struct basic_process_handle_signal return pid_ != -1; } - template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type)) - async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) - { - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( - async_wait_op_{signal_set_, pid_}, handler, signal_set_); - } - private: template friend struct basic_process_handle_signal; pid_type pid_ = -1; - BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set signal_set_; + net::basic_signal_set signal_set_; struct async_wait_op_ { - BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set &handle; + net::basic_signal_set &handle; pid_type pid_; template @@ -301,16 +292,16 @@ struct basic_process_handle_signal template void operator()(Self &&self, error_code ec, int sig) { - if (ec == BOOST_PROCESS_V2_ASIO_NAMESPACE::error::operation_aborted && + if (ec == net::error::operation_aborted && self.get_cancellation_state().cancelled() - == BOOST_PROCESS_V2_ASIO_NAMESPACE::cancellation_type::none) + == net::cancellation_type::none) ec.clear(); native_exit_code_type exit_code = -1; int wait_res = -1; if (pid_ <= 0) // error, complete early - ec = BOOST_PROCESS_V2_ASIO_NAMESPACE::error::bad_descriptor; + ec = net::error::bad_descriptor; else if (!ec) { wait_res = ::waitpid(pid_, &exit_code, WNOHANG); @@ -337,9 +328,19 @@ struct basic_process_handle_signal }; const auto exec = self.get_executor(); - BOOST_PROCESS_V2_ASIO_NAMESPACE::dispatch(exec, completer{ec, exit_code, std::move(self)}); + net::dispatch(exec, completer{ec, exit_code, std::move(self)}); } }; + public: + template> + auto async_wait(WaitHandler &&handler = net::default_completion_token_t()) + -> decltype(net::async_compose( + async_wait_op_{signal_set_, pid_}, handler, signal_set_)) + { + return net::async_compose( + async_wait_op_{signal_set_, pid_}, handler, signal_set_); + } }; } diff --git a/include/boost/process/v2/detail/process_handle_windows.hpp b/include/boost/process/v2/detail/process_handle_windows.hpp index e92b86539..662d249f1 100644 --- a/include/boost/process/v2/detail/process_handle_windows.hpp +++ b/include/boost/process/v2/detail/process_handle_windows.hpp @@ -38,10 +38,10 @@ BOOST_PROCESS_V2_DECL void terminate_(void * handle, error_code & ec, native_exi BOOST_PROCESS_V2_DECL void request_exit_(pid_type pid_, error_code & ec); BOOST_PROCESS_V2_DECL void check_running_(void* handle, error_code & ec, native_exit_code_type & exit_status); -template +template struct basic_process_handle_win { - typedef BOOST_PROCESS_V2_ASIO_NAMESPACE::windows::basic_object_handle handle_type; + typedef net::windows::basic_object_handle handle_type; typedef typename handle_type::native_handle_type native_handle_type; typedef Executor executor_type; @@ -61,7 +61,7 @@ struct basic_process_handle_win basic_process_handle_win(ExecutionContext &context, typename std::enable_if< std::is_convertible::value + net::execution_context &>::value >::type = 0) : pid_(0), handle_(context) { @@ -266,15 +266,6 @@ struct basic_process_handle_win return handle_.is_open(); } - template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type)) - async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) - { - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( - async_wait_op_{handle_}, handler, handle_ - ); - } template friend struct basic_process_handle_win; private: @@ -314,6 +305,17 @@ struct basic_process_handle_win std::move(self).complete(ec, exit_code); } }; + public: + template> + auto async_wait(WaitHandler &&handler = default_completion_token_t()) + -> decltype(net::async_compose( + async_wait_op_{handle_}, handler, handle_)) + { + return net::async_compose( + async_wait_op_{handle_}, handler, handle_ + ); + } }; extern template struct basic_process_handle_win<>; diff --git a/include/boost/process/v2/execute.hpp b/include/boost/process/v2/execute.hpp index f910eef31..2ce2c1af5 100644 --- a/include/boost/process/v2/execute.hpp +++ b/include/boost/process/v2/execute.hpp @@ -47,7 +47,7 @@ struct execute_op struct cancel { - using cancellation_type = BOOST_PROCESS_V2_ASIO_NAMESPACE::cancellation_type; + using cancellation_type = net::cancellation_type; basic_process * proc; cancel(basic_process * proc) : proc(proc) {} @@ -66,15 +66,15 @@ struct execute_op template void operator()(Self && self) { - self.reset_cancellation_state(BOOST_PROCESS_V2_ASIO_NAMESPACE::enable_total_cancellation()); - BOOST_PROCESS_V2_ASIO_NAMESPACE::cancellation_slot s = self.get_cancellation_state().slot(); + self.reset_cancellation_state(net::enable_total_cancellation()); + net::cancellation_slot s = self.get_cancellation_state().slot(); if (s.is_connected()) s.emplace(proc.get()); auto pro_ = proc.get(); pro_->async_wait( - BOOST_PROCESS_V2_ASIO_NAMESPACE::bind_cancellation_slot( - BOOST_PROCESS_V2_ASIO_NAMESPACE::cancellation_slot(), + net::bind_cancellation_slot( + net::cancellation_slot(), std::move(self))); } @@ -101,17 +101,18 @@ struct execute_op * It is to note that `async_execute` will us the lowest selected cancellation * type. A subprocess might ignore anything not terminal. */ -template + WaitHandler = net::default_completion_token_t> inline -BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, int)) -async_execute(basic_process proc, - WaitHandler && handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(Executor)) +auto async_execute(basic_process proc, + WaitHandler && handler = net::default_completion_token_t()) + -> decltype(net::async_compose( + detail::execute_op{nullptr}, handler, std::declval())) { std::unique_ptr> pro_(new basic_process(std::move(proc))); auto exec = pro_->get_executor(); - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( + return net::async_compose( detail::execute_op{std::move(pro_)}, handler, exec); } diff --git a/include/boost/process/v2/popen.hpp b/include/boost/process/v2/popen.hpp index 7696eb718..4358520a3 100644 --- a/include/boost/process/v2/popen.hpp +++ b/include/boost/process/v2/popen.hpp @@ -34,7 +34,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE * * Popen can be used as a stream object in other protocols. */ -template +template struct basic_popen : basic_process { /// The executor of the process @@ -69,7 +69,7 @@ struct basic_popen : basic_process explicit basic_popen(ExecutionContext & context, typename std::enable_if< is_convertible::value, void *>::type = nullptr) + net::execution_context&>::value, void *>::type = nullptr) : basic_process{context} { } @@ -148,7 +148,7 @@ struct basic_popen : basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, std::initializer_list args, Inits&&... inits) @@ -169,7 +169,7 @@ struct basic_popen : basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, std::initializer_list args, Inits&&... inits) @@ -189,7 +189,7 @@ struct basic_popen : basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, Args&& args, Inits&&... inits) : basic_process(context) @@ -209,7 +209,7 @@ struct basic_popen : basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, Args&& args, Inits&&... inits) : basic_process(context) @@ -224,9 +224,9 @@ struct basic_popen : basic_process /// The type used for stdin on the parent process side. - using stdin_type = BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_writable_pipe; + using stdin_type = net::basic_writable_pipe; /// The type used for stdout on the parent process side. - using stdout_type = BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_readable_pipe; + using stdout_type = net::basic_readable_pipe; /// Get the stdin pipe. stdin_type & get_stdin() {return stdin_; } @@ -336,14 +336,11 @@ struct basic_popen : basic_process * std::vector. */ template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WriteToken, - void (boost::system::error_code, std::size_t)) - async_write_some(const ConstBufferSequence& buffers, - BOOST_ASIO_MOVE_ARG(WriteToken) token - BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t)) + WriteToken = net::default_completion_token_t> + auto async_write_some(const ConstBufferSequence& buffers, + WriteToken && token = net::default_completion_token_t()) + -> decltype(std::declval().async_write_some(buffers, std::forward(token))) { return stdin_.async_write_some(buffers, std::forward(token)); } @@ -451,14 +448,12 @@ struct basic_popen : basic_process * std::vector. */ template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(ReadToken, - void (boost::system::error_code, std::size_t)) - async_read_some(const MutableBufferSequence& buffers, + BOOST_ASIO_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t)) + ReadToken = net::default_completion_token_t> + auto async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadToken) token - BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) + = net::default_completion_token_t()) + -> decltype(std::declval().async_read_some(buffers, std::forward(token))) { return stdout_.async_read_some(buffers, std::forward(token)); } diff --git a/include/boost/process/v2/posix/default_launcher.hpp b/include/boost/process/v2/posix/default_launcher.hpp index 3645f9cba..8a856d285 100644 --- a/include/boost/process/v2/posix/default_launcher.hpp +++ b/include/boost/process/v2/posix/default_launcher.hpp @@ -305,7 +305,7 @@ struct default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -324,7 +324,7 @@ struct default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -335,8 +335,8 @@ struct default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -354,8 +354,8 @@ struct default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -381,13 +381,13 @@ struct default_launcher } fd_whitelist.push_back(pg.p[1]); - auto & ctx = BOOST_PROCESS_V2_ASIO_NAMESPACE::query( - exec, BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::context); - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_prepare); + auto & ctx = net::query( + exec, net::execution::context); + ctx.notify_fork(net::execution_context::fork_prepare); pid = ::fork(); if (pid == -1) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); detail::on_fork_error(*this, executable, argv, ec, inits...); detail::on_error(*this, executable, argv, ec, inits...); @@ -397,7 +397,7 @@ struct default_launcher else if (pid == 0) { ::close(pg.p[0]); - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_child); + ctx.notify_fork(net::execution_context::fork_child); ec = detail::on_exec_setup(*this, executable, argv, inits...); if (!ec) { @@ -413,7 +413,7 @@ struct default_launcher return basic_process{exec}; } - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); ::close(pg.p[1]); pg.p[1] = -1; int child_error{0}; diff --git a/include/boost/process/v2/posix/fork_and_forget_launcher.hpp b/include/boost/process/v2/posix/fork_and_forget_launcher.hpp index 08e81c9c1..6cf68b52a 100644 --- a/include/boost/process/v2/posix/fork_and_forget_launcher.hpp +++ b/include/boost/process/v2/posix/fork_and_forget_launcher.hpp @@ -20,7 +20,7 @@ struct fork_and_forget_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -39,7 +39,7 @@ struct fork_and_forget_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -50,8 +50,8 @@ struct fork_and_forget_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -69,8 +69,8 @@ struct fork_and_forget_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -84,13 +84,13 @@ struct fork_and_forget_launcher : default_launcher return basic_process(exec); } - auto & ctx = BOOST_PROCESS_V2_ASIO_NAMESPACE::query( - exec, BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::context); - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_prepare); + auto & ctx = net::query( + exec, net::execution::context); + ctx.notify_fork(net::execution_context::fork_prepare); pid = ::fork(); if (pid == -1) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); detail::on_fork_error(*this, executable, argv, ec, inits...); detail::on_error(*this, executable, argv, ec, inits...); @@ -99,7 +99,7 @@ struct fork_and_forget_launcher : default_launcher } else if (pid == 0) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_child); + ctx.notify_fork(net::execution_context::fork_child); ec = detail::on_exec_setup(*this, executable, argv, inits...); if (!ec) @@ -112,7 +112,7 @@ struct fork_and_forget_launcher : default_launcher ::exit(EXIT_FAILURE); return basic_process{exec}; } - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); if (ec) { detail::on_error(*this, executable, argv, ec, inits...); diff --git a/include/boost/process/v2/posix/pdfork_launcher.hpp b/include/boost/process/v2/posix/pdfork_launcher.hpp index 0df0b4100..016182734 100644 --- a/include/boost/process/v2/posix/pdfork_launcher.hpp +++ b/include/boost/process/v2/posix/pdfork_launcher.hpp @@ -25,7 +25,7 @@ struct pdfork_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -44,7 +44,7 @@ struct pdfork_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -55,8 +55,8 @@ struct pdfork_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -74,8 +74,8 @@ struct pdfork_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -101,13 +101,13 @@ struct pdfork_launcher : default_launcher } fd_whitelist.push_back(pg.p[1]); - auto & ctx = BOOST_PROCESS_V2_ASIO_NAMESPACE::query( - exec, BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::context); - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_prepare); + auto & ctx = net::query( + exec, net::execution::context); + ctx.notify_fork(net::execution_context::fork_prepare); pid = ::pdfork(&fd, PD_DAEMON | PD_CLOEXEC); if (pid == -1) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); detail::on_fork_error(*this, executable, argv, ec, inits...); detail::on_error(*this, executable, argv, ec, inits...); @@ -116,7 +116,7 @@ struct pdfork_launcher : default_launcher } else if (pid == 0) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_child); + ctx.notify_fork(net::execution_context::fork_child); ::close(pg.p[0]); ec = detail::on_exec_setup(*this, executable, argv, inits...); @@ -133,7 +133,7 @@ struct pdfork_launcher : default_launcher ::exit(EXIT_FAILURE); return basic_process{exec}; } - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); ::close(pg.p[1]); pg.p[1] = -1; int child_error{0}; diff --git a/include/boost/process/v2/posix/vfork_launcher.hpp b/include/boost/process/v2/posix/vfork_launcher.hpp index ed59ae724..b9b8b6578 100644 --- a/include/boost/process/v2/posix/vfork_launcher.hpp +++ b/include/boost/process/v2/posix/vfork_launcher.hpp @@ -22,7 +22,7 @@ struct vfork_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -41,7 +41,7 @@ struct vfork_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -52,8 +52,8 @@ struct vfork_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -71,8 +71,8 @@ struct vfork_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -86,13 +86,13 @@ struct vfork_launcher : default_launcher return basic_process(exec); } - auto & ctx = BOOST_PROCESS_V2_ASIO_NAMESPACE::query( - exec, BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::context); - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_prepare); + auto & ctx = net::query( + exec, net::execution::context); + ctx.notify_fork(net::execution_context::fork_prepare); pid = ::vfork(); if (pid == -1) { - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); detail::on_fork_error(*this, executable, argv, ec, inits...); detail::on_error(*this, executable, argv, ec, inits...); @@ -112,7 +112,7 @@ struct vfork_launcher : default_launcher ::_exit(EXIT_FAILURE); return basic_process{exec}; } - ctx.notify_fork(BOOST_PROCESS_V2_ASIO_NAMESPACE::execution_context::fork_parent); + ctx.notify_fork(net::execution_context::fork_parent); if (ec) { diff --git a/include/boost/process/v2/process.hpp b/include/boost/process/v2/process.hpp index a624297bb..9c96d23b7 100644 --- a/include/boost/process/v2/process.hpp +++ b/include/boost/process/v2/process.hpp @@ -34,7 +34,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE /* A `basic_process` object manages a subprocess; it tracks the status and exit-code, * and will terminate the process on destruction if `detach` was not called. */ -template +template struct basic_process { /// The executor of the process @@ -111,7 +111,7 @@ struct basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, std::initializer_list args, Inits&&... inits) @@ -125,7 +125,7 @@ struct basic_process ExecutionContext & context, typename std::enable_if< std::is_convertible::value, + net::execution_context&>::value, const filesystem::path&>::type exe, Args&& args, Inits&&... inits) : basic_process(default_process_launcher()(executor_type(context.get_executor()), @@ -148,7 +148,7 @@ struct basic_process explicit basic_process(ExecutionContext & context, pid_type pid, typename std::enable_if< std::is_convertible::value, void *>::type = nullptr) + net::execution_context&>::value, void *>::type = nullptr) : process_handle_(context, pid) {} /// Attach to an existing process and the internal handle @@ -156,7 +156,7 @@ struct basic_process explicit basic_process(ExecutionContext & context, pid_type pid, native_handle_type native_handle, typename std::enable_if< std::is_convertible::value, void *>::type = nullptr) + net::execution_context&>::value, void *>::type = nullptr) : process_handle_(context.get_executor(), pid, native_handle) {} /// Create an invalid handle @@ -164,7 +164,7 @@ struct basic_process explicit basic_process(ExecutionContext & context, typename std::enable_if< is_convertible::value, void *>::type = nullptr) + net::execution_context&>::value, void *>::type = nullptr) : process_handle_(context.get_executor()) {} @@ -325,15 +325,7 @@ struct basic_process /** Note that this might be a process that already exited.*/ bool is_open() const { return process_handle_.is_open(); } - /// Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler. - template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, int)) - async_wait(WaitHandler && handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) - { - return BOOST_PROCESS_V2_ASIO_NAMESPACE::async_compose( - async_wait_op_{process_handle_, exit_status_}, handler, process_handle_); - } + private: template @@ -363,7 +355,7 @@ struct basic_process } }; - BOOST_PROCESS_V2_ASIO_NAMESPACE::post(handle.get_executor(), + net::post(handle.get_executor(), completer{static_cast(res), std::move(self)}); } else @@ -383,6 +375,18 @@ struct basic_process } } }; + + public: + /// Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler. + template > + auto async_wait(WaitHandler && handler = net::default_completion_token_t()) + -> decltype(net::async_compose( + async_wait_op_{process_handle_, exit_status_}, handler, process_handle_)) + { + return net::async_compose( + async_wait_op_{process_handle_, exit_status_}, handler, process_handle_); + } }; /// Process with the default executor. diff --git a/include/boost/process/v2/process_handle.hpp b/include/boost/process/v2/process_handle.hpp index 9e50f7a7c..e0894e338 100644 --- a/include/boost/process/v2/process_handle.hpp +++ b/include/boost/process/v2/process_handle.hpp @@ -32,7 +32,7 @@ BOOST_PROCESS_V2_BEGIN_NAMESPACE * Note that the exit code might be discovered early, during a call to `running`. * Thus it can only be discovered that process has exited already. */ -template +template struct basic_process_handle { /// The native handle of the process. @@ -123,28 +123,26 @@ struct basic_process_handle /// Asynchronously wait for the process to exit and deliver the native exit-code in the completion handler. template - BOOST_PROCESS_V2_INITFN_AUTO_RESULT_TYPE(WaitHandler, void (error_code, native_exit_code_type)) - async_wait(WaitHandler &&handler BOOST_ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)); - + WaitHandler = net::default_completion_token_t> + auto async_wait(WaitHandler &&handler = net::default_completion_token_t()); }; #else #if defined(BOOST_PROCESS_V2_WINDOWS) -template +template using basic_process_handle = detail::basic_process_handle_win; #else #if defined(BOOST_PROCESS_V2_PIDFD_OPEN) -template +template using basic_process_handle = detail::basic_process_handle_fd; #elif defined(BOOST_PROCESS_V2_PDFORK) -template +template using basic_process_handle = detail::basic_process_handle_fd_or_signal; #else -template +template using basic_process_handle = detail::basic_process_handle_signal; #endif diff --git a/include/boost/process/v2/stdio.hpp b/include/boost/process/v2/stdio.hpp index b2ae021c5..4dc92b838 100644 --- a/include/boost/process/v2/stdio.hpp +++ b/include/boost/process/v2/stdio.hpp @@ -103,7 +103,7 @@ struct process_io_binding template - process_io_binding(BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_readable_pipe & pipe) + process_io_binding(net::basic_readable_pipe & pipe) { if (Target == STD_INPUT_HANDLE) { @@ -112,9 +112,9 @@ struct process_io_binding return ; } - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::native_pipe_handle p[2]; + net::detail::native_pipe_handle p[2]; error_code ec; - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::create_pipe(p, ec); + net::detail::create_pipe(p, ec); if (ec) detail::throw_error(ec, "create_pipe"); @@ -124,7 +124,7 @@ struct process_io_binding template - process_io_binding(BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_writable_pipe & pipe) + process_io_binding(net::basic_writable_pipe & pipe) { if (Target != STD_INPUT_HANDLE) { @@ -132,9 +132,9 @@ struct process_io_binding h = std::unique_ptr{h_, get_flags(h_)}; return ; } - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::native_pipe_handle p[2]; + net::detail::native_pipe_handle p[2]; error_code ec; - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::create_pipe(p, ec); + net::detail::create_pipe(p, ec); if (ec) detail::throw_error(ec, "create_pipe"); @@ -181,7 +181,7 @@ struct process_io_binding } template - process_io_binding(BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_readable_pipe & readable_pipe) + process_io_binding(net::basic_readable_pipe & readable_pipe) { if (Target == STDIN_FILENO) { @@ -189,8 +189,8 @@ struct process_io_binding return ; } - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::native_pipe_handle p[2]; - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::create_pipe(p, ec); + net::detail::native_pipe_handle p[2]; + net::detail::create_pipe(p, ec); if (ec) detail::throw_error(ec, "create_pipe"); @@ -206,7 +206,7 @@ struct process_io_binding template - process_io_binding(BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_writable_pipe & writable_pipe) + process_io_binding(net::basic_writable_pipe & writable_pipe) { if (Target != STDIN_FILENO) @@ -214,9 +214,9 @@ struct process_io_binding fd = writable_pipe.native_handle(); return ; } - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::native_pipe_handle p[2]; + net::detail::native_pipe_handle p[2]; error_code ec; - BOOST_PROCESS_V2_ASIO_NAMESPACE::detail::create_pipe(p, ec); + net::detail::create_pipe(p, ec); if (ec) detail::throw_error(ec, "create_pipe"); diff --git a/include/boost/process/v2/windows/as_user_launcher.hpp b/include/boost/process/v2/windows/as_user_launcher.hpp index 1f12d9f99..88f9c2a29 100644 --- a/include/boost/process/v2/windows/as_user_launcher.hpp +++ b/include/boost/process/v2/windows/as_user_launcher.hpp @@ -28,7 +28,7 @@ struct as_user_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -47,7 +47,7 @@ struct as_user_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -58,8 +58,8 @@ struct as_user_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -77,8 +77,8 @@ struct as_user_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process diff --git a/include/boost/process/v2/windows/default_launcher.hpp b/include/boost/process/v2/windows/default_launcher.hpp index f10eee5a3..78cbd0cde 100644 --- a/include/boost/process/v2/windows/default_launcher.hpp +++ b/include/boost/process/v2/windows/default_launcher.hpp @@ -236,7 +236,7 @@ struct default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> enable_init @@ -255,7 +255,7 @@ struct default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> enable_init @@ -266,8 +266,8 @@ struct default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value - || BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value + || net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> enable_init @@ -285,8 +285,8 @@ struct default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> enable_init diff --git a/include/boost/process/v2/windows/with_logon_launcher.hpp b/include/boost/process/v2/windows/with_logon_launcher.hpp index 29c0e1270..e88722145 100644 --- a/include/boost/process/v2/windows/with_logon_launcher.hpp +++ b/include/boost/process/v2/windows/with_logon_launcher.hpp @@ -39,7 +39,7 @@ struct with_logon_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -51,7 +51,7 @@ struct with_logon_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -62,8 +62,8 @@ struct with_logon_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -81,8 +81,8 @@ struct with_logon_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process diff --git a/include/boost/process/v2/windows/with_token_launcher.hpp b/include/boost/process/v2/windows/with_token_launcher.hpp index e9f0dbfb2..a0b23bc41 100644 --- a/include/boost/process/v2/windows/with_token_launcher.hpp +++ b/include/boost/process/v2/windows/with_token_launcher.hpp @@ -29,7 +29,7 @@ struct with_token_launcher : default_launcher template auto operator()(ExecutionContext & context, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -48,7 +48,7 @@ struct with_token_launcher : default_launcher auto operator()(ExecutionContext & context, error_code & ec, const typename std::enable_if::value, + ExecutionContext&, net::execution_context&>::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -59,8 +59,8 @@ struct with_token_launcher : default_launcher template auto operator()(Executor exec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process @@ -78,8 +78,8 @@ struct with_token_launcher : default_launcher auto operator()(Executor exec, error_code & ec, const typename std::enable_if< - BOOST_PROCESS_V2_ASIO_NAMESPACE::execution::is_executor::value || - BOOST_PROCESS_V2_ASIO_NAMESPACE::is_executor::value, + net::execution::is_executor::value || + net::is_executor::value, filesystem::path >::type & executable, Args && args, Inits && ... inits ) -> basic_process