3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=US-ASCII">
4 <title>Key Types
</title>
5 <link rel=
"stylesheet" href=
"../../../../../../doc/src/boostbook.css" type=
"text/css">
6 <meta name=
"generator" content=
"DocBook XSL Stylesheets V1.74.0">
7 <link rel=
"home" href=
"../../index.html" title=
"Chapter 1. Boost.Icl">
8 <link rel=
"up" href=
"../function_reference.html" title=
"Function Reference">
9 <link rel=
"prev" href=
"segmentational_fineness.html" title=
"Segmentational Fineness">
10 <link rel=
"next" href=
"construct__copy__destruct.html" title=
"Construct, copy, destruct">
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=
"../../../../../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>
22 <div class=
"spirit-nav">
23 <a accesskey=
"p" href=
"segmentational_fineness.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../function_reference.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=
"construct__copy__destruct.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>
25 <div class=
"section boost_icl_function_reference_key_types" lang=
"en">
26 <div class=
"titlepage"><div><div><h3 class=
"title">
27 <a name=
"boost_icl.function_reference.key_types"></a><a class=
"link" href=
"key_types.html" title=
"Key Types">Key Types
</a>
28 </h3></div></div></div>
30 In an
<span class=
"bold"><strong>stl
</strong></span> map
<code class=
"computeroutput"><span class=
"identifier">map
</span><span class=
"special"><</span><span class=
"identifier">K
</span><span class=
"special">,
</span><span class=
"identifier">D
</span><span class=
"special">></span></code> the
31 first parameter type of the map template
<code class=
"computeroutput"><span class=
"identifier">K
</span></code>
32 is called
<code class=
"computeroutput"><span class=
"identifier">key_type
</span></code>. It allows
33 to select key-value pairs pairs via
<code class=
"computeroutput"><span class=
"identifier">find
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">K
</span><span class=
"special">&)
</span></code> and to remove key-value pairs using
34 <code class=
"computeroutput"><span class=
"identifier">erase
</span><span class=
"special">(
</span><span class=
"keyword">const
</span> <span class=
"identifier">K
</span><span class=
"special">&)
</span></code>. For icl Maps we have generalized key
35 types to a larger set of types. Not only the
<code class=
"computeroutput"><span class=
"identifier">key_type
</span></code>
36 (
<code class=
"computeroutput"><span class=
"identifier">domain_type
</span></code>) but also an
37 interval type and a set type can be
<span class=
"emphasis"><em><span class=
"bold"><strong>key types
</strong></span></em></span>,
38 that allow for
<span class=
"emphasis"><em><span class=
"bold"><strong>selection
</strong></span></em></span>
39 and
<span class=
"emphasis"><em><span class=
"bold"><strong>removal
</strong></span></em></span> of map
40 elements segments and submaps.
43 <a name=
"id1135608"></a><p class=
"title"><b>Table
 1.16.
 Selection of elements, segments and sub maps using
45 <div class=
"table-contents"><table class=
"table" summary=
"Selection of elements, segments and sub maps using
59 <a class=
"link" href=
"../interface/function_synopsis.html#interval_map_types"><span class=
"bold"><strong>M
</strong></span></a>:
60 <code class=
"computeroutput"><a class=
"link" href=
"../../boost/icl/interval_map.html" title=
"Class template interval_map">interval_maps
</a></code>
65 <a class=
"link" href=
"../interface/function_synopsis.html#itl_map_type"><span class=
"bold"><strong>m
</strong></span></a>:
74 <a class=
"link" href=
"../interface/function_synopsis.html#element_type"><span class=
"bold"><strong>e
</strong></span></a>:
75 <code class=
"computeroutput"><span class=
"identifier">domain_type
</span></code>
92 <a class=
"link" href=
"../interface/function_synopsis.html#interval_type"><span class=
"bold"><strong>i
</strong></span></a>:
93 <code class=
"computeroutput"><span class=
"identifier">interval_type
</span></code>
109 <a class=
"link" href=
"../interface/function_synopsis.html#interval_set_types"><span class=
"bold"><strong>S
</strong></span></a>:
110 <code class=
"computeroutput"><a class=
"link" href=
"../../boost/icl/interval_set.html" title=
"Class template interval_set">interval_sets
</a></code>
126 <a class=
"link" href=
"../interface/function_synopsis.html#itl_set_type"><span class=
"bold"><strong>s
</strong></span></a>:
127 <a href=
"http://www.cplusplus.com/reference/stl/set/" target=
"_top"><code class=
"computeroutput"><span class=
"identifier">std
</span><span class=
"special">::
</span><span class=
"identifier">set
</span></code> </a>
143 <br class=
"table-break"><p>
144 <a class=
"link" href=
"subtraction.html" title=
"Subtraction"><span class=
"emphasis"><em><span class=
"bold"><strong>Subtraction
</strong></span></em></span></a>,
<a class=
"link" href=
"erasure.html" title=
"Erasure"><span class=
"emphasis"><em><span class=
"bold"><strong>erasure
</strong></span></em></span></a>,
<a class=
"link" href=
"intersection.html" title=
"Intersection"><span class=
"emphasis"><em><span class=
"bold"><strong>intersection
</strong></span></em></span></a>
147 and
<a class=
"link" href=
"containedness.html" title=
"Containedness"><span class=
"emphasis"><em><span class=
"bold"><strong>containedness
</strong></span></em></span></a> predicates can be
148 used with those kinds of key types. For instance, the overload table for
154 <pre class=
"programlisting"><span class=
"comment">// overload tables for
155 </span><span class=
"identifier">T
</span><span class=
"special">&</span> <span class=
"keyword">operator
</span> <span class=
"special">&=
</span> <span class=
"special">(
</span><span class=
"identifier">T
</span><span class=
"special">&,
</span> <span class=
"keyword">const
</span> <span class=
"identifier">P
</span><span class=
"special">&)
</span>
157 <span class=
"identifier">element
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span> <span class=
"identifier">interval
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span>
158 <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">b
</span> <span class=
"identifier">s
</span> <span class=
"identifier">m
</span> <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">i
</span> <span class=
"identifier">b
</span> <span class=
"identifier">p
</span> <span class=
"identifier">S
</span> <span class=
"identifier">M
</span>
159 <span class=
"special">---+--------
</span> <span class=
"special">---+------------
</span>
160 <span class=
"identifier">s
</span> <span class=
"special">|
</span> <span class=
"identifier">s
</span> <span class=
"identifier">s
</span> <span class=
"identifier">S
</span> <span class=
"special">|
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span>
161 <span class=
"identifier">m
</span> <span class=
"special">|
</span> <span class=
"identifier">m
</span> <span class=
"identifier">m
</span> <span class=
"identifier">m
</span> <span class=
"identifier">m
</span> <span class=
"identifier">M
</span> <span class=
"special">|
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span>
166 has a part that that allows for selection by key objects
171 <pre class=
"programlisting"><span class=
"identifier">element
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span> <span class=
"identifier">interval
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span>
172 <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">b
</span> <span class=
"identifier">s
</span> <span class=
"identifier">m
</span> <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">i
</span> <span class=
"identifier">b
</span> <span class=
"identifier">p
</span> <span class=
"identifier">S
</span> <span class=
"identifier">M
</span>
173 <span class=
"special">---+--------
</span> <span class=
"special">---+------------
</span>
174 <span class=
"identifier">s
</span> <span class=
"special">|
</span> <span class=
"identifier">s
</span> <span class=
"identifier">s
</span> <span class=
"identifier">S
</span> <span class=
"special">|
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span>
175 <span class=
"identifier">m
</span> <span class=
"special">|
</span> <span class=
"identifier">m
</span> <span class=
"identifier">m
</span> <span class=
"identifier">M
</span> <span class=
"special">|
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span>
180 and another part that provides overloads for generalized intersection:
185 <pre class=
"programlisting"><span class=
"identifier">element
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span> <span class=
"identifier">interval
</span> <span class=
"identifier">containers
</span><span class=
"special">:
</span>
186 <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">b
</span> <span class=
"identifier">s
</span> <span class=
"identifier">m
</span> <span class=
"special">&=
</span> <span class=
"special">|
</span> <span class=
"identifier">e
</span> <span class=
"identifier">i
</span> <span class=
"identifier">b
</span> <span class=
"identifier">p
</span> <span class=
"identifier">S
</span> <span class=
"identifier">M
</span>
187 <span class=
"special">---+--------
</span> <span class=
"special">---+------------
</span>
188 <span class=
"identifier">s
</span> <span class=
"special">|
</span> <span class=
"identifier">s
</span> <span class=
"identifier">s
</span> <span class=
"identifier">S
</span> <span class=
"special">|
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span> <span class=
"identifier">S
</span>
189 <span class=
"identifier">m
</span> <span class=
"special">|
</span> <span class=
"identifier">m
</span> <span class=
"identifier">m
</span> <span class=
"identifier">M
</span> <span class=
"special">|
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span> <span class=
"identifier">M
</span>
194 For
<code class=
"computeroutput"><span class=
"identifier">Sets
</span></code>, the
<span class=
"emphasis"><em><span class=
"bold"><strong>key types
</strong></span></em></span> defined for maps are identical
195 with the set types themselves. So the distinction between the function groups
196 <span class=
"emphasis"><em><span class=
"bold"><strong>selection by key
</strong></span></em></span> and
197 <span class=
"emphasis"><em><span class=
"bold"><strong>generalized intersection
</strong></span></em></span>
198 fall together in the well known
<span class=
"emphasis"><em><span class=
"bold"><strong>set intersection
</strong></span></em></span>.
201 <table xmlns:
rev=
"http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width=
"100%"><tr>
202 <td align=
"left"></td>
203 <td align=
"right"><div class=
"copyright-footer">Copyright
© 2007 -
2010 Joachim Faulhaber
<br>Copyright
© 1999 -
2006 Cortex Software GmbH
<p>
204 Distributed under the Boost Software License, Version
1.0. (See accompanying
205 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>)
210 <div class=
"spirit-nav">
211 <a accesskey=
"p" href=
"segmentational_fineness.html"><img src=
"../../../../../../doc/src/images/prev.png" alt=
"Prev"></a><a accesskey=
"u" href=
"../function_reference.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=
"construct__copy__destruct.html"><img src=
"../../../../../../doc/src/images/next.png" alt=
"Next"></a>