<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><h4>Effects:</h4>
<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>A 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">Diagnostic Information</a></span>" for details.</p>
<div><ul><li>The return value remains valid until the exception object from which it was obtained is destroyed or modified.</li>
<li>The header <spanclass="RenoLink"><ahref="boost_exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span> provides a namespace-scope function <spanclass="RenoLink"><ahref="diagnostic_information.html">diagnostic_information</a></span> which takes a std::exception. It calls <spanclass="RenoLink"><ahref="exception_diagnostic_information.html">exception::diagnostic_information</a></span> if its argument can be converted to boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span>; otherwise it returns a string that combines the value of std::exception::what and the exception's dynamic type.</li>