mirror of
https://github.com/boostorg/safe_numerics.git
synced 2026-02-13 12:42:16 +00:00
91 lines
4.8 KiB
HTML
91 lines
4.8 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>overflow</title>
|
|
<link rel="stylesheet" href="../boostbook.css" type="text/css">
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
|
|
<link rel="home" href="../index.html" title="Safe Numerics">
|
|
<link rel="up" href="../functions.html" title="Functions">
|
|
<link rel="prev" href="../safe_compare.html" title="safe_compare">
|
|
<link rel="next" href="../rationale.html" title="Rationale">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table cellpadding="2" width="100%"><tr>
|
|
<td valign="top"><img alt="pre-boost" width="30%" height="30%" src="../pre-boost.jpg"></td>
|
|
<td align="center"><a href="../../../index.html">Home</a></td>
|
|
<td align="center"><a href="http://www.boost.org/doc/libs">Libraries</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
|
<td align="center"><a href="../../../more/index.htm">More</a></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="../safe_compare.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../functions.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../rationale.html"><img src="../images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="safe_numerics.rationale.overflow"></a>overflow</h3></div></div></div>
|
|
<div class="toc"><dl>
|
|
<dt><span class="section"><a href="../overflow.html#id754741">Synopsis</a></span></dt>
|
|
<dt><span class="section"><a href="../overflow.html#id754761">Description</a></span></dt>
|
|
<dt><span class="section"><a href="../overflow.html#id754796">Header</a></span></dt>
|
|
<dt><span class="section"><a href="../overflow.html#id754817">Example of use</a></span></dt>
|
|
<dt><span class="section"><a href="../overflow.html#id754831">See Also</a></span></dt>
|
|
</dl></div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="id754741"></a>Synopsis</h4></div></div></div>
|
|
<p>This function is invoked by the library whenever it is not possible
|
|
to produce a result for an arithmetic operation.</p>
|
|
<pre class="programlisting">void overflow(char const * const msg);</pre>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="id754761"></a>Description</h4></div></div></div>
|
|
<p>If evironment supports C++ exceptions, this function throws the
|
|
exception .</p>
|
|
<p>If the environment does not support C++ exceptions, the user should
|
|
implement this function and expect it to be called when appropriate.
|
|
Otherwise, function is implemented by the library so that it throws the
|
|
standard library exception <code class="computeroutput">std::out_of_range(msg)</code>.</p>
|
|
<p><code class="filename">boost/config.hpp </code>defines BOOST_NO_EXCEPTIONS
|
|
when the environment doesn't support exceptions. It is by checking for the
|
|
definition of this macro that the system determines whether or not
|
|
exceptions are supported.</p>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="id754796"></a>Header</h4></div></div></div>
|
|
<p><a href="../include/safe_numerics/overflow" target="_top"><code class="computeroutput">#include
|
|
<boost/safe_numerics/overflow.hpp> </code></a></p>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="id754817"></a>Example of use</h4></div></div></div>
|
|
<pre class="programlisting">#include <cstdio>
|
|
|
|
void overflow(char const * const msg){
|
|
std::fputs("safe_numerics overflow error:, std::stderr);
|
|
std::fputs(msg, std::stderr);
|
|
std::fputc('\n', std::stderr);
|
|
}</pre>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h4 class="title">
|
|
<a name="id754831"></a>See Also</h4></div></div></div>
|
|
<p>See <a class="link" href="rationale/overflow.html" title="overflow">rationale</a> for more
|
|
information on this function</p>
|
|
</div>
|
|
</div>
|
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
|
<td align="left"></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2012 Robert Ramey<p><a href="???" target="_top">Subject to Boost Software License</a></p>
|
|
</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="../safe_compare.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../functions.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="../rationale.html"><img src="../images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|