1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>equal</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Chapter 1. Fusion 2.2"> 8<link rel="up" href="../comparison.html" title="Comparison"> 9<link rel="prev" href="../comparison.html" title="Comparison"> 10<link rel="next" href="not_equal.html" title="not equal"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../comparison.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../comparison.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="not_equal.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="fusion.sequence.operator.comparison.equal"></a><a class="link" href="equal.html" title="equal">equal</a> 28</h5></div></div></div> 29<h6> 30<a name="fusion.sequence.operator.comparison.equal.h0"></a> 31 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.description"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.description">Description</a> 32 </h6> 33<p> 34 Compare two sequences for equality. 35 </p> 36<h6> 37<a name="fusion.sequence.operator.comparison.equal.h1"></a> 38 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.synopsis"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.synopsis">Synopsis</a> 39 </h6> 40<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Seq1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Seq2</span><span class="special">></span> 41<span class="keyword">bool</span> 42<span class="keyword">operator</span><span class="special">==(</span><span class="identifier">Seq1</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">Seq2</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">b</span><span class="special">);</span> 43</pre> 44<h6> 45<a name="fusion.sequence.operator.comparison.equal.h2"></a> 46 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.parameters"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.parameters">Parameters</a> 47 </h6> 48<div class="informaltable"><table class="table"> 49<colgroup> 50<col> 51<col> 52<col> 53</colgroup> 54<thead><tr> 55<th> 56 <p> 57 Parameter 58 </p> 59 </th> 60<th> 61 <p> 62 Requirement 63 </p> 64 </th> 65<th> 66 <p> 67 Description 68 </p> 69 </th> 70</tr></thead> 71<tbody><tr> 72<td> 73 <p> 74 <code class="computeroutput"><span class="identifier">a</span><span class="special">,</span> 75 <span class="identifier">b</span></code> 76 </p> 77 </td> 78<td> 79 <p> 80 Instances of <a class="link" href="../../../sequence.html" title="Sequence">Sequence</a> 81 </p> 82 </td> 83<td> 84 <p> 85 <a class="link" href="../../../sequence.html" title="Sequence">Sequence</a>(s) to compare 86 </p> 87 </td> 88</tr></tbody> 89</table></div> 90<h6> 91<a name="fusion.sequence.operator.comparison.equal.h3"></a> 92 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.expression_semantics"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.expression_semantics">Expression 93 Semantics</a> 94 </h6> 95<pre class="programlisting"><span class="identifier">a</span> <span class="special">==</span> <span class="identifier">b</span> 96</pre> 97<p> 98 <span class="bold"><strong>Return type</strong></span>: <code class="computeroutput"><span class="keyword">bool</span></code> 99 </p> 100<p> 101 <span class="bold"><strong>Requirements</strong></span>: 102 </p> 103<p> 104 For each element, <code class="computeroutput"><span class="identifier">e1</span></code>, 105 in sequence <code class="computeroutput"><span class="identifier">a</span></code>, and for 106 each element, <code class="computeroutput"><span class="identifier">e2</span></code>, in 107 sequence <code class="computeroutput"><span class="identifier">b</span></code>, <code class="computeroutput"><span class="identifier">a</span> <span class="special">==</span> <span class="identifier">b</span></code> is a valid expression returning a 108 type that is convertible to bool. 109 </p> 110<p> 111 An attempt to compare two Sequences of different lengths results in a 112 compile time error. 113 </p> 114<p> 115 <span class="bold"><strong>Semantics</strong></span>: 116 </p> 117<p> 118 For each element, <code class="computeroutput"><span class="identifier">e1</span></code>, 119 in sequence <code class="computeroutput"><span class="identifier">a</span></code>, and for 120 each element, <code class="computeroutput"><span class="identifier">e2</span></code>, in 121 sequence <code class="computeroutput"><span class="identifier">b</span></code>, <code class="computeroutput"><span class="identifier">e1</span> <span class="special">==</span> <span class="identifier">e2</span></code> returns true. For any 2 zero length 122 <a class="link" href="../../../sequence.html" title="Sequence">Sequence</a>(s), e and f, e == f returns 123 true. 124 </p> 125<h6> 126<a name="fusion.sequence.operator.comparison.equal.h4"></a> 127 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.header"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.header">Header</a> 128 </h6> 129<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">sequence</span><span class="special">/</span><span class="identifier">comparison</span><span class="special">/</span><span class="identifier">equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 130<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">equal_to</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 131</pre> 132<h6> 133<a name="fusion.sequence.operator.comparison.equal.h5"></a> 134 <span class="phrase"><a name="fusion.sequence.operator.comparison.equal.example"></a></span><a class="link" href="equal.html#fusion.sequence.operator.comparison.equal.example">Example</a> 135 </h6> 136<pre class="programlisting"><a class="link" href="../../../container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">></span> <span class="identifier">v1</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="char">'a'</span><span class="special">);</span> 137<a class="link" href="../../../container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">></span> <span class="identifier">v2</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="char">'a'</span><span class="special">);</span> 138<span class="identifier">assert</span><span class="special">(</span><span class="identifier">v1</span> <span class="special">==</span> <span class="identifier">v2</span><span class="special">);</span> 139</pre> 140</div> 141<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 142<td align="left"></td> 143<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 144 Dan Marsden, Tobias Schwinger<p> 145 Distributed under the Boost Software License, Version 1.0. (See accompanying 146 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 147 </p> 148</div></td> 149</tr></table> 150<hr> 151<div class="spirit-nav"> 152<a accesskey="p" href="../comparison.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../comparison.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="not_equal.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 153</div> 154</body> 155</html> 156