<spanclass="RenoLink"><ahref="exception_constructors.html">exception</a></span>( <spanclass="RenoLink"><ahref="exception.html">exception</a></span> const & x );</span>
</div><p>Class boost::<spanclass="RenoLink"><ahref="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::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> can store data of arbitrary types, using the <spanclass="RenoLink"><ahref="error_info.html">error_info</a></span> wrapper and <spanclass="RenoLink"><ahref="operator_shl_exception.html">operator<<</a></span>.</p>
<p>To retrieve data from a boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> object, use the <spanclass="RenoLink"><ahref="get_error_info.html">get_error_info</a></span> function template.</p>
<spanclass="RenoLink"><ahref="exception_constructors.html">exception</a></span>( <spanclass="RenoLink"><ahref="exception.html">exception</a></span> const & x );</pre>
<div><ul><li> Default constructor: initializes an empty boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> object.</li>
<li> Copy constructor: initializes a boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> object which shares with x all data added through <spanclass="RenoLink"><ahref="operator_shl_exception.html">operator<<</a></span>, including data that is added at a future time.</li>
<p>An string representation of all data stored in the boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> object by the <spanclass="RenoLink"><ahref="operator_shl_exception.html">operator<<</a></span> function. See "<spanclass="RenoLink"><ahref="tutorial_diagnostic_information.html">Tutorial: Diagnostic Information</a></span>" for details.</p>
<p>The default implementation is equivalent to return <spanclass="RenoLink"><ahref="exception_diagnostic_information.html">exception::diagnostic_information</a></span>(). The signature of boost::<spanclass="RenoLink"><ahref="exception_what.html">exception::what</a></span> is identical to the familiar std::exception::what function, so that when an exception type that derives both std::exception and boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> overrides the what function, it overrides both std::exception::what and boost::<spanclass="RenoLink"><ahref="exception_what.html">exception::what</a></span>.</p>
<h4>Throws:</h4>
<p>Nothing.</p>
<h4>Note:</h4>
<p>The return value remains valid until the exception object from which it is obtained is destroyed or modified.</p>