forked from boostorg/throw_exception
Merging long-standing changes from Trunk, including the slightly more sophisticated handling of the to_string conversion done in boost::diagnostic_information.
[SVN r83354]
This commit is contained in:
committed by
Peter Dimov
parent
9b26d9a9cc
commit
d0bbcab566
@ -27,15 +27,15 @@
|
|||||||
#include <boost/current_function.hpp>
|
#include <boost/current_function.hpp>
|
||||||
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
|
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
|
||||||
::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) <<\
|
::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) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) <<\
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
||||||
#else
|
#else
|
||||||
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
|
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
|
||||||
#endif</pre>
|
#endif</pre>
|
||||||
</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>
|
</div></div><p>This macro takes an exception object, records the current function name, __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>
|
||||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||||
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>
|
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="configuration_macros.html">Configuration Macros</a> | <a href="frequently_asked_questions.html">Frequently Asked Questions</a></span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <boost/current_function.hpp>
|
#include <boost/current_function.hpp>
|
||||||
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
|
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
|
||||||
::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) <<\
|
::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) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) <<\
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_function</a></span>(<span class="RenoLink"><a href="configuration_macros.html">BOOST_THROW_EXCEPTION_CURRENT_FUNCTION</a></span>) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
||||||
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
::boost::<span class="RenoLink"><a href="boost_exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
||||||
#else
|
#else
|
||||||
|
@ -32,14 +32,17 @@ boost
|
|||||||
void <span class="RenoLink">throw_exception</span>( E const & e );
|
void <span class="RenoLink">throw_exception</span>( E const & e );
|
||||||
#endif</span>
|
#endif</span>
|
||||||
}</pre>
|
}</pre>
|
||||||
</div><h4>Requirements:</h4>
|
</div><h4>Effects:</h4>
|
||||||
<p>E must derive publicly from std::exception.</p>
|
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) throws an exception of unspecified type that derives publicly from E and from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</li>
|
||||||
<h4>Effects:</h4>
|
|
||||||
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw e;</li>
|
|
||||||
<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink">throw_exception</span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink">throw_exception</span> returns, the behavior is undefined.</li>
|
<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink">throw_exception</span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink">throw_exception</span> returns, the behavior is undefined.</li>
|
||||||
</ul></div>
|
</ul></div>
|
||||||
<h4>Note:</h4>
|
<h4>Requirements:</h4>
|
||||||
<p>Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, or format an automatic diagnostic message using boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
|
<p>E must derive publicly from std::exception. E may or may not derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||||
|
<h4>Notes:</h4>
|
||||||
|
<div><ul><li> The emitted exception can be intercepted as E &, std::exception &, or boost::exception &.</li>
|
||||||
|
<li> The emitted exception supports boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>.</li>
|
||||||
|
<li> If BOOST_EXCEPTION_DISABLE is defined and BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) equivalent to throw e.</li>
|
||||||
|
</ul></div>
|
||||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||||
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a> | <a href="boost-exception.html">Boost Exception</a> | <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a> | <a href="configuration_macros.html">Configuration Macros</a> | <a href="enable_current_exception.html">enable_current_exception</a> | <a href="frequently_asked_questions.html">Frequently Asked Questions</a> | <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
|
See also: <span class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a> | <a href="boost-exception.html">Boost Exception</a> | <a href="boost_throw_exception_hpp.html">boost/throw_exception.hpp</a> | <a href="configuration_macros.html">Configuration Macros</a> | <a href="enable_current_exception.html">enable_current_exception</a> | <a href="frequently_asked_questions.html">Frequently Asked Questions</a> | <a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
|
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||||
#define UUID_274DA366004E11DCB1DDFE2E56D89593
|
#define UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||||
#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
#endif
|
#endif
|
||||||
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
|
||||||
|
Reference in New Issue
Block a user