Emile Cormier

Results 281 comments of Emile Cormier

@chriskohlhoff It's currently not possible to use `any_completion_executor` with the Boost.Coroutine-based `spawn` with `ASIO_DISABLE_BOOST_COROUTINE` undefined. It complains that: ``` ‘const class asio::any_completion_executor’ has no member named ‘context’ ``` I tried...

As a workaround, I'm using this hack: ```c++ template void spawn_workaround(E& executor, F&& function) { using namespace asio; auto ex1 = executor.template target(); if (ex1 != nullptr) { spawn(*ex1, std::forward(function));...

> You'll need to use the completion-token overload for compatibility with any_completion_executor. I mistakenly thought those overloads where not available when `ASIO_DISABLE_BOOST_COROUTINE` is undefined. My bad.

@mabrarov I'm having difficulty understanding your second point. Can you clarify with some pseudocode?

@AsonWon Please triple-backticks to properly render your code with indentation: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks Even better, add the c++ tag next to the triple backticks as so: `` ```c++ ``

> Can you please try with the changes in this commit https://github.com/chriskohlhoff/asio/commit/13045b6017e13b5884b4a95b6a80f485b42f1edc @chriskohlhoff I tried the same example program above modified to use standalone Asio, and it works with the...

@chriskohlhoff Your fix doesn't seem to work when defining `ASIO_DISABLE_BOOST_COROUTINE`. I've tried this example: ```c++ #define ASIO_DISABLE_BOOST_COROUTINE #include #include #include #include #include //------------------------------------------------------------------------------ int main() { asio::io_context ioctx; // auto...

> Instead of detached pass [](std::exception_ptr e){ if (e) std::rethrow_exception(e); } Ah, yes, I see now that `spawn` takes a completion token with a handler having the signature `void handler(std::exception_ptr);`....

@AsonWon The `forced_unwind` exception is already caught internally by the the Boost library, so it will never make its way to your `main`. The Boost library throws and catches the...

> My question is that, how should i do if i want to disable or avoid this forced_unwind exception? or I ignore it and do nothing? You can't disable the...