Files
mpl/doc/ref/Reference/equal.html
Aleksey Gurtovoy a69baa5eae update the docs
[SVN r17836]
2003-03-12 13:29:12 +00:00

59 lines
2.7 KiB
HTML

<!doctype html public "-//ietf//dtd html//en">
<html><head><title>boost::mpl::equal</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>equal</h1><h3>Synopsis</h3>
<p>
<pre>
template&lt;
typename Sequence1
, typename Sequence2
, typename Pred = is_same&lt;_1,_2&gt;
&gt;
struct equal
{
typedef <em>unspecified</em> type;
};
</pre>
<p>
<h3>Description</h3>
<p>
Returns <code>true_</code> if the two sequences <code>Sequence1</code> and <code>Sequence2</code> are identical when compared element-by-element, and otherwise returns <code>false_</code>.
<p>
<h3>Definition</h3>
<p>
<pre>
#include "<a href="../../../../../boost/mpl/equal.hpp">boost/mpl/equal.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>Sequence1</code>, <code>Sequence2</code></td><td>A model of <a href="../Forward_Sequence.html">Forward Sequence</a></td><td>Sequences to compare. </td></tr>
<tr><td><code>Pred</code></td><td>A binary Predicate [Lambda Expression]</td><td>The comparison metafunction. </td></tr>
</table>
<p>
<h3>Expression semantics</h3>
<p>
<table border="1">
<tr><th>&nbsp;Expression&nbsp;</th><th>&nbsp;Expression type&nbsp;</th><th>&nbsp;Precondition&nbsp;</th><th>&nbsp;Semantics&nbsp;</th><th>&nbsp;Postcondition&nbsp;</th></tr>
<tr><td><code>typedef equal&lt;Sequence1,Sequence2,Pred&gt;::type c;</code></td><td>A model of <a href="../Integral_Constant.html">Integral Constant</a></td><td></td><td><code>c::value == true</code> is and only if <code>size&lt;Sequence1&gt;::type::value == size&lt;Sequence2&gt;::type::value</code> and for every iterator <code>i</code> in <code>[begin&lt;Sequence&gt;::type,end&lt;Sequence&gt;::type)</code> <code>i::type</code> is identical to <code>advance&lt; begin&lt;Sequence2&gt;::type, distance&lt; begin&lt;Sequence1&gt;::type,i &gt;::type &gt;::type</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. At most <code>size&lt;Sequence1&gt;::value</code> comparisons.
<p>
<h3>Example</h3>
<p>
<pre>
typedef <a href="../Reference/vector.html">vector</a>&lt;char,int,unsigned,long,unsigned long&gt; s1;
typedef <a href="../Reference/list.html">list</a>&lt;char,int,unsigned,long,unsigned long&gt; s2;
BOOST_STATIC_ASSERT((equal&lt;s1,s2&gt;::type::value));
</pre>
<p>
<h3>See also</h3>
<p>
<a href="../Algorithms.html">Algorithms</a>, <code><a href="../Reference/count.html">count</a></code>, <code><a href="../Reference/count_if.html">count_if</a></code>
<p><hr>
<a href="../Table_of_Contents.html">Table of Contents</a><br>Last edited March 10, 2003 5:39 am</body></html>