forked from boostorg/exception
removed tabs from source files
updated documentation [SVN r47250]
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Boost Exception</title>
|
||||
<title>boost exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
@ -21,13 +21,13 @@
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<h2>Introduction</h2>
|
||||
<p>The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.</p>
|
||||
<p>It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception classes. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.</p>
|
||||
<p>It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.</p>
|
||||
<p>The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. </p>
|
||||
<p>Boost Exception also supports <span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></span>-style <span class="RenoLink"><a href="tutorial_exception_ptr.html">copying</a></span> of exception objects, implemented non-intrusively and automatically by the boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function.</p>
|
||||
<h2>Contents</h2>
|
||||
<div><ol><li>Tutorial<div><ol><li><span class="RenoLink"><a href="tutorial_transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_exception_ptr.html">Tutorial: Transporting of Exceptions between Threads</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_exception_ptr.html">Tutorial: Transporting of Exceptions Between Threads</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_diagnostic_information.html">Tutorial: Diagnostic Information</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
@ -155,7 +155,8 @@ boost
|
||||
#endif</span></span>
|
||||
}</pre>
|
||||
<h2>Class exception</h2>
|
||||
<div class="RenoIncludeDIV"><h3>exception</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -177,7 +178,8 @@ boost
|
||||
</div><p>Class boost::<span class="RenoLink"><a href="exception.html">exception</a></span> is designed to be used as a universal base for user-defined exception types.</p>
|
||||
<p>An object of any type deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> can store data of arbitrary types, using the <span class="RenoLink"><a href="error_info.html">error_info</a></span> wrapper and <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span>.</p>
|
||||
<p>To retrieve data from a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object, use the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template.</p>
|
||||
<div class="RenoIncludeDIV"><h3>exception::exception</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoLink"><a href="exception_constructors.html">exception</a></span>();
|
||||
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const & x );</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
@ -186,22 +188,27 @@ boost
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>exception::~exception</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::~exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<p>Frees all resources associated with a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>exception::diagnostic_information</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::diagnostic_information</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre>virtual char const * <span class="RenoLink"><a href="exception_diagnostic_information.html">diagnostic_information</a></span>() const throw();</pre>
|
||||
</div><h4>Returns:</h4>
|
||||
<p>An string representation of all data stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object by the <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> function. See "<span class="RenoLink"><a href="tutorial_diagnostic_information.html">Tutorial: Diagnostic Information</a></span>" for details.</p>
|
||||
<p>A string representation of all data stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object by the <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> function. See "<span class="RenoLink"><a href="tutorial_diagnostic_information.html">Tutorial: Diagnostic Information</a></span>" for details.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
<h4>Note:</h4>
|
||||
<p>The return value remains valid until the exception object from which it is obtained is destroyed or modified.</p>
|
||||
<h4>Notes:</h4>
|
||||
<div><ul><li>The return value remains valid until the exception object from which it was obtained is destroyed or modified.</li>
|
||||
<li>The header <span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span> provides a namespace-scope function <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> which takes a std::exception. It calls <span class="RenoLink"><a href="exception_diagnostic_information.html">exception::diagnostic_information</a></span> if its argument can be converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>; otherwise it returns a string that combines the value of std::exception::what and the exception's dynamic type.</li>
|
||||
</ul></div>
|
||||
</div></div><h2>Transporting of Arbitrary Data to the Catch Site</h2>
|
||||
<div class="RenoIncludeDIV"><h3>error_info</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -218,7 +225,7 @@ boost
|
||||
};</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must have accessible copy constructor and must not be a reference.</p>
|
||||
<p>T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.)</p>
|
||||
<h4>Description:</h4>
|
||||
<p>This class template is used to associate a Tag type with a value type T. Objects of type <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> can be passed to <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> to be stored in objects of type boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Note:</h4>
|
||||
@ -226,8 +233,9 @@ boost
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_errno,int> errno_info;</pre>
|
||||
<p>Of course, to actually add an errno_info object to exceptions using <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span>, or to retrieve it using <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, you must first #include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>operator<<, error_info overload</h3>
|
||||
<p>Of course, to actually add an <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to <span class="RenoLink"><a href="exception.html">exceptions</a></span> using <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span>, or to retrieve it using <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, you must first #include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>operator<</exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>><span class="RenoBR"> </span><br/></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -238,12 +246,34 @@ boost
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>E must be boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, or a type that derives (indirectly) from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Effects:</h4>
|
||||
<p>Stores a copy of v into x. If x already contains data of type <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag1,T1>, that data is overwritten.</p>
|
||||
<p>Stores a copy of v into x. If x already contains data of type <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T>, that data is overwritten.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>x.</p>
|
||||
<div class="RenoIncludeDIV"><h4>Throws:</h4>
|
||||
<p>std::bad_alloc, or any exception emitted by the T copy constructor.</p>
|
||||
</div></div><div class="RenoIncludeDIV"><h3>get_error_info</h3>
|
||||
</div></div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>operator<</tuple</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class E, class Tag1, class T1, ..., class TagN, class TN>
|
||||
E const & <span class="RenoLink"><a href="operator_shl_tuple.html">operator<<</a></span>( E const & x,
|
||||
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span><
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag1,T1>,
|
||||
...,
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><TagN,TN> > const & v );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>E must be boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, or a type that derives (indirectly) from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Effects:</h4>
|
||||
<p>Equivalent to x << v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span><0>() << ... << v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span><N>().</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>x.</p>
|
||||
<div class="RenoIncludeDIV"><h4>Throws:</h4>
|
||||
<p>std::bad_alloc, or any exception emitted by T1..TN copy constructor.</p>
|
||||
</div></div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>get_error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -252,12 +282,17 @@ boost
|
||||
<span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span><typename ErrorInfo::value_type const> <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>The type of the x object must derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>; ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</p>
|
||||
<div><ul><li> ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</li>
|
||||
<li> E must be polymorphic.</li>
|
||||
</ul></div>
|
||||
<h4>Returns:</h4>
|
||||
<p>If x does not store an object of type ErrorInfo, returns an empty <span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span>; otherwise returns pointer to the stored value. Use <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> to store values in exception objects.</p>
|
||||
<div><ul><li> If dynamic_cast<boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr.</li>
|
||||
<li> Otherwise, the returned shared_ptr points to the stored value (use <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> to store values in exception objects.) The shared_ptr is valid even after x has been destroyed.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>enable_error_info</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -266,12 +301,15 @@ boost
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must be a user-defined type with accessible no-throw copy constructor.</p>
|
||||
<p>T must be a user-defined type with accessible no-throw copy constructor as per (15.5.1).</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>An object of unspecified type with no-throw copy semantics, which derives publicly from both T, and class boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. The T sub-object is initialized from x by the T copy constructor. If T already derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the type of the returned object does not derive boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<div><ul><li> If T derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned object is of type T and is a copy of x.</li>
|
||||
<li> Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. The T sub-object is initialized from x by the T copy constructor.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>BOOST_ERROR_INFO</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_ERROR_INFO</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -285,9 +323,10 @@ boost
|
||||
::boost::throw_file(__FILE__) <<\
|
||||
::boost::throw_line((int)__LINE__)</span>
|
||||
}</pre>
|
||||
</div><p>This macro is designed to be used with <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> when throwing a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, to store information about the location of the throw statement. It can be chained with other <span class="RenoLink"><a href="error_info.html">error_info</a></span>s in a single throw expression.</p>
|
||||
</div><p>This macro is designed to be used with <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span> when throwing a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, to store information about the location of the throw statement. It can be chained with other <span class="RenoLink"><a href="error_info.html">error_infos</a></span> in a single throw expression.</p>
|
||||
</div><h2>Transporting of Exceptions between Threads</h2>
|
||||
<div class="RenoIncludeDIV"><h3>exception_ptr</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception_ptr</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -297,9 +336,8 @@ boost
|
||||
</div><p>The <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>'s operations do not throw.</p>
|
||||
<p>Two instances of <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> are equivalent and compare equal if and only if they refer to the same exception.</p>
|
||||
<p>The default constructor of <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> produces the null value of the type. The null value is equivalent only to itself.</p>
|
||||
<h4>Note:</h4>
|
||||
<p> <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> objects are returned by <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> and <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>enable_current_exception</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_current_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_exception_cloning_hpp.html">boost/exception/enable_current_exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -308,11 +346,11 @@ boost
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const & e );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must have an accessible no-throw copy constructor</p>
|
||||
<p>T must have an accessible no-throw copy constructor.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>An object of <i>unspecified</i> type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &).</p>
|
||||
<h4>Description:</h4>
|
||||
<p>This function is designed to be used directly in a throw-expression to enable the exception_ptr support in Boost Exception. For example:</p>
|
||||
<p>This function is designed to be used directly in a throw-expression to enable the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> support in Boost Exception. For example:</p>
|
||||
<pre>class
|
||||
my_exception:
|
||||
public std::exception
|
||||
@ -323,8 +361,9 @@ my_exception:
|
||||
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(my_exception());</pre>
|
||||
<p>Unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> is called at the time an exception object is used in a throw-expression, an attempt to copy it using <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> which refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. See <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> for details.</p>
|
||||
<h4>Note:</h4>
|
||||
<p>Instead of using the throw keyword directly, it is preferable to call boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. This is guaranteed to throw an exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and supports exception_ptr functionality.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>current_exception</h3>
|
||||
<p>Instead of using the throw keyword directly, it is preferable to call boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. This is guaranteed to throw an exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and supports the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> functionality.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -341,9 +380,10 @@ boost
|
||||
<p>Nothing.</p>
|
||||
<h4>Notes:</h4>
|
||||
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> refer to the same exception object.</li>
|
||||
<li> Correct implementation of <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> is used at the time the currently handled exception object was passed to throw. If <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> is not used, and if the compiler does not provide the necessary support, then <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. In this case, if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> object is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor.</li>
|
||||
<li> Correct implementation of <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. If <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was not used, and if the compiler does not provide the necessary support, then <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. In this case, if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> object is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor.</li>
|
||||
</ul></div>
|
||||
</div><div class="RenoIncludeDIV"><h3>copy_exception</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>copy_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -353,7 +393,8 @@ boost
|
||||
}</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<p>As if try { throw e; } catch( ... ) { return <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>(); }</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>rethrow_exception</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>rethrow_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -364,7 +405,8 @@ boost
|
||||
<p>ep shall not be null.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>The exception to which ep refers.</p>
|
||||
</div><div class="RenoIncludeDIV"><h3>unknown_exception</h3>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>unknown_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -379,7 +421,8 @@ boost
|
||||
}</pre>
|
||||
</div><p>This type is used by the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> support in Boost Exception. Please see <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
|
||||
</div><h2>Printing Diagnostic Information</h2>
|
||||
<div class="RenoIncludeDIV"><h3>diagnostic_information</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>diagnostic_information</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -387,9 +430,10 @@ boost
|
||||
<span class="RenoIncludeSPAN"> std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( std::exception const & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Returns:</h4>
|
||||
<p>If dynamic_cast<boost::<span class="RenoLink"><a href="exception.html">exception</a></span> *>(&x) is not null, the returned string is initialized by a call to <span class="RenoLink"><a href="exception_diagnostic_information.html">exception::diagnostic_information</a></span>; otherwise, the returned string combines the output of x.what() and typeid(x).name().</p>
|
||||
<p>If dynamic_cast<boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *>(&x) is not null, the returned string is initialized by a call to <span class="RenoLink"><a href="exception_diagnostic_information.html">exception::diagnostic_information</a></span>; otherwise, the returned string combines the output of x.what() and typeid(x).name().</p>
|
||||
</div><h2>Throwing Exceptions</h2>
|
||||
<div class="RenoIncludeDIV"><h3>throw_exception</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>throw_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
@ -409,7 +453,7 @@ boost
|
||||
<p>E must derive publicly from std::exception.</p>
|
||||
<h4>Effects:</h4>
|
||||
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></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"><a href="throw_exception.html">throw_exception</a></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 throw_exception are allowed to assume that the function never returns; therefore, if the user-defined throw_exception 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"><a href="throw_exception.html">throw_exception</a></span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> returns, the behavior is undefined.</li>
|
||||
</ul></div>
|
||||
</div><!-- Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
|
Reference in New Issue
Block a user