Boost C++ Libraries: Ticket #5496: Add API for detection of exception https://svn.boost.org/trac10/ticket/5496 <p> Purpose: detect if it's possible to call boost::current_exception() when writing generic code. </p> <p> Solution: add BOOST_CATCH_EXCEPTION() macro or boost::catch_exception() function and boost::has_current_exception() function. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5496 Trac 1.4.3 anberlin.myplace@… Fri, 22 Apr 2011 17:28:41 GMT <link>https://svn.boost.org/trac10/ticket/5496#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5496#comment:1</guid> <description> <p> or add something like </p> <pre class="wiki">struct __type__ { __type__() { set_current_exception( true ); } ~__type__() { set_current_exception( false ); } }; #define BOOST_REGISTER_EXCEPTION __type__ __a__; try{ ... } catch( ... ) { assert( !has_current_exception() ); BOOST_REGISTER_EXCEPTION(); assert( has_current_exception() ); ... } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 22 Apr 2011 17:42:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5496#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5496#comment:2</guid> <description> <p> std::uncaught_exception? </p> </description> <category>Ticket</category> </item> <item> <author>anberlin.myplace@…</author> <pubDate>Fri, 22 Apr 2011 18:07:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5496#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5496#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5496#comment:2" title="Comment 2">steven_watanabe</a>: </p> <blockquote class="citation"> <p> std::uncaught_exception? </p> </blockquote> <p> It's already catched exception, because we can use boost::current_exception() only in catch block. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Emil Dotchevski</dc:creator> <pubDate>Tue, 19 Jun 2012 23:41:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5496#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5496#comment:4</guid> <description> <p> What is the motivating case for this feature? </p> </description> <category>Ticket</category> </item> </channel> </rss>