Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/utility/throw_exception.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 2.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html>
3        <head>
4                <title>Boost: throw_exception.hpp documentation</title>
5                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6        </head>
7        <body bgcolor="white" style="MARGIN-LEFT: 5%; MARGIN-RIGHT: 5%">
8                <table border="0" width="100%">
9                        <tr>
10                                <td width="277">
11                                        <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86">
12                                </td>
13                                <td align="middle">
14                                        <h1>throw_exception.hpp</h1>
15                                </td>
16                        </tr>
17                        <tr>
18                                <td colspan="2" height="64">&nbsp;</td>
19                        </tr>
20                </table>
21                <p>
22                        The header <STRONG>&lt;boost/throw_exception.hpp&gt;</STRONG> defines the
23                        helper function <STRONG>boost::throw_exception</STRONG>. It is intended to be
24                        used in Boost libraries that need to throw exceptions, but support
25                        configurations and platforms where exceptions aren't available, as indicated by
26                        the presence of the <STRONG>BOOST_NO_EXCEPTIONS</STRONG> <A href="../config/config.htm#macro_ref">
27                                configuration macro</A>.
28                </p>
29                <P>When <STRONG>BOOST_NO_EXCEPTIONS</STRONG> is not defined, <tt>boost::throw_exception(e)</tt>
30                        is equivalent to <tt>throw e</tt>. Otherwise, the function is left undefined,
31                        and the user is expected to supply an appropriate definition. Callers of <tt>throw_exception</tt>
32                        are allowed to assume that the function never returns; therefore, if the
33                        user-defined <tt>throw_exception</tt> returns, the behavior is undefined.</P>
34                <h3><a name="Synopsis">Synopsis</a></h3>
35                <pre>
36namespace boost
37{
38
39#ifdef BOOST_NO_EXCEPTIONS
40
41void throw_exception(std::exception const &amp; e); // user defined
42
43#else
44
45template&lt;class E&gt; void throw_exception(E const &amp; e)
46{
47    throw e;
48}
49
50#endif
51
52}
53</pre>
54                <p><br>
55                        <small>Copyright © 2002 by Peter Dimov. Permission to copy, use, modify, sell and
56                                distribute this document is granted provided this copyright notice appears in
57                                all copies. This document is provided "as is" without express or implied
58                                warranty, and with no claim as to its suitability for any purpose.</small></p>
59        </body>
60</html>
Note: See TracBrowser for help on using the repository browser.