Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > by-pkgid > ef9bad9e14fc2a68cb7c992c11d75f5e > files > 3037

libboost1-devel-1.31.0-1mdk.i586.rpm

<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::divides</title>
<link rel="stylesheet" href="../mpl_wiki.css">
</head><body bgcolor="white">
<h1><a href="../Table_of_Contents.html"><img src="../mpl_logo.jpg" alt="[Home]" border=0 align="right"></a>divides</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
      typename T1
    , typename T2
    , typename T3 = integral_c&lt;int,1&gt;
    , ...
    , typename Tn = integral_c&lt;int,1&gt;
    &gt;
struct divides
{
    typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns the quotient of its arguments [<a href="#1">1</a>].
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/divides.hpp">boost/mpl/divides.hpp</a>"
</pre>
<p>
<h3>Parameters</h3>
<table border="1">
<tr><th>&nbsp;Parameter&nbsp;</th><th>&nbsp;Requirement&nbsp;</th><th>&nbsp;Description &nbsp;</th></tr>
<tr><td><code>T1, T2, .., Tn</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression&nbsp;type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef divides&lt;t1,t2,..,tn&gt;::type quot;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td><code>t2::value != 0, t3::value != 0, .., tn::value != 0</code></td><td>Equivalent to <code>typedef integral_c&lt;typeof(t1::value / t2::value .. / tn::value), t1::value / t2::value .. / tn::value &gt; quot;</code></td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Amortized constant time.
<p>
<h3>Example</h3>
<p>
<pre>
typedef divides&lt; integral_c&lt;short,-10&gt;, integral_c&lt;long,3&gt; &gt;::type quot;
BOOST_STATIC_ASSERT(quot::value == -3));
BOOST_MPL_ASSERT_IS_SAME(quot::value_type, long);
</pre>
<p>
<h3>Notes</h3>
<p>
[<a name="1">1</a>]  The <code>divides</code> metafunction can be (and is expected to be) specialized by user to work on user-defined types that do not satisfy the <a href="../Integral_Constant.html">Integral Constant</a> requirements. The requirements listed here are the ones imposed by the default implementation.<br>
<p>
<h3>See also</h3>
<p>
<a href="../Metafunctions.html">Metafunctions</a>, <code><a href="../Reference/multiplies.html">multiplies</a></code>, <code><a href="../Reference/modulus.html">modulus</a></code>, <code><a href="../Reference/plus.html">plus</a></code>, <code><a href="../Reference/minus.html">minus</a></code>, <code><a href="../Reference/negate.html">negate</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 6:32 am</body></html>