mirror of
https://github.com/boostorg/exception.git
synced 2025-07-03 15:56:36 +02:00
Documentation and examples update.
[SVN r54831]
This commit is contained in:
@ -28,11 +28,10 @@
|
||||
</div>
|
||||
<p>Here is how cloning can be enabled in a throw-expression (15.1):</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="boost_exception_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="boost_exception_errinfo_errno_hpp.html">boost/exception/errinfo_errno.hpp</a></span>>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
|
||||
class file_read_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
|
||||
void
|
||||
@ -40,7 +39,7 @@ file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(file_read_error()) <<
|
||||
errno_info(errno);
|
||||
boost::<span class="RenoLink"><a href="errinfo_errno.html">errinfo_errno</a></span>(errno);
|
||||
}</pre>
|
||||
<p>Of course, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> may be used with any exception type; there is no requirement that it should derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Cloning and Re-Throwing an Exception</h3>
|
||||
|
Reference in New Issue
Block a user