Ticket #6450: BOOST_THROW_EXCEPTION.patch
File BOOST_THROW_EXCEPTION.patch, 3.3 KB (added by , 11 years ago) |
---|
-
BOOST_THROW_EXCEPTION.html
25 25 <div class="RenoIncludeDIV"><pre>#if !defined( BOOST_EXCEPTION_DISABLE ) 26 26 #include <<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>> 27 27 #include <boost/current_function.hpp> 28 # ifndef BOOST_THROW_EXCEPTION_CURRENT_FUNCTION 29 # define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION 30 # endif 28 31 #define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\ 29 32 ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) <<\ 30 ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_ CURRENT_FUNCTION) <<\33 ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) <<\ 31 34 ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\ 32 35 ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) ) 33 36 #else 34 37 #define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x) 35 38 #endif</pre> 36 </div></div><p>This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p> 39 </div></div><p>This macro takes an exception object, records BOOST_THROW_EXCEPTION_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p> 40 BOOST_CURRENT_FUNCTION can produce very long names, that may lead to huge size of output files. Users may define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION before including <span class="RenoLink"><a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a></span> to specify a different current function macro (for example a shorter but not portable __FUNCTION__ macro or to "(unknown)" value). </p> 37 41 </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> 38 42 See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a> | <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a> | <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span> 39 43 </div>