Boost C++ Libraries: Ticket #9710: Support std::exception_ptr in boost::promise https://svn.boost.org/trac10/ticket/9710 <p> Please add something like this to boost::promise: </p> <blockquote> <p> void set_exception(std::exception_ptr e); </p> </blockquote> <p> if std::exception_ptr is available. </p> <p> I want to use boost futures, but don't want to wrap all of my throws in enable_current_exception(). See also: <a class="ext-link" href="http://stackoverflow.com/questions/22010388/converting-stdexception-ptr-to-boostexception-ptr"><span class="icon">​</span>http://stackoverflow.com/questions/22010388/converting-stdexception-ptr-to-boostexception-ptr</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9710 Trac 1.4.3 viboes Tue, 25 Feb 2014 22:39:49 GMT owner, status changed https://svn.boost.org/trac10/ticket/9710#comment:1 https://svn.boost.org/trac10/ticket/9710#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I don't think this is possible in an efficient way. I would prefer the user do the conversion using a specific function. Maybe you should ask for this function to Boost.Exception library author. </p> Ticket Matt Calabrese Mon, 10 Mar 2014 18:35:25 GMT <link>https://svn.boost.org/trac10/ticket/9710#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9710#comment:2</guid> <description> <p> This is a fairly annoying problem for me as well, especially when writing code where you don't have control over the exception that's thrown -- all you want to do is intercept the exception by calling std::current_exception and set the promise. I need to use boost::futures because of facilities like wait_for_any, but the fact that it implies no longer being able to capture arbitrary exceptions is a fairly annoying problem. What exactly is the issue right now that prevents adding a std::exception_ptr overload when available? It seems like in the case that std::exception_ptr is available, boost::future/promise could deal with std::exception_ptr internally instead of boost::exception_ptr, correct? Both overloads could be provided (one for std::exception_ptr and one for boost::exception_ptr) since converting boost::exception_ptr to std::exception_ptr should be a much simpler conversion than the other way around and can be done inside the implementation of boost::promise. Perhaps I'm missing some subtleties, though? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 10 Mar 2014 22:37:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9710#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9710#comment:3</guid> <description> <p> Maybe you are right and converting from boost::exception_ptr to std::exception_ptr could be more efficient. </p> <p> Ok, I will give it a try. I will request Emil a function to do the conversion, and apply it internally. I could also do the conversion using the external interfaces waiting for an efficient version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Matt Calabrese</dc:creator> <pubDate>Tue, 11 Mar 2014 16:50:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9710#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9710#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9710#comment:3" title="Comment 3">viboes</a>: </p> <blockquote class="citation"> <p> Maybe you are right and converting from boost::exception_ptr to std::exception_ptr could be more efficient. </p> <p> Ok, I will give it a try. I will request Emil a function to do the conversion, and apply it internally. I could also do the conversion using the external interfaces waiting for an efficient version. </p> </blockquote> <p> Awesome, and thanks for such a quick reply to this! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 12 Mar 2014 22:58:44 GMT</pubDate> <title>component changed https://svn.boost.org/trac10/ticket/9710#comment:5 https://svn.boost.org/trac10/ticket/9710#comment:5 <ul> <li><strong>component</strong> <span class="trac-field-old">threads</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket viboes Mon, 17 Mar 2014 18:33:02 GMT <link>https://svn.boost.org/trac10/ticket/9710#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9710#comment:6</guid> <description> <p> Created <a class="new ticket" href="https://svn.boost.org/trac10/ticket/9769" title="#9769: Feature Requests: Add conversion from boost::exception_ptr to std::exception_ptr when ... (new)">#9769</a>. Emil suggest to make boost::exception_ptr a typedef of std::exception_ptr when available. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 12 Oct 2014 14:32:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9710#comment:7 https://svn.boost.org/trac10/ticket/9710#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> I decided to don't fix this issue. <a class="new ticket" href="https://svn.boost.org/trac10/ticket/9769" title="#9769: Feature Requests: Add conversion from boost::exception_ptr to std::exception_ptr when ... (new)">#9769</a> should fix it. </p> Ticket RelicOfTesla@… Thu, 31 Mar 2016 02:40:35 GMT <link>https://svn.boost.org/trac10/ticket/9710#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9710#comment:8</guid> <description> <p> MSC_VER=1600,BOOST_VER=106000 invalid catch </p> <pre class="wiki">void foo_lang_test() { printf("MSC_VER=%d,BOOST_VER=%d\n", _MSC_VER , BOOST_VERSION ); boost::promise&lt;void&gt; pp; try { throw std::runtime_error("aa"); } catch(...) { pp.set_exception(std::current_exception()); } try { pp.get_future().get(); } catch(std::exception&amp; e) { printf("catch %s\n", e.what()); } catch(...) { printf("invalid catch\n"); } } </pre> </description> <category>Ticket</category> </item> </channel> </rss>