added functions current_exception_cast, current_exception_diagnostic_information, various other minor changes, documentation update

[SVN r52236]
This commit is contained in:
Emil Dotchevski
2009-04-07 18:33:44 +00:00
parent 0148c3a580
commit 027c0ff919
94 changed files with 7484 additions and 5888 deletions

View File

@ -22,7 +22,7 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_THROW_EXCEPTION</h3> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_THROW_EXCEPTION</h3>
</div> </div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p> <div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#if !defined( BOOST_NO_EXCEPTIONS ) &amp;&amp; !defined( BOOST_EXCEPTION_DISABLE ) <div class="RenoIncludeDIV"><pre>#if !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt; #include &lt;boost/current_function.hpp&gt;
#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)\
@ -34,10 +34,13 @@
#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>(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>(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 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 class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> </div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/> </a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/> </a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a></div> </a></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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->

View File

@ -19,7 +19,7 @@
<!-- 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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<h2>Introduction</h2> <div class="RenoIncludeDIV"><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>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 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>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>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>
@ -27,14 +27,18 @@
<h2>Contents</h2> <h2>Contents</h2>
<div><ol><li><span class="RenoLink"><a href="motivation.html">Motivation</a></span></li> <div><ol><li><span class="RenoLink"><a href="motivation.html">Motivation</a></span></li>
<li>Tutorial<div><ol><li><span class="RenoLink"><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></span></li> <li>Tutorial<div><ol><li><span class="RenoLink"><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></span></li>
<li><span class="RenoLink"><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></span></li>
<li><span class="RenoLink"><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></span></li> <li><span class="RenoLink"><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></span></li>
<li><span class="RenoLink"><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span></li> <li><span class="RenoLink"><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span></li>
<li><span class="RenoLink"><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags</a></span></li> <li><span class="RenoLink"><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags</a></span></li>
<li><span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types</a></span></li> <li><span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types</a></span></li>
<li><span class="RenoLink"><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></span></li>
</ol></div> </ol></div>
</li> </li>
<li>Documentation<div><ol><li>Class <span class="RenoLink"><a href="exception.html">exception</a></span></li> <li>Documentation<div><ol><li>Class <span class="RenoLink"><a href="exception.html">exception</a></span></li>
<li>Throwing Exceptions<div><ol><li><span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span></li>
<li><span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span></li>
</ol></div>
</li>
<li>Transporting of Arbitrary Data to the Catch Site<div><ol><li><span class="RenoLink"><a href="error_info.html">error_info</a></span></li> <li>Transporting of Arbitrary Data to the Catch Site<div><ol><li><span class="RenoLink"><a href="error_info.html">error_info</a></span></li>
<li><span class="RenoLink"><a href="exception_operator_shl.html">exception/operator&lt;&lt;</a></span></li> <li><span class="RenoLink"><a href="exception_operator_shl.html">exception/operator&lt;&lt;</a></span></li>
<li><span class="RenoLink"><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a></span></li> <li><span class="RenoLink"><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a></span></li>
@ -50,436 +54,27 @@
<li><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></li> <li><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></li>
</ol></div> </ol></div>
</li> </li>
<li><span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span></li> <li>Diagnostic Information<div><ol><li><span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span></li>
<li><span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span></li> <li><span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span></li>
<li><span class="RenoLink"><a href="configuration_macros.html">Configuration Macros</a></span></li>
<li>Headers<div><ol><li><span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span></li>
<li><span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span></li>
<li><span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span></li>
</ol></div> </ol></div>
</li> </li>
<li><span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span></li>
</ol></div>
</li>
<li>API<div><ol><li><span class="RenoLink"><a href="synopsis.html">Synopsis</a></span></li>
<li><span class="RenoLink"><a href="headers.html">Headers</a></span></li>
<li><span class="RenoLink"><a href="types.html">Types</a></span></li>
<li><span class="RenoLink"><a href="functions.html">Functions</a></span></li>
<li><span class="RenoLink"><a href="macros.html">Macros</a></span></li>
<li><span class="RenoLink"><a href="configuration_macros.html">Configuration Macros</a></span></li>
</ol></div> </ol></div>
</li> </li>
<li><span class="RenoLink"><a href="frequently_asked_questions.html">Frequently Asked Questions</a></span></li> <li><span class="RenoLink"><a href="frequently_asked_questions.html">Frequently Asked Questions</a></span></li>
<li><span class="RenoLink"><a href="name_idx.html">Index</a></span></li> <li><span class="RenoLink"><a href="page_idx.html">Page Index</a></span></li>
</ol></div> </ol></div>
<h2>Synopsis</h2> <h3>Acknowledgements</h3>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;</p> <p>Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.</p>
<pre>namespace </div><!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
<span class="RenoLink"><a href="exception.html">exception</a></span>
{
protected:
<span class="RenoIncludeSPAN"> <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 &amp; x );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_function,char const *&gt; throw_function;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_file,char const *&gt; throw_file;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_line,int&gt; throw_line;</span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
{
public:
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; v );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class E, class Tag, class T&gt;
E const &amp; <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x, <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; const &amp; v );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E, class Tag1, class T1, ..., class TagN, class TN&gt;
E const &amp; <span class="RenoLink"><a href="tuple_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x,
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span>&lt;
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag1,T1&gt;,
...,
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;TagN,TN&gt; &gt; const &amp; v );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const &amp; x );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>:
public std::exception
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
{
---unspecified---
};</span>
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
<span class="RenoIncludeSPAN">template &lt;class T&gt;
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const &amp; e );</span>
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; ep );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const &amp; e );</span></span>
}</pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN"><span class="RenoIncludeSPAN">#if !defined( BOOST_NO_EXCEPTIONS ) &amp;&amp; !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt;
#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) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else
#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>(x)
#endif</span>
namespace
boost
{
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( std::exception const &amp; e ); // user defined
#else
template &lt;class E&gt;
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const &amp; e );
#endif</span>
}</span></pre>
<h2>Class exception</h2>
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> class
<span class="RenoLink"><a href="exception.html">exception</a></span>
{
protected:
<span class="RenoIncludeSPAN"> <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 &amp; x );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
};</span>
}</pre>
</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="exception_operator_shl.html">operator&lt;&lt;</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><h2>Transporting of Arbitrary Data to the Catch Site</h2>
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class Tag,class T&gt;
class
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
{
public:
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; v );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
};</span>
}</pre>
</div><h4>Requirements:</h4>
<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>&lt;Tag,T&gt; can be passed to <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> to be stored in objects of type boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
<h4>Usage:</h4>
<p>The header &lt;<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>&gt; provides a declaration of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
struct tag_errno;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;tag_errno,int&gt; errno_info;</pre>
<p>Or, the shorter equivalent:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; errno_info;</pre>
<p>This errno_info typedef can be passed to <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> (#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt; first) to store an int named tag_errno in exceptions of types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
<pre>throw file_read_error() <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> errno_info(errno);</pre>
<p>It can also be passed to <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> (#include &lt;<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt; first) to retrieve the tag_errno int from a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &amp; x )
{
if( boost::shared_ptr&lt;int const&gt; e=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) )
....
}</pre>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception/operator&lt;&lt;</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class E, class Tag, class T&gt;
E const &amp; <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x, <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; const &amp; 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>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>&lt;Tag,T&gt;, 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"><div class="RenoAutoDIV"><h3>tuple/operator&lt;&lt;</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class E, class Tag1, class T1, ..., class TagN, class TN&gt;
E const &amp; <span class="RenoLink"><a href="tuple_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x,
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span>&lt;
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag1,T1&gt;,
...,
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;TagN,TN&gt; &gt; const &amp; 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 &lt;&lt; v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span>&lt;0&gt;() &lt;&lt; ... &lt;&lt; v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span>&lt;N&gt;().</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">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class ErrorInfo,class E&gt;
<span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span>&lt;typename ErrorInfo::value_type const&gt; <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );</span>
}</pre>
</div><h4>Requirements:</h4>
<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>
<li> The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function must not be called outside of a catch block.</li>
</ul></div>
<h4>Returns:</h4>
<div><ul><li> If dynamic_cast&lt;boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *&gt;(&amp;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="exception_operator_shl.html">operator&lt;&lt;</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>
<h4>Note:</h4>
<p>The interface of <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> may be affected by the build <span class="RenoLink"><a href="configuration_macros.html">configuration macros</a></span>.</p>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_error_info</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const &amp; x );</span>
}</pre>
</div><h4>Requirements:</h4>
<p>T must be a class with an accessible no-throw copy constructor as per (15.5.1).</p>
<h4>Returns:</h4>
<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><h2>Transporting of Exceptions between Threads</h2>
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception_ptr</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
}</pre>
</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>Thread safety</h4>
<div><ul><li> It is legal for multiple threads to hold <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> references to the same exception object.</li>
<li> It is illegal for multiple threads to modify the same <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> object concurrently.</li>
<li> While calling <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> concurrently to throw the same exception object into multiple threads.</li>
</ul></div>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_current_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const &amp; e );</span>
}</pre>
</div><h4>Requirements:</h4>
<p>T must be a class with 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 &amp;).</p>
<h4>Description:</h4>
<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
{
};
....
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 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">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
}</pre>
</div><h4>Requirements:</h4>
<p>The <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> function must not be called outside of a catch block.</p>
<h4>Returns:</h4>
<div><ul><li> An <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to the currently handled exception or a copy of the currently handled exception.</li>
<li> If the function needs to allocate memory and the attempt fails, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of std::bad_alloc.</li>
</ul></div>
<h4>Throws:</h4>
<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> 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"><div class="RenoAutoDIV"><h3>copy_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class T&gt;
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const &amp; e );</span>
}</pre>
</div><h4>Effects:</h4>
<p>As if</p>
<pre>try
{
throw <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(e);
}
catch(...)
{
return <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();
}</pre>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>rethrow_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; ep );</span>
}</pre>
</div><h4>Precondition:</h4>
<p>ep shall not be null.</p>
<h4>Throws:</h4>
<p>The exception to which ep refers.</p>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>unknown_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> class
<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>:
public std::exception
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
{
---unspecified---
};</span>
}</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"><div class="RenoAutoDIV"><h3>diagnostic_information</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; );</span>
}</pre>
</div><h4>Returns:</h4>
<p>This function returns a string value that is automatically composed from the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>, along with other diagnostic information relevant to the exception.</p>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated. The following overload resolutions are attempted in order:</p>
<div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to s &lt;&lt; x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>(), where s is a std::ostringstream.</li>
</ol></div>
<p>The first successfully bound function is used at the time <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
<h4>Notes:</h4>
<div><ul><li>The format of the returned string is unspecified.</li>
<li>The returned string is <i>not</i> user-friendly.</li>
<li>If dynamic_cast&lt;std::exception const *&gt;(&amp;x) is not null, the returned string includes the output from std::exception::what.</li>
<li>The returned string may include additional platform-specific diagnostic information.</li>
</ul></div>
<div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error
[struct tag_errno *] = 2, OS says "No such file or directory"
[struct tag_file_name *] = tmp1.txt
[struct tag_function *] = fopen
[struct tag_open_mode *] = rb</pre>
</div></div><h2>Throwing Exceptions</h2>
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>throw_exception</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( std::exception const &amp; e ); // user defined
#else
template &lt;class E&gt;
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const &amp; e );
#endif</span>
}</pre>
</div><h4>Requirements:</h4>
<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 <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><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_THROW_EXCEPTION</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre>#if !defined( BOOST_NO_EXCEPTIONS ) &amp;&amp; !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt;
#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) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else
#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>(x)
#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><h2>Acknowledgements</h2>
<p>Peter Dimov has been continuously influencing the design and evolution of Boost Exception. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.</p>
<!-- 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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer"> <div id="footer">

View File

@ -0,0 +1,53 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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/current_exception_cast.hpp</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/current_exception_cast.hpp</h2>
</div>
<h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
E * <span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span>();</span></span>
}</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="synopsis.html">Synopsis<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -19,7 +19,7 @@
<!-- 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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Configuration Macros</h3> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Configuration Macros</h2>
</div> </div>
<p>Boost Exception responds to the following configuration macros:</p> <p>Boost Exception responds to the following configuration macros:</p>
<p><b>BOOST_NO_RTTI</b><span class="RenoBR">&nbsp;</span><br/><b>BOOST_NO_TYPEID</b></p> <p><b>BOOST_NO_RTTI</b><span class="RenoBR">&nbsp;</span><br/><b>BOOST_NO_TYPEID</b></p>

View File

@ -0,0 +1,59 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>current_exception_cast</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception_cast</h3>
</div>
<div class="RenoIncludeDIV"><pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class E&gt;
E * <span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span>();</span>
}</pre>
</div><h4>Requirements:</h4>
<p>This function must not be called outside of a catch block.</p>
<h4>Returns:</h4>
<p>A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *.</p>
<h4>Throws:</h4>
<p>Nothing.</p>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>current_exception_diagnostic_information</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception_diagnostic_information</h3>
</div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;<span class="RenoBR">&nbsp;</span><br/></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span>
}</pre>
</div><h4>Requirements:</h4>
<p>This function must not be called outside of a catch block.</p>
<h4>Returns:</h4>
<p>If the current exception object can be converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span> or std::exception, this function returns the same string value returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> for the current exception object. Otherwise, an unspecified non-empty string is returned.</p>
<p>Typical use is to call <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span> from a top-level function to output diagnostic information about unhandled exceptions:</p>
<pre>int
main()
{
try
{
run_program();
}
catch(
error &amp; e )
{
//handle error
}
catch(
...)
{
std::cerr &lt;&lt; "Unhandled exception!" &lt;&lt; std::endl &lt;&lt;
boost::<span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();
}
}</pre>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -25,10 +25,18 @@
<pre>namespace <pre>namespace
boost boost
{ {
<span class="RenoIncludeSPAN"> std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; );</span> <span class="RenoIncludeSPAN"> template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e );</span>
}</pre> }</pre>
</div><h4>Returns:</h4> </div><h4>Returns:</h4>
<p>This function returns a string value that is automatically composed from the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>, along with other diagnostic information relevant to the exception.</p> <p>A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object:</p>
<div><ul><li>If E can be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>, along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string.</li>
<li>Otherwise, if E can be statically converted std::exception:<div><ul><li>if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>;</li>
<li>otherwise the returned value contains the what() string.</li>
</ul></div>
</li>
<li>Otherwise, the boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> template is not available.</li>
</ul></div>
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated. The following overload resolutions are attempted in order:</p> <p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; template is instantiated. The following overload resolutions are attempted in order:</p>
<div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; (the return value is expected to be of type std::string.)</li> <div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; (the return value is expected to be of type std::string.)</li>
<li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li> <li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
@ -38,12 +46,11 @@ boost
<h4>Notes:</h4> <h4>Notes:</h4>
<div><ul><li>The format of the returned string is unspecified.</li> <div><ul><li>The format of the returned string is unspecified.</li>
<li>The returned string is <i>not</i> user-friendly.</li> <li>The returned string is <i>not</i> user-friendly.</li>
<li>If dynamic_cast&lt;std::exception const *&gt;(&amp;x) is not null, the returned string includes the output from std::exception::what.</li>
<li>The returned string may include additional platform-specific diagnostic information.</li> <li>The returned string may include additional platform-specific diagnostic information.</li>
</ul></div> </ul></div>
<div class="RenoIncludeDIV"><h4>Example:</h4> <div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p> <p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *) <pre>example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt; Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error std::exception::what: example_io error
[struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_errno *] = 2, OS says "No such file or directory"
@ -55,6 +62,7 @@ std::exception::what: example_io error
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/> <div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/> </a><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/> </a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/> </a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/> </a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
</a><a href="motivation.html">Motivation<br/> </a><a href="motivation.html">Motivation<br/>

View File

@ -45,6 +45,7 @@ boost
</a><a href="exception_exception_hpp.html">boost/exception/exception.hpp<br/> </a><a href="exception_exception_hpp.html">boost/exception/exception.hpp<br/>
</a><a href="configuration_macros.html">Configuration Macros<br/> </a><a href="configuration_macros.html">Configuration Macros<br/>
</a><a href="current_exception.html">current_exception<br/> </a><a href="current_exception.html">current_exception<br/>
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/> </a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="diagnostic_information.html">diagnostic_information<br/> </a><a href="diagnostic_information.html">diagnostic_information<br/>
</a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/> </a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/>

View File

@ -46,12 +46,12 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="copy_exception.html">copy_exception<br/> </a><a href="copy_exception.html">copy_exception<br/>
</a><a href="current_exception.html">current_exception<br/> </a><a href="current_exception.html">current_exception<br/>
</a><a href="exception_ptr.html">exception_ptr<br/> </a><a href="exception_ptr.html">exception_ptr<br/>
</a><a href="rethrow_exception.html">rethrow_exception<br/> </a><a href="rethrow_exception.html">rethrow_exception<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a><a href="unknown_exception.html">unknown_exception<br/> </a><a href="unknown_exception.html">unknown_exception<br/>
</a></div> </a></div>
</div> </div>

View File

@ -28,13 +28,18 @@ namespace
boost boost
{ {
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span> <span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; );</span></span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e );</span>
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
</a><a href="diagnostic_information.html">diagnostic_information<br/> </a><a href="diagnostic_information.html">diagnostic_information<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -32,8 +32,8 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="enable_current_exception.html">enable_current_exception<br/>
</a><a href="enable_current_exception.html">enable_current_exception<br/> </a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -32,8 +32,8 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="enable_error_info.html">enable_error_info<br/>
</a><a href="enable_error_info.html">enable_error_info<br/> </a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -22,7 +22,8 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/info_tuple.hpp</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/info_tuple.hpp</h2>
</div> </div>
<h3>Synopsis</h3> <h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;boost/tuple/tuple.hpp&gt; <div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;boost/tuple/tuple.hpp&gt;
namespace namespace
boost boost
@ -36,8 +37,8 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="synopsis.html">Synopsis<br/>
</a><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;<br/> </a><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;<br/>
</a></div> </a></div>
</div> </div>

View File

@ -23,8 +23,6 @@
</div> </div>
<h3>Synopsis</h3> <h3>Synopsis</h3>
<div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt; <div class="RenoIncludeDIV"><pre>#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt;
#include &lt;boost/shared_ptr.hpp&gt;
namespace namespace
boost boost
@ -46,13 +44,14 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="error_info_error_info.html">error_info::error_info<br/> </a><a href="error_info_error_info.html">error_info::error_info<br/>
</a><a href="error_info_value.html">error_info::value<br/> </a><a href="error_info_value.html">error_info::value<br/>
</a><a href="error_info_value_type.html">error_info::value_type<br/> </a><a href="error_info_value_type.html">error_info::value_type<br/>
</a><a href="exception_operator_shl.html">exception/operator&lt;&lt;<br/> </a><a href="exception_operator_shl.html">exception/operator&lt;&lt;<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -30,9 +30,9 @@ boost
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -45,13 +45,13 @@ boost
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/> <div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/> </a><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/> </a><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/>
</a><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/> </a><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/>
</a><a href="exception_error_info_hpp.html">boost/exception/info.hpp<br/> </a><a href="exception_error_info_hpp.html">boost/exception/info.hpp<br/>
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
</a><a href="exception.html">exception<br/> </a><a href="exception.html">exception<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -28,14 +28,12 @@ namespace
boost boost
{ {
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class ErrorInfo,class E&gt; <span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class ErrorInfo,class E&gt;
<span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span>&lt;typename ErrorInfo::value_type const&gt; <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );</span></span> typename ErrorInfo::value_type const * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );</span></span>
}</pre> }</pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="exception_hpp.html">boost/exception.hpp<br/>
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="get_error_info.html">get_error_info<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

View File

@ -31,9 +31,9 @@
#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</span></pre> #include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/> </a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a></div> </a></div>
</div> </div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. --> <!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->

69
doc/functions.html Normal file
View File

@ -0,0 +1,69 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>Functions</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Functions</h2>
</div>
<div class="RenoIndex"><h3>c</h3>
<p><a href="copy_exception.html">copy_exception</a></p>
<p><a href="current_exception.html">current_exception</a></p>
<p><a href="current_exception_cast.html">current_exception_cast</a></p>
<p><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></p>
<h3>d</h3>
<p><a href="diagnostic_information.html">diagnostic_information</a></p>
<h3>e</h3>
<p><a href="enable_current_exception.html">enable_current_exception</a></p>
<p><a href="enable_error_info.html">enable_error_info</a></p>
<p><a href="error_info_error_info.html">error_info::error_info</a></p>
<p><a href="error_info_value.html">error_info::value</a></p>
<p><a href="exception_operator_shl.html">exception/operator&lt;&lt;</a></p>
<p><a href="exception_constructors.html">exception::exception</a></p>
<p><a href="exception_destructor.html">exception::~exception</a></p>
<h3>g</h3>
<p><a href="get_error_info.html">get_error_info</a></p>
<h3>r</h3>
<p><a href="rethrow_exception.html">rethrow_exception</a></p>
<h3>t</h3>
<p><a href="throw_exception.html">throw_exception</a></p>
<p><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a></p>
</div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -21,21 +21,19 @@
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>get_error_info</h3> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>get_error_info</h3>
</div> </div>
<div class="RenoIncludeDIV"><p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;</p> <div class="RenoIncludeDIV"><pre>namespace
<pre>namespace
boost boost
{ {
<span class="RenoIncludeSPAN"> template &lt;class ErrorInfo,class E&gt; <span class="RenoIncludeSPAN"> template &lt;class ErrorInfo,class E&gt;
<span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span>&lt;typename ErrorInfo::value_type const&gt; <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );</span> typename ErrorInfo::value_type const * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const &amp; x );</span>
}</pre> }</pre>
</div><h4>Requirements:</h4> </div><h4>Requirements:</h4>
<div><ul><li> ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</li> <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> <li> E must be polymorphic.</li>
<li> The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function must not be called outside of a catch block.</li>
</ul></div> </ul></div>
<h4>Returns:</h4> <h4>Returns:</h4>
<div><ul><li> If dynamic_cast&lt;boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *&gt;(&amp;x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr.</li> <div><ul><li> If dynamic_cast&lt;boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *&gt;(&amp;x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null.</li>
<li> Otherwise, the returned shared_ptr points to the stored value (use <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> to store values in exception objects.) The shared_ptr is valid even after x has been destroyed.</li> <li> Otherwise, the returned pointer points to the stored value (use <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span> to store values in exception objects.) When x is destroyed, any pointers returned by <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> become invalid.</li>
</ul></div> </ul></div>
<h4>Throws:</h4> <h4>Throws:</h4>
<p>Nothing.</p> <p>Nothing.</p>

61
doc/headers.html Normal file
View File

@ -0,0 +1,61 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>Headers</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Headers</h2>
</div>
<div class="RenoIndex"><h3>e</h3>
<p><a href="exception_hpp.html">boost/exception.hpp</a></p>
<p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p>
<p><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p>
<p><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p>
<p><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p>
<p><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></p>
<p><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></p>
<p><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></p>
<p><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></p>
<p><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></p>
<p><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></p>
<h3>t</h3>
<p><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></p>
</div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

48
doc/macros.html Normal file
View File

@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>Macros</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Macros</h2>
</div>
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a></div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -108,7 +108,7 @@ catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></spa
e <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> file_name("foo.txt"); e <span class="RenoLink"><a href="exception_operator_shl.html">&lt;&lt;</a></span> file_name("foo.txt");
throw; throw;
}</pre> }</pre>
<p>Finally here is how the handler retreives data from exceptions that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p> <p>Finally here is how the handler retrieves data from exceptions that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
<pre>catch( io_error &amp; e ) <pre>catch( io_error &amp; e )
{ {
std::cerr &lt;&lt; "I/O Error!\n"; std::cerr &lt;&lt; "I/O Error!\n";

View File

@ -3,7 +3,7 @@
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head> <head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<title>Index</title> <title>page index</title>
<link href='reno.css' type='text/css' rel='stylesheet'/> <link href='reno.css' type='text/css' rel='stylesheet'/>
</head> </head>
<body> <body>
@ -19,12 +19,14 @@
<!-- 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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoAutoDIV"><h1>Index</h1> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h1>Page Index</h1>
</div> </div>
<p>This is an alphabetical list of all Boost Exception documentation pages.</p>
<div class="RenoIndex"><h3>B</h3> <div class="RenoIndex"><h3>B</h3>
<p><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></p> <p><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></p>
<h3>b</h3> <h3>b</h3>
<p><a href="exception_hpp.html">boost/exception.hpp</a></p> <p><a href="exception_hpp.html">boost/exception.hpp</a></p>
<p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p>
<p><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p> <p><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p>
<p><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p> <p><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p>
<p><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p> <p><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p>
@ -40,6 +42,8 @@
<h3>c</h3> <h3>c</h3>
<p><a href="copy_exception.html">copy_exception</a></p> <p><a href="copy_exception.html">copy_exception</a></p>
<p><a href="current_exception.html">current_exception</a></p> <p><a href="current_exception.html">current_exception</a></p>
<p><a href="current_exception_cast.html">current_exception_cast</a></p>
<p><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></p>
<h3>D</h3> <h3>D</h3>
<p><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></p> <p><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></p>
<h3>d</h3> <h3>d</h3>
@ -60,17 +64,24 @@
<p><a href="exception_ptr.html">exception_ptr</a></p> <p><a href="exception_ptr.html">exception_ptr</a></p>
<h3>F</h3> <h3>F</h3>
<p><a href="frequently_asked_questions.html">Frequently Asked Questions</a></p> <p><a href="frequently_asked_questions.html">Frequently Asked Questions</a></p>
<p><a href="functions.html">Functions</a></p>
<h3>g</h3> <h3>g</h3>
<p><a href="get_error_info.html">get_error_info</a></p> <p><a href="get_error_info.html">get_error_info</a></p>
<h3>H</h3>
<p><a href="headers.html">Headers</a></p>
<h3>I</h3> <h3>I</h3>
<p><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></p> <p><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></p>
<h3>M</h3> <h3>M</h3>
<p><a href="macros.html">Macros</a></p>
<p><a href="motivation.html">Motivation</a></p> <p><a href="motivation.html">Motivation</a></p>
<h3>r</h3> <h3>r</h3>
<p><a href="rethrow_exception.html">rethrow_exception</a></p> <p><a href="rethrow_exception.html">rethrow_exception</a></p>
<h3>S</h3>
<p><a href="synopsis.html">Synopsis</a></p>
<h3>T</h3> <h3>T</h3>
<p><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></p> <p><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></p>
<p><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></p> <p><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></p>
<p><a href="types.html">Types</a></p>
<h3>t</h3> <h3>t</h3>
<p><a href="throw_exception.html">throw_exception</a></p> <p><a href="throw_exception.html">throw_exception</a></p>
<p><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a></p> <p><a href="tuple_operator_shl.html">tuple/operator&lt;&lt;</a></p>
@ -79,6 +90,11 @@
<h3>u</h3> <h3>u</h3>
<p><a href="unknown_exception.html">unknown_exception</a></p> <p><a href="unknown_exception.html">unknown_exception</a></p>
</div> </div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></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 -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) --> <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->

File diff suppressed because it is too large Load Diff

201
doc/synopsis.html Normal file
View File

@ -0,0 +1,201 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>Synopsis</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><h2>Synopsis</h2>
<p>List of documented definitions, declarations and includes by header file:</p>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
<span class="RenoLink"><a href="exception.html">exception</a></span>
{
protected:
<span class="RenoIncludeSPAN"> <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 &amp; x );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_function,char const *&gt; throw_function;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_file,char const *&gt; throw_file;
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_throw_line,int&gt; throw_line;</span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class Tag,class T&gt;
class
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
{
public:
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; v );</span>
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const &amp; <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
};</span>
<span class="RenoIncludeSPAN">template &lt;class E, class Tag, class T&gt;
E const &amp; <span class="RenoLink"><a href="exception_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x, <span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag,T&gt; const &amp; v );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;boost/tuple/tuple.hpp&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E, class Tag1, class T1, ..., class TagN, class TN&gt;
E const &amp; <span class="RenoLink"><a href="tuple_operator_shl.html">operator&lt;&lt;</a></span>( E const &amp; x,
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span>&lt;
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;Tag1,T1&gt;,
...,
<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;TagN,TN&gt; &gt; const &amp; v );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const &amp; x );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;string&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const &amp; e );</span>
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class E&gt;
E * <span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span>();</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>:
public std::exception
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
{
---unspecified---
};</span>
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
<span class="RenoIncludeSPAN">template &lt;class T&gt;
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const &amp; e );</span>
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const &amp; ep );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
namespace
boost
{
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const &amp; e );</span></span>
}</span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</p>
<pre><span class="RenoIncludeSPAN"><div class="RenoIncludeDIV"><span class="RenoIncludeSPAN">#if !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt;
#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) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) &lt;&lt;\
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
#else
#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>(x)
#endif</span>
namespace
boost
{
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( std::exception const &amp; e ); // user defined
#else
template &lt;class E&gt;
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const &amp; e );
#endif</span>
}</div></span></pre>
<p><span class="RenoEscape">&#35;<!--<wiki>`&#35;</wiki>--></span>include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;</p>
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include &lt;<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</span></pre>
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -22,7 +22,7 @@
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/throw_exception.hpp</h2> <div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/throw_exception.hpp</h2>
</div> </div>
<h3>Synopsis</h3> <h3>Synopsis</h3>
<div class="RenoIncludeDIV"><div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#if !defined( BOOST_NO_EXCEPTIONS ) &amp;&amp; !defined( BOOST_EXCEPTION_DISABLE ) <div class="RenoIncludeDIV"><div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#if !defined( BOOST_EXCEPTION_DISABLE )
#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt; #include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;
#include &lt;boost/current_function.hpp&gt; #include &lt;boost/current_function.hpp&gt;
#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)\
@ -47,8 +47,8 @@ boost
</div></div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div> </div></div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3> <h3>See Also:</h3>
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/> <div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
</a><a href="boost-exception.html">Boost Exception<br/>
</a><a href="configuration_macros.html">Configuration Macros<br/> </a><a href="configuration_macros.html">Configuration Macros<br/>
</a><a href="synopsis.html">Synopsis<br/>
</a><a href="throw_exception.html">throw_exception<br/> </a><a href="throw_exception.html">throw_exception<br/>
</a></div> </a></div>
</div> </div>

View File

@ -47,7 +47,7 @@ g()
}</pre> }</pre>
<div class="RenoIncludeDIV"><h4>Example:</h4> <div class="RenoIncludeDIV"><h4>Example:</h4>
<p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p> <p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
<pre>libs\exception\example\example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *) <pre>example_io.cpp(83): Throw in function class boost::shared_ptr&lt;struct _iobuf&gt; __cdecl my_fopen(const char *,const char *)
Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt; Dynamic exception type: class boost::exception_detail::clone_impl&lt;class fopen_error&gt;
std::exception::what: example_io error std::exception::what: example_io error
[struct tag_errno *] = 2, OS says "No such file or directory" [struct tag_errno *] = 2, OS says "No such file or directory"

View File

@ -59,11 +59,11 @@ g()
catch( catch(
my_error &amp; x ) my_error &amp; x )
{ {
if( boost::shared_ptr&lt;int const&gt; err=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) ) if( int const * err=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) )
std::cerr &lt;&lt; "Error code: " &lt;&lt; *err; std::cerr &lt;&lt; "Error code: " &lt;&lt; *err;
} }
}</pre> }</pre>
<p>The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, the returned <span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span> will point to it; otherwise an empty <span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span> is returned.</p> <p>The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned.</p>
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data to Active Exception Objects</h3> </div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data to Active Exception Objects</h3>
</div> </div>
<p>Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function:</p> <p>Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function:</p>

54
doc/types.html Normal file
View File

@ -0,0 +1,54 @@
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<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>Types</title>
<link href='reno.css' type='text/css' rel='stylesheet'/>
</head>
<body>
<div class="body-0">
<div class="body-1">
<div class="body-2">
<div>
<div id="boost_logo">
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
</div>
<h1>Boost Exception</h1>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Types</h2>
</div>
<div class="RenoIndex"><h3>e</h3>
<p><a href="error_info.html">error_info</a></p>
<p><a href="error_info_value_type.html">error_info::value_type</a></p>
<p><a href="exception.html">exception</a></p>
<p><a href="exception_ptr.html">exception_ptr</a></p>
<h3>u</h3>
<p><a href="unknown_exception.html">unknown_exception</a></p>
</div>
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
<h3>See Also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div>
</div>
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
</p>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,6 +1,6 @@
# Boost Exception Library example Jamfile # Boost Exception Library example Jamfile
# #
# Copyright (c) 2006-2008 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
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -30,7 +30,7 @@ g()
catch( catch(
my_error & x ) my_error & x )
{ {
if( boost::shared_ptr<int const> err=boost::get_error_info<errno_info>(x) ) if( int const * err=boost::get_error_info<errno_info>(x) )
std::cerr << "Error code: " << *err; std::cerr << "Error code: " << *err;
} }
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -132,7 +132,7 @@ copy_data( char const * src_file_name, char const * dst_file_name )
catch( catch(
boost::exception & x ) boost::exception & x )
{ {
if( boost::shared_ptr<boost::weak_ptr<FILE> const> f=boost::get_error_info<file_stream_info>(x) ) if( boost::weak_ptr<FILE> const * f=boost::get_error_info<file_stream_info>(x) )
if( boost::shared_ptr<FILE> fs = f->lock() ) if( boost::shared_ptr<FILE> fs = f->lock() )
{ {
if( fs==src ) if( fs==src )
@ -150,37 +150,37 @@ copy_data( char const * src_file_name, char const * dst_file_name )
void void
dump_copy_info( boost::exception const & x ) dump_copy_info( boost::exception const & x )
{ {
if( boost::shared_ptr<std::string const> src = boost::get_error_info<file_name_src_info>(x) ) if( std::string const * src = boost::get_error_info<file_name_src_info>(x) )
std::cout << "Source file name: " << *src << "\n"; std::cerr << "Source file name: " << *src << "\n";
if( boost::shared_ptr<std::string const> dst = boost::get_error_info<file_name_dst_info>(x) ) if( std::string const * dst = boost::get_error_info<file_name_dst_info>(x) )
std::cout << "Destination file name: " << *dst << "\n"; std::cerr << "Destination file name: " << *dst << "\n";
} }
void void
dump_file_info( boost::exception const & x ) dump_file_info( boost::exception const & x )
{ {
if( boost::shared_ptr<std::string const> fn = boost::get_error_info<file_name_info>(x) ) if( std::string const * fn = boost::get_error_info<file_name_info>(x) )
std::cout << "File name: " << *fn << "\n"; std::cerr << "File name: " << *fn << "\n";
} }
void void
dump_clib_info( boost::exception const & x ) dump_clib_info( boost::exception const & x )
{ {
if( boost::shared_ptr<int const> err=boost::get_error_info<errno_info>(x) ) if( int const * err=boost::get_error_info<errno_info>(x) )
std::cout << "OS error: " << *err << "\n"; std::cerr << "OS error: " << *err << "\n";
if( boost::shared_ptr<std::string const> fn=boost::get_error_info<function_info>(x) ) if( std::string const * fn=boost::get_error_info<function_info>(x) )
std::cout << "Failed function: " << *fn << "\n"; std::cerr << "Failed function: " << *fn << "\n";
} }
void void
dump_all_info( boost::exception const & x ) dump_all_info( boost::exception const & x )
{ {
std::cout << "-------------------------------------------------\n"; std::cerr << "-------------------------------------------------\n";
dump_copy_info(x); dump_copy_info(x);
dump_file_info(x); dump_file_info(x);
dump_clib_info(x); dump_clib_info(x);
std::cout << "\nOutput from diagnostic_information():\n"; std::cerr << "\nOutput from diagnostic_information():\n";
std::cout << diagnostic_information(x); std::cerr << diagnostic_information(x);
} }
int int
@ -199,7 +199,7 @@ main()
catch( catch(
read_error & x ) read_error & x )
{ {
std::cout << "\nCaught 'read_error' exception.\n"; std::cerr << "\nCaught 'read_error' exception.\n";
dump_all_info(x); dump_all_info(x);
} }
@ -212,14 +212,14 @@ main()
catch( catch(
open_error & x ) open_error & x )
{ {
std::cout << "\nCaught 'open_error' exception.\n"; std::cerr << "\nCaught 'open_error' exception.\n";
dump_all_info(x); dump_all_info(x);
} }
} }
catch( catch(
boost::exception & x ) ... )
{ {
std::cout << "\nCaught unexpected boost::exception!\n"; std::cerr << "\nCaught unexpected exception!\n";
dump_all_info(x); std::cerr << boost::current_exception_diagnostic_information();
} }
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,34 @@
//Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593
namespace
boost
{
template <class E>
inline
E *
current_exception_cast()
{
try
{
throw;
}
catch(
E & e )
{
return &e;
}
catch(
...)
{
return 0;
}
}
}
#endif

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -8,6 +8,8 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp> #include <boost/exception/get_error_info.hpp>
#include <boost/exception/current_exception_cast.hpp>
#include <boost/utility/enable_if.hpp>
#include <exception> #include <exception>
#include <sstream> #include <sstream>
#include <string> #include <string>
@ -18,6 +20,38 @@ boost
namespace namespace
exception_detail exception_detail
{ {
template <class T>
struct
enable_boost_exception_overload
{
typedef struct yes { char q[100]; };
typedef char no;
static yes check(exception const *);
static no check(...);
enum e { value=sizeof(check((T*)0))==sizeof(yes) };
};
template <class T>
struct
enable_std_exception_overload
{
typedef struct yes { char q[100]; };
typedef char no;
static yes check(std::exception const *);
static no check(...);
enum e { value = !enable_boost_exception_overload<T>::value && sizeof(check((T*)0))==sizeof(yes) };
};
#ifndef BOOST_NO_RTTI
template <class T>
inline
std::string
dynamic_exception_type( T const & x )
{
return std::string("Dynamic exception type: ") + BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name();
}
#endif
inline inline
char const * char const *
get_diagnostic_information( exception const & x ) get_diagnostic_information( exception const & x )
@ -36,34 +70,77 @@ boost
#endif #endif
return 0; return 0;
} }
inline
std::string
boost_diagnostic_information( exception const & x )
{
std::ostringstream tmp;
if( char const * const * f=get_error_info<throw_file>(x) )
{
tmp << *f;
if( int const * l=get_error_info<throw_line>(x) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( char const * const * fn=get_error_info<throw_function>(x) )
tmp << *fn;
else
tmp << "(unknown)";
tmp << std::endl;
#ifndef BOOST_NO_RTTI
tmp << dynamic_exception_type(x) << std::endl;
if( std::exception const * e=dynamic_cast<std::exception const *>(&x) )
tmp << "std::exception::what: " << e->what() << std::endl;
#endif
if( char const * s=exception_detail::get_diagnostic_information(x) )
if( *s )
tmp << s;
return tmp.str();
} }
inline inline
std::string std::string
diagnostic_information( exception const & x ) std_diagnostic_information( std::exception const & x )
{ {
std::ostringstream tmp; std::ostringstream tmp;
if( boost::shared_ptr<char const * const> f=get_error_info<throw_file>(x) )
{
tmp << *f;
if( boost::shared_ptr<int const> l=get_error_info<throw_line>(x) )
tmp << '(' << *l << "): ";
}
tmp << "Throw in function ";
if( boost::shared_ptr<char const * const> fn=get_error_info<throw_function>(x) )
tmp << *fn;
else
tmp << "(unknown)";
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
tmp << "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name(); if( exception const * e=dynamic_cast<exception const *>(&x) )
if( std::exception const * e=dynamic_cast<std::exception const *>(&x) ) return boost_diagnostic_information(*e);
tmp << "\nstd::exception::what: " << e->what(); tmp << dynamic_exception_type(x) << std::endl;
#endif #endif
if( char const * s=exception_detail::get_diagnostic_information(x) ) tmp << "std::exception::what: " << x.what() << std::endl;
if( *s )
tmp << '\n' << s;
return tmp.str(); return tmp.str();
} }
} }
template <class T>
inline
typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
return exception_detail::boost_diagnostic_information(e);
}
template <class T>
inline
typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type
diagnostic_information( T const & e )
{
return exception_detail::std_diagnostic_information(e);
}
inline
std::string
current_exception_diagnostic_information()
{
if( boost::exception const * e=current_exception_cast<boost::exception const>() )
return diagnostic_information(*e);
else if( std::exception const * e=current_exception_cast<std::exception const>() )
return diagnostic_information(*e);
else
return "No diagnostic information available.";
}
}
#endif #endif

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -17,82 +17,12 @@ boost
namespace namespace
exception_detail exception_detail
{ {
struct
strwrap
{
std::string str;
char const * ptr;
explicit
strwrap( char const * s ):
str(s),
ptr(&str[0])
{
}
private:
strwrap( strwrap const & );
strwrap & operator=( strwrap const & );
};
template <>
struct
get_info<throw_function>
{
static
shared_ptr<char const * const>
get( exception const & x )
{
if( x.throw_function_ && *x.throw_function_ )
{
shared_ptr<strwrap> s(new strwrap(x.throw_function_));
return shared_ptr<char const *>(s,&s->ptr);
}
else
return shared_ptr<char const * const>();
}
};
template <>
struct
get_info<throw_file>
{
static
shared_ptr<char const * const>
get( exception const & x )
{
if( x.throw_file_ && *x.throw_file_ )
{
shared_ptr<strwrap> s(new strwrap(x.throw_file_));
return shared_ptr<char const *>(s,&s->ptr);
}
else
return shared_ptr<char const * const>();
}
};
template <>
struct
get_info<throw_line>
{
static
shared_ptr<int const>
get( exception const & x )
{
if( x.throw_line_!=-1 )
return boost::shared_ptr<int>(new int(x.throw_line_));
else
return shared_ptr<int const>();
}
};
template <class ErrorInfo> template <class ErrorInfo>
struct struct
get_info get_info
{ {
static static
shared_ptr<typename ErrorInfo::value_type const> typename ErrorInfo::value_type const *
get( exception const & x ) get( exception const & x )
{ {
if( exception_detail::error_info_container * c=x.data_.get() ) if( exception_detail::error_info_container * c=x.data_.get() )
@ -102,9 +32,45 @@ boost
BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) ); BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) );
#endif #endif
ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get()); ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get());
return shared_ptr<typename ErrorInfo::value_type const>(eib,&w->value()); return &w->value();
} }
return shared_ptr<typename ErrorInfo::value_type const>(); return 0;
}
};
template <>
struct
get_info<throw_function>
{
static
char const * const *
get( exception const & x )
{
return x.throw_function_ ? &x.throw_function_ : 0;
}
};
template <>
struct
get_info<throw_file>
{
static
char const * const *
get( exception const & x )
{
return x.throw_file_ ? &x.throw_file_ : 0;
}
};
template <>
struct
get_info<throw_line>
{
static
int const *
get( exception const & x )
{
return x.throw_line_!=-1 ? &x.throw_line_ : 0;
} }
}; };
} }
@ -112,7 +78,7 @@ boost
#ifdef BOOST_NO_RTTI #ifdef BOOST_NO_RTTI
template <class ErrorInfo> template <class ErrorInfo>
inline inline
shared_ptr<typename ErrorInfo::value_type const> typename ErrorInfo::value_type const *
get_error_info( boost::exception const & x ) get_error_info( boost::exception const & x )
{ {
return exception_detail::get_info<ErrorInfo>::get(x); return exception_detail::get_info<ErrorInfo>::get(x);
@ -120,13 +86,13 @@ boost
#else #else
template <class ErrorInfo,class E> template <class ErrorInfo,class E>
inline inline
shared_ptr<typename ErrorInfo::value_type const> typename ErrorInfo::value_type const *
get_error_info( E const & some_exception ) get_error_info( E const & some_exception )
{ {
if( exception const * x = dynamic_cast<exception const *>(&some_exception) ) if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
return exception_detail::get_info<ErrorInfo>::get(*x); return exception_detail::get_info<ErrorInfo>::get(*x);
else else
return shared_ptr<typename ErrorInfo::value_type const>(); return 0;
} }
#endif #endif
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -102,17 +102,13 @@ boost
{ {
if( diagnostic_info_str_.empty() ) if( diagnostic_info_str_.empty() )
{ {
std::string tmp; std::ostringstream tmp;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i ) for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{ {
shared_ptr<error_info_base const> const & x = i->second; shared_ptr<error_info_base const> const & x = i->second;
tmp += '['; tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl;
tmp += x->tag_typeid_name();
tmp += "] = ";
tmp += x->value_as_string();
tmp += '\n';
} }
diagnostic_info_str_.swap(tmp); tmp.str().swap(diagnostic_info_str_);
} }
return diagnostic_info_str_.c_str(); return diagnostic_info_str_.c_str();
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -6,6 +6,10 @@
#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 #ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593
#define UUID_FA5836A2CADA11DC8CD47C8555D89593 #define UUID_FA5836A2CADA11DC8CD47C8555D89593
#include <boost/config.hpp>
#ifdef BOOST_NO_EXCEPTIONS
#error This header requires exception handling to be enabled.
#endif
#include <boost/exception/exception.hpp> #include <boost/exception/exception.hpp>
#include <boost/exception/detail/type_info.hpp> #include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>

View File

@ -11,7 +11,7 @@
// boost/throw_exception.hpp // boost/throw_exception.hpp
// //
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
// Copyright (c) 2008 Emil Dotchevski and Reverge Studios, Inc. // Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
// //
// Distributed under the Boost Software License, Version 1.0. (See // Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at // accompanying file LICENSE_1_0.txt or copy at
@ -32,7 +32,7 @@
# define BOOST_EXCEPTION_DISABLE # define BOOST_EXCEPTION_DISABLE
#endif #endif
#if !defined( BOOST_NO_EXCEPTIONS ) && !defined( BOOST_EXCEPTION_DISABLE ) #if !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp> # include <boost/exception/exception.hpp>
# include <boost/current_function.hpp> # include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\ # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,6 +1,6 @@
# Boost Exception Library test Jamfile # Boost Exception Library test Jamfile
# #
# Copyright (c) 2006-2008 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
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -33,6 +33,8 @@ run errno_test.cpp ;
run error_info_test.cpp ; run error_info_test.cpp ;
run diagnostic_information_test.cpp ; run diagnostic_information_test.cpp ;
run refcount_ptr_test.cpp ; run refcount_ptr_test.cpp ;
run current_exception_cast_test.cpp ;
run no_exceptions_test.cpp : : : <exception-handling>off ;
compile-fail exception_fail.cpp ; compile-fail exception_fail.cpp ;
compile-fail throw_exception_fail.cpp ; compile-fail throw_exception_fail.cpp ;
@ -47,3 +49,4 @@ compile info_hpp_test.cpp ;
compile info_tuple_hpp_test.cpp ; compile info_tuple_hpp_test.cpp ;
compile to_string_hpp_test.cpp ; compile to_string_hpp_test.cpp ;
compile to_string_stub_hpp_test.cpp ; compile to_string_stub_hpp_test.cpp ;
compile current_exception_cast_hpp_test.cpp ;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -382,7 +382,7 @@ main()
boost::unknown_exception & x ) boost::unknown_exception & x )
{ {
BOOST_TEST(boost::get_error_info<my_info>(x)); BOOST_TEST(boost::get_error_info<my_info>(x));
if( boost::shared_ptr<int const> p=boost::get_error_info<my_info>(x) ) if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42); BOOST_TEST(*p==42);
boost::exception_ptr p = boost::current_exception(); boost::exception_ptr p = boost::current_exception();
BOOST_TEST(!(p==boost::exception_ptr())); BOOST_TEST(!(p==boost::exception_ptr()));
@ -397,7 +397,7 @@ main()
boost::unknown_exception & x ) boost::unknown_exception & x )
{ {
BOOST_TEST(boost::get_error_info<my_info>(x)); BOOST_TEST(boost::get_error_info<my_info>(x));
if( boost::shared_ptr<int const> p=boost::get_error_info<my_info>(x) ) if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42); BOOST_TEST(*p==42);
} }
catch( catch(
@ -433,7 +433,7 @@ main()
boost::unknown_exception & x ) boost::unknown_exception & x )
{ {
BOOST_TEST(boost::get_error_info<my_info>(x)); BOOST_TEST(boost::get_error_info<my_info>(x));
if( boost::shared_ptr<int const> p=boost::get_error_info<my_info>(x) ) if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42); BOOST_TEST(*p==42);
boost::exception_ptr p = boost::current_exception(); boost::exception_ptr p = boost::current_exception();
BOOST_TEST(!(p==boost::exception_ptr())); BOOST_TEST(!(p==boost::exception_ptr()));
@ -448,7 +448,7 @@ main()
boost::unknown_exception & x ) boost::unknown_exception & x )
{ {
BOOST_TEST(boost::get_error_info<my_info>(x)); BOOST_TEST(boost::get_error_info<my_info>(x));
if( boost::shared_ptr<int const> p=boost::get_error_info<my_info>(x) ) if( int const * p=boost::get_error_info<my_info>(x) )
BOOST_TEST(*p==42); BOOST_TEST(*p==42);
} }
catch( catch(

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,7 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/current_exception_cast.hpp>
#include <boost/exception/current_exception_cast.hpp>

View File

@ -0,0 +1,47 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/exception/current_exception_cast.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <exception>
class
my_exception:
public std::exception
{
};
class
polymorphic
{
virtual
~polymorphic()
{
}
};
int
main()
{
try
{
throw my_exception();
}
catch(
std::exception & e )
{
try
{
throw;
}
catch(
...)
{
BOOST_TEST(boost::current_exception_cast<std::exception>()==&e);
BOOST_TEST(!boost::current_exception_cast<polymorphic>());
}
}
return boost::report_errors();
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -27,8 +27,8 @@ to_string( tagged_int2 const & x )
struct struct
error1: error1:
public std::exception, std::exception,
public boost::exception boost::exception
{ {
char const * char const *
what() const throw() what() const throw()
@ -39,26 +39,14 @@ error1:
struct struct
error2: error2:
public boost::exception boost::exception
{ {
}; };
int void
main() test1( std::string const & di1, std::string const & di2 )
{ {
using namespace boost; BOOST_TEST( di1!=di2 );
try
{
error1 x; x << tagged_int1(42) << tagged_int2(42);
BOOST_TEST(x.what()==std::string("error1"));
throw x;
}
catch(
boost::exception & x )
{
std::string di1=boost::diagnostic_information(x);
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = diagnostic_information(x);
#ifndef BOOST_NO_RTTI #ifndef BOOST_NO_RTTI
BOOST_TEST(di1.find("type:")!=std::string::npos); BOOST_TEST(di1.find("type:")!=std::string::npos);
BOOST_TEST(di1.find("error1")!=std::string::npos); BOOST_TEST(di1.find("error1")!=std::string::npos);
@ -74,23 +62,10 @@ main()
BOOST_TEST(di2.find("test_tag2")!=std::string::npos); BOOST_TEST(di2.find("test_tag2")!=std::string::npos);
BOOST_TEST(di2.find("bad value")!=std::string::npos); BOOST_TEST(di2.find("bad value")!=std::string::npos);
} }
catch(
... ) void
test2( std::string const & di1, std::string const & di2 )
{ {
BOOST_TEST(false);
}
try
{
error2 x;
x << tagged_int1(42) << tagged_int2(42);
throw x;
}
catch(
boost::exception & x )
{
std::string di1 = diagnostic_information(x);
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = diagnostic_information(x);
BOOST_TEST( di1!=di2 ); BOOST_TEST( di1!=di2 );
BOOST_TEST(di1.find("test_tag1")!=std::string::npos); BOOST_TEST(di1.find("test_tag1")!=std::string::npos);
BOOST_TEST(di1.find("test_tag2")!=std::string::npos); BOOST_TEST(di1.find("test_tag2")!=std::string::npos);
@ -99,10 +74,66 @@ main()
BOOST_TEST(di2.find("test_tag2")!=std::string::npos); BOOST_TEST(di2.find("test_tag2")!=std::string::npos);
BOOST_TEST(di2.find("bad value")!=std::string::npos); BOOST_TEST(di2.find("bad value")!=std::string::npos);
} }
catch(
... ) int
main()
{ {
BOOST_TEST(false); using namespace boost;
try
{
error1 x; x << tagged_int1(42) << tagged_int2(42);
BOOST_TEST(x.what()==std::string("error1"));
throw x;
}
catch(
error1 & x )
{
std::string di1=boost::diagnostic_information(x);
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = diagnostic_information(x);
test1(di1,di2);
}
try
{
error1 x; x << tagged_int1(42) << tagged_int2(42);
BOOST_TEST(x.what()==std::string("error1"));
throw x;
}
catch(
error1 & x )
{
std::string di1=boost::current_exception_diagnostic_information();
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = current_exception_diagnostic_information();
test1(di1,di2);
}
try
{
error2 x;
x << tagged_int1(42) << tagged_int2(42);
throw x;
}
catch(
error2 & x )
{
std::string di1 = diagnostic_information(x);
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = diagnostic_information(x);
test2(di1,di2);
}
try
{
error2 x;
x << tagged_int1(42) << tagged_int2(42);
throw x;
}
catch(
error2 & x )
{
std::string di1 = current_exception_diagnostic_information();
x << tagged_int1(2) << tagged_int2(2);
std::string di2 = current_exception_diagnostic_information();
test2(di1,di2);
} }
return boost::report_errors(); return boost::report_errors();
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -55,7 +55,7 @@ main()
{ {
#endif #endif
BOOST_TEST( boost::get_error_info<test_int>(x) ); BOOST_TEST( boost::get_error_info<test_int>(x) );
if( boost::shared_ptr<int const> p=boost::get_error_info<test_int>(x) ) if( int const * p=boost::get_error_info<test_int>(x) )
BOOST_TEST( 42==*p ); BOOST_TEST( 42==*p );
#ifdef BOOST_NO_RTTI #ifdef BOOST_NO_RTTI
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -0,0 +1,40 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Distributed under the Boost Software License, Version 1.0. (See accompanying
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#define BOOST_NO_EXCEPTIONS
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/exception/info.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <stdlib.h>
struct my_exception: boost::exception, std::exception { };
typedef boost::error_info<struct my_tag,int> my_int;
bool called=false;
namespace
boost
{
void
throw_exception( std::exception const & x )
{
called=true;
std::string s=boost::diagnostic_information(x);
std::cout << s;
#ifndef BOOST_NO_RTTI
BOOST_TEST(s.find("my_tag")!=std::string::npos);
#endif
}
}
int
main()
{
BOOST_THROW_EXCEPTION( my_exception() << my_int(42) );
BOOST_TEST(called);
return boost::report_errors();
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -35,9 +35,9 @@ boost_throw_exception_test()
catch( catch(
boost::exception & x ) boost::exception & x )
{ {
boost::shared_ptr<char const * const> file=boost::get_error_info<boost::throw_function>(x); char const * const * file=boost::get_error_info<boost::throw_function>(x);
boost::shared_ptr<char const * const> function=boost::get_error_info<boost::throw_file>(x); char const * const * function=boost::get_error_info<boost::throw_file>(x);
boost::shared_ptr<int const> line=boost::get_error_info<boost::throw_line>(x); int const * line=boost::get_error_info<boost::throw_line>(x);
BOOST_TEST( file && *file ); BOOST_TEST( file && *file );
BOOST_TEST( function && *function ); BOOST_TEST( function && *function );
BOOST_TEST( line && *line==32 ); BOOST_TEST( line && *line==32 );
@ -55,10 +55,10 @@ boost_throw_exception_test()
catch( catch(
boost::exception & x ) boost::exception & x )
{ {
boost::shared_ptr<char const * const> file=boost::get_error_info<boost::throw_function>(x); char const * const * file=boost::get_error_info<boost::throw_function>(x);
boost::shared_ptr<char const * const> function=boost::get_error_info<boost::throw_file>(x); char const * const * function=boost::get_error_info<boost::throw_file>(x);
boost::shared_ptr<int const> line=boost::get_error_info<boost::throw_line>(x); int const * line=boost::get_error_info<boost::throw_line>(x);
boost::shared_ptr<int const> data=boost::get_error_info<test_data>(x); int const * data=boost::get_error_info<test_data>(x);
BOOST_TEST( file && *file ); BOOST_TEST( file && *file );
BOOST_TEST( function && *function ); BOOST_TEST( function && *function );
BOOST_TEST( line && *line==52 ); BOOST_TEST( line && *line==52 );
@ -117,7 +117,7 @@ tester()
{ {
#endif #endif
BOOST_TEST(boost::get_error_info<test_data>(y)); BOOST_TEST(boost::get_error_info<test_data>(y));
if( boost::shared_ptr<int const> d=boost::get_error_info<test_data>(y) ) if( int const * d=boost::get_error_info<test_data>(y) )
BOOST_TEST(*d==42); BOOST_TEST(*d==42);
#ifdef BOOST_NO_RTTI #ifdef BOOST_NO_RTTI
} }

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2008 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
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -56,7 +56,7 @@ main()
catch( catch(
boost::unknown_exception & x ) boost::unknown_exception & x )
{ {
if( boost::shared_ptr<int const> d=boost::get_error_info<test>(x) ) if( int const * d=boost::get_error_info<test>(x) )
BOOST_TEST( 42==*d ); BOOST_TEST( 42==*d );
else else
BOOST_TEST(false); BOOST_TEST(false);
@ -73,7 +73,7 @@ main()
catch( catch(
boost::exception & x ) boost::exception & x )
{ {
if( boost::shared_ptr<int const> d=boost::get_error_info<test>(x) ) if( int const * d=boost::get_error_info<test>(x) )
BOOST_TEST( 42==*d ); BOOST_TEST( 42==*d );
else else
BOOST_TEST(false); BOOST_TEST(false);