Ticket #6450: BOOST_THROW_EXCEPTION.patch

File BOOST_THROW_EXCEPTION.patch, 3.3 KB (added by Antony Polukhin, 11 years ago)
  • BOOST_THROW_EXCEPTION.html

     
    2525<div class="RenoIncludeDIV"><pre>#if !defined( BOOST_EXCEPTION_DISABLE )
    2626    #include &lt;<span class="RenoLink"><a href="boost_exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
    2727    #include &lt;boost/current_function.hpp&gt;
     28    # ifndef BOOST_THROW_EXCEPTION_CURRENT_FUNCTION
     29    #     define BOOST_THROW_EXCEPTION_CURRENT_FUNCTION BOOST_CURRENT_FUNCTION
     30    # endif
    2831    #define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
    2932        ::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) &lt;&lt;\
    30         ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
     33        ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) &lt;&lt;\
    3134        ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
    3235        ::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
    3336#else
    3437    #define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
    3538#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>
     40BOOST_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).&nbsp; </p>
    3741</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
    3842See also: <span class="RenoPageList"><a href="boost-exception.html">Boost Exception</a>&nbsp;| <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a>&nbsp;| <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
    3943</div>