• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>has_key</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="../functions.html" title="Functions">
9<link rel="prev" href="at_c.html" title="at_c">
10<link rel="next" href="at_key.html" title="at_key">
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="at_c.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../functions.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="at_key.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.intrinsic.functions.has_key"></a><a class="link" href="has_key.html" title="has_key">has_key</a>
28</h5></div></div></div>
29<h6>
30<a name="fusion.sequence.intrinsic.functions.has_key.h0"></a>
31            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.description"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.description">Description</a>
32          </h6>
33<p>
34            Returns a type convertible to <code class="computeroutput"><span class="keyword">bool</span></code>
35            that evaluates to <code class="computeroutput"><span class="keyword">true</span></code> if
36            the sequence contains an element associated with a Key, else, evaluates
37            to <code class="computeroutput"><span class="keyword">false</span></code>.
38          </p>
39<h6>
40<a name="fusion.sequence.intrinsic.functions.has_key.h1"></a>
41            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.synopsis"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.synopsis">Synopsis</a>
42          </h6>
43<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Key</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Sequence</span><span class="special">&gt;</span>
44<span class="keyword">typename</span> <a class="link" href="../metafunctions/has_key.html" title="has_key"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">has_key</span></code></a><span class="special">&lt;</span><span class="identifier">Sequence</span><span class="special">,</span> <span class="identifier">Key</span><span class="special">&gt;::</span><span class="identifier">type</span>
45<span class="identifier">has_key</span><span class="special">(</span><span class="identifier">Sequence</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">seq</span><span class="special">);</span>
46</pre>
47<h6>
48<a name="fusion.sequence.intrinsic.functions.has_key.h2"></a>
49            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.parameters"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.parameters">Parameters</a>
50          </h6>
51<div class="informaltable"><table class="table">
52<colgroup>
53<col>
54<col>
55<col>
56</colgroup>
57<thead><tr>
58<th>
59                    <p>
60                      Parameter
61                    </p>
62                  </th>
63<th>
64                    <p>
65                      Requirement
66                    </p>
67                  </th>
68<th>
69                    <p>
70                      Description
71                    </p>
72                  </th>
73</tr></thead>
74<tbody>
75<tr>
76<td>
77                    <p>
78                      <code class="computeroutput"><span class="identifier">seq</span></code>
79                    </p>
80                  </td>
81<td>
82                    <p>
83                      Model of <a class="link" href="../../concepts/associative_sequence.html" title="Associative Sequence">Associative
84                      Sequence</a>
85                    </p>
86                  </td>
87<td>
88                    <p>
89                      The sequence we wish to investigate.
90                    </p>
91                  </td>
92</tr>
93<tr>
94<td>
95                    <p>
96                      <code class="computeroutput"><span class="identifier">Key</span></code>
97                    </p>
98                  </td>
99<td>
100                    <p>
101                      Any type
102                    </p>
103                  </td>
104<td>
105                    <p>
106                      The queried key.
107                    </p>
108                  </td>
109</tr>
110</tbody>
111</table></div>
112<h6>
113<a name="fusion.sequence.intrinsic.functions.has_key.h3"></a>
114            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.expression_semantics"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.expression_semantics">Expression
115            Semantics</a>
116          </h6>
117<pre class="programlisting"><span class="identifier">has_key</span><span class="special">&lt;</span><span class="identifier">Key</span><span class="special">&gt;(</span><span class="identifier">seq</span><span class="special">);</span>
118</pre>
119<p>
120            <span class="bold"><strong>Return type</strong></span>: Convertible to <code class="computeroutput"><span class="keyword">bool</span></code>.
121          </p>
122<p>
123            <span class="bold"><strong>Semantics</strong></span>: Evaluates to <code class="computeroutput"><span class="keyword">true</span></code> if the sequence contains an element
124            associated with Key, else, evaluates to <code class="computeroutput"><span class="keyword">false</span></code>.
125          </p>
126<h6>
127<a name="fusion.sequence.intrinsic.functions.has_key.h4"></a>
128            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.header"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.header">Header</a>
129          </h6>
130<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">intrinsic</span><span class="special">/</span><span class="identifier">has_key</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
131<span class="preprocessor">#include</span> <span class="special">&lt;</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">has_key</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
132</pre>
133<h6>
134<a name="fusion.sequence.intrinsic.functions.has_key.h5"></a>
135            <span class="phrase"><a name="fusion.sequence.intrinsic.functions.has_key.example"></a></span><a class="link" href="has_key.html#fusion.sequence.intrinsic.functions.has_key.example">Example</a>
136          </h6>
137<pre class="programlisting"><a class="link" href="../../../container/set.html" title="set"><code class="computeroutput"><span class="identifier">set</span></code></a><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">bool</span><span class="special">&gt;</span> <span class="identifier">s</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="char">'x'</span><span class="special">,</span> <span class="keyword">true</span><span class="special">);</span>
138<span class="identifier">assert</span><span class="special">(</span><span class="identifier">has_key</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;(</span><span class="identifier">s</span><span class="special">)</span> <span class="special">==</span> <span class="keyword">true</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="at_c.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../functions.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="at_key.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
153</div>
154</body>
155</html>
156