forked from boostorg/exception
documentation update
[SVN r48544]
This commit is contained in:
@ -21,7 +21,12 @@
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Diagnostic Information</h2>
|
||||
</div>
|
||||
<p>Class boost::<span class="RenoLink"><a href="exception.html">exception</a></span> provides a virtual member function <span class="RenoLink"><a href="exception_diagnostic_information.html">diagnostic_information</a></span>, with a signature similar to the familiar std::exception::what function. The default implementation returns a string value that is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:</p>
|
||||
<p>Boost Exception provides a namespace-scope function <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> which takes a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. The returned string contains:</p>
|
||||
<div><ul><li>the string representation of all data objects added to the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span>;</li>
|
||||
<li>the output from std::exception::what;</li>
|
||||
<li>additional platform-specific diagnostic information.</li>
|
||||
</ul></div>
|
||||
<p>The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <iostream>
|
||||
|
||||
@ -37,17 +42,12 @@ g()
|
||||
catch(
|
||||
boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
std::cerr << e.<span class="RenoLink"><a href="exception_diagnostic_information.html">diagnostic_information</a></span>();
|
||||
std::cerr << <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>(e);
|
||||
}
|
||||
}</pre>
|
||||
<p>The <span class="RenoLink"><a href="exception_diagnostic_information.html">diagnostic_information</a></span> member function iterates over all data objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="operator_shl_exception.html">operator<<</a></span>. The returned string is constructed by converting each data object to string and then concatenating these strings together.</p>
|
||||
<p>When the <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> template is instantiated, the system attempts overload resolution for an unqualified call to to_string(x), where x is of type T. If this is successful, the to_string overload is expected to return std::string and is used to convert objects of type T to string.</p>
|
||||
<p>Otherwise, the system attempts overload resolution for s << x, where s is a std::ostringstream and x is of type T. If this is successful, the operator<< overload is used to convert objects of type T to string.</p>
|
||||
<p>Otherwise the system is unable to convert objects of type T to string, and an unspecified stub string value is used without issuing a compile error.</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="exception_diagnostic_information.html">exception::diagnostic_information<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
|
Reference in New Issue
Block a user