So, we have pseudo code like:
super_local_thread() { try{ throw err; }catch(err) { throw err2; }
and we started this thread with boost. We want to pass its error to another thread. How to do it?
C ++ 11 defines the function current_exception (in the standard, section 18.8 Exception Handling) so that you can do just that.
current_exception
Here's an MSDN article on carrying exceptions between threads that use this feature.
Since you are using Boost, here is the Boost documentation for current_exception and Boost article on transferring exceptions between threads .
This MSDN article may be helpful.
http://msdn.microsoft.com/en-us/library/dd293602.aspx
To implement exception transport, Visual C ++ provides exception_ptr and current_exception, rethrow_exception, and copy_exception.
You can not; exceptions occur in only one thread. However, you can use the top-level function for all exceptions and use a different mechanism to report an exception for the rest of your application.
Source: https://habr.com/ru/post/1401917/More articles:How to use XSLT to update a single value in XML? - xmlMinimal implementation of gmtime algorithm? - c ++Upload a photo to the gallery as a raster object in Android - androidAS3 - Export or save a sprite in SVG or other vector format - actionscript-3FLASH save frame, image (tiff, bmp, jpg, gif, png) - flashhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1401918/can-one-retrieve-data-from-a-mediaplayers-stream&usg=ALkJrhjrN005xw9W5bqZXqIkVP5bbI_McgAptana, SourceTree and Git - Newbie - gitConstructor built-in functions in Javascript - javascriptBuild a script using C # - c #.Net / C # Build Tool - Is NAnt the preferred tool? - c #All Articles