mirror of
https://github.com/boostorg/mpl.git
synced 2026-01-26 17:02:20 +01:00
59 lines
2.7 KiB
HTML
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<
|
|
typename Sequence1
|
|
, typename Sequence2
|
|
, typename Pred = is_same<_1,_2>
|
|
>
|
|
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> Parameter </th><th> Requirement </th><th> Description </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> Expression </th><th> Expression type </th><th> Precondition </th><th> Semantics </th><th> Postcondition </th></tr>
|
|
<tr><td><code>typedef equal<Sequence1,Sequence2,Pred>::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<Sequence1>::type::value == size<Sequence2>::type::value</code> and for every iterator <code>i</code> in <code>[begin<Sequence>::type,end<Sequence>::type)</code> <code>i::type</code> is identical to <code>advance< begin<Sequence2>::type, distance< begin<Sequence1>::type,i >::type >::type</code>.</td><td></td></tr>
|
|
</table>
|
|
<p>
|
|
<h3>Complexity</h3>
|
|
<p>
|
|
Linear. At most <code>size<Sequence1>::value</code> comparisons.
|
|
<p>
|
|
<h3>Example</h3>
|
|
<p>
|
|
<pre>
|
|
typedef <a href="../Reference/vector.html">vector</a><char,int,unsigned,long,unsigned long> s1;
|
|
typedef <a href="../Reference/list.html">list</a><char,int,unsigned,long,unsigned long> s2;
|
|
BOOST_STATIC_ASSERT((equal<s1,s2>::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> |