<p>Some exception hierarchies can not be modified to make boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> a base type. In this case, the <spanclass="RenoLink"><ahref="enable_error_info.html">enable_error_info</a></span> function template can be used to make exception objects derive from boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> anyway. Here is an example:</p>
<p>The call to <spanclass="RenoLink"><ahref="enable_error_info.html">enable_error_info</a></span><T> gets us an object of <i>unspecified type</i> which is guaranteed to derive from both boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span> and T. This makes it possible to use <spanclass="RenoLink"><ahref="exception_operator_shl.html">operator<<</a></span> to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::<spanclass="RenoLink"><ahref="exception.html">exception</a></span>&, so that <spanclass="RenoLink"><ahref="tutorial_transporting_data.html">more information can be added to the exception at a later time</a></span>.</p>