Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/utility/throw_exception.html @ 35

Last change on this file since 35 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

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"><A href="../../index.htm"> <img src="../../boost.png" alt="boost.png (6897 bytes)" width="277" height="86" border="0"></A>
11                                </td>
12                                <td align="center">
13                                        <h1>throw_exception.hpp</h1>
14                                </td>
15                        </tr>
16                        <tr>
17                                <td colspan="2" height="64">&nbsp;</td>
18                        </tr>
19                </table>
20                <p>
21                        The header <STRONG>&lt;boost/throw_exception.hpp&gt;</STRONG> defines the
22                        helper function <STRONG>boost::throw_exception</STRONG>. It is intended to be
23                        used in Boost libraries that need to throw exceptions, but support
24                        configurations and platforms where exceptions aren't available, as indicated by
25                        the presence of the <STRONG>BOOST_NO_EXCEPTIONS</STRONG> <A href="../config/config.htm#macro_ref">
26                                configuration macro</A>.
27                </p>
28                <P>When <STRONG>BOOST_NO_EXCEPTIONS</STRONG> is not defined, <tt>boost::throw_exception(e)</tt>
29                        is equivalent to <tt>throw e</tt>. Otherwise, the function is left undefined,
30                        and the user is expected to supply an appropriate definition. Callers of <tt>throw_exception</tt>
31                        are allowed to assume that the function never returns; therefore, if the
32                        user-defined <tt>throw_exception</tt> returns, the behavior is undefined.</P>
33                <h3><a name="Synopsis">Synopsis</a></h3>
34                <pre>
35namespace boost
36{
37
38#ifdef BOOST_NO_EXCEPTIONS
39
40void throw_exception(std::exception const &amp; e); // user defined
41
42#else
43
44template&lt;class E&gt; void throw_exception(E const &amp; e)
45{
46    throw e;
47}
48
49#endif
50
51}
52</pre>
53                <p><br>
54                        <small>Copyright © 2002 by Peter Dimov. Distributed under the Boost Software License, Version
55                                1.0. See accompanying file <A href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</A> or
56                                copy at <A href="http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt</A>.</small></p>
57        </body>
58</html>
Note: See TracBrowser for help on using the repository browser.