You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to introduce a function similar to std::panic::catch_unwind that runs the closure under the exception handler and returns a Result<T, *const Context> indicating the status of the execution? Macros are generally harder to use than functions if the option is available because the syntax isn't always intuitive.
The text was updated successfully, but these errors were encountered:
I think I explored this but it's complicated because of closure capturing.
If it was a single callback then yes it would be simple. But it's 3 callbacks. If there's no state overlap then it's again simple. These callbacks 'overlap' causing borrow errors if you want to be able to mutate shared data in the closures.
This can be fixed with an explicit trait with 3 methods on it but marshalling this trait object over C++ isn't simple. Maybe I can give it another try but this code was just a simple hack job to see if it was possible at all.
I'm also not sure what you mean by similar to std::panic::catch_unwind: I'm not sure it can express the actual idea of __try __except (and I don't even handle __try __finally which I remember does not compose with __except).
Finally I don't even know or understand the full idea of SEH (only that you can use it to catch access violations) so I'm not even sure how to implement all of this.
Would it be possible to introduce a function similar to
std::panic::catch_unwind
that runs the closure under the exception handler and returns aResult<T, *const Context>
indicating the status of the execution? Macros are generally harder to use than functions if the option is available because the syntax isn't always intuitive.The text was updated successfully, but these errors were encountered: