Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/mpl/doc/refmanual/extensible-associative.html @ 45

Last change on this file since 45 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 11.1 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4<!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost -->
5<!-- Software License, Version 1.0. (See accompanying -->
6<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
7<head>
8<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9<meta name="generator" content="Docutils 0.3.6: http://docutils.sourceforge.net/" />
10<title>The MPL Reference Manual: Extensible Associative Sequence</title>
11<link rel="stylesheet" href="../style.css" type="text/css" />
12</head>
13<body class="docframe refmanual">
14<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./associative-sequence.html" class="navigation-link">Prev</a>&nbsp;<a href="./integral-sequence-wrapper.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./associative-sequence.html" class="navigation-link">Back</a>&nbsp;<a href="./integral-sequence-wrapper.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./concepts.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
15<td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./sequences.html" class="navigation-link">Sequences</a> / <a href="./concepts.html" class="navigation-link">Concepts</a> / <a href="./extensible-associative.html" class="navigation-link">Extensible Associative Sequence</a></td>
16</tr></table><div class="header-separator"></div>
17<div class="section" id="extensible-associative">
18<h1><a class="toc-backref" href="./concepts.html#id331" name="extensible-associative">Extensible Associative Sequence</a></h1>
19<div class="section" id="concepts-extensible-description">
20<h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
21<p>An <a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a> is an <a class="reference" href="./associative-sequence.html">Associative Sequence</a> that supports
22insertion and removal of elements. In contrast to <a class="reference" href="./extensible-sequence.html">Extensible Sequence</a>,
23<a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a> does not provide a mechanism for
24inserting an element at a specific position.</p>
25</div>
26<div class="section" id="concepts-extensible-expression-requirements">
27<h3><a class="subsection-title" href="#expression-requirements" name="expression-requirements">Expression requirements</a></h3>
28<p>In the following table and subsequent specifications, <tt class="literal"><span class="pre">s</span></tt> is an <a class="reference" href="./associative-sequence.html">Associative Sequence</a>,
29<tt class="literal"><span class="pre">pos</span></tt> is an iterator into <tt class="literal"><span class="pre">s</span></tt>, and <tt class="literal"><span class="pre">x</span></tt> and <tt class="literal"><span class="pre">k</span></tt> are arbitrary types.</p>
30<p>In addition to the <a class="reference" href="./associative-sequence.html">Associative Sequence</a> requirements, the following must be met:</p>
31<table border="1" class="table">
32<colgroup>
33<col width="32%" />
34<col width="40%" />
35<col width="28%" />
36</colgroup>
37<thead valign="bottom">
38<tr><th>Expression</th>
39<th>Type</th>
40<th>Complexity</th>
41</tr>
42</thead>
43<tbody valign="top">
44<tr><td><tt class="literal"><span class="pre"><a href="./insert.html" class="identifier">insert</a>&lt;s,x&gt;::type</span></tt></td>
45<td><a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a></td>
46<td>Amortized constant time</td>
47</tr>
48<tr><td><tt class="literal"><span class="pre"><a href="./insert.html" class="identifier">insert</a>&lt;s,pos,x&gt;::type</span></tt></td>
49<td><a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a></td>
50<td>Amortized constant time</td>
51</tr>
52<tr><td><tt class="literal"><span class="pre"><a href="./erase-key.html" class="identifier">erase_key</a>&lt;s,k&gt;::type</span></tt></td>
53<td><a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a></td>
54<td>Amortized constant time</td>
55</tr>
56<tr><td><tt class="literal"><span class="pre"><a href="./erase.html" class="identifier">erase</a>&lt;s,pos&gt;::type</span></tt></td>
57<td><a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a></td>
58<td>Amortized constant time</td>
59</tr>
60<tr><td><tt class="literal"><span class="pre"><a href="./clear.html" class="identifier">clear</a>&lt;s&gt;::type</span></tt></td>
61<td><a class="reference" href="./extensible-associative.html">Extensible Associative Sequence</a></td>
62<td>Amortized constant time</td>
63</tr>
64</tbody>
65</table>
66</div>
67<div class="section" id="concepts-extensible-expression-semantics">
68<h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
69<p>The semantics of an expression are defined only
70where they differ from, or are not defined in <a class="reference" href="./associative-sequence.html">Associative Sequence</a>.</p>
71<table border="1" class="table">
72<colgroup>
73<col width="32%" />
74<col width="68%" />
75</colgroup>
76<thead valign="bottom">
77<tr><th>Expression</th>
78<th>Semantics</th>
79</tr>
80</thead>
81<tbody valign="top">
82<tr><td><tt class="literal"><span class="pre"><a href="./insert.html" class="identifier">insert</a>&lt;s,x&gt;::type</span></tt></td>
83<td><p class="first">Inserts <tt class="literal"><span class="pre">x</span></tt> into <tt class="literal"><span class="pre">s</span></tt>; the resulting sequence <tt class="literal"><span class="pre">r</span></tt> is
84equivalent to <tt class="literal"><span class="pre">s</span></tt> except that</p>
85<pre class="literal-block">
86<a href="./at.html" class="identifier">at</a>&lt; r, <a href="./key-type.html" class="identifier">key_type</a>&lt;s,x&gt;::type &gt;::type
87</pre>
88<p class="last">is identical to <tt class="literal"><span class="pre"><a href="./value-type.html" class="identifier">value_type</a>&lt;s,x&gt;::type</span></tt>; see <a class="refentry reference" href="./insert.html"><tt class="refentry literal"><span class="pre">insert</span></tt></a>.</p>
89</td>
90</tr>
91<tr><td><tt class="literal"><span class="pre"><a href="./insert.html" class="identifier">insert</a>&lt;s,pos,x&gt;::type</span></tt></td>
92<td>Equivalent to <tt class="literal"><span class="pre"><a href="./insert.html" class="identifier">insert</a>&lt;s,x&gt;::type</span></tt>; <tt class="literal"><span class="pre">pos</span></tt> is ignored;
93see <a class="refentry reference" href="./insert.html"><tt class="refentry literal"><span class="pre">insert</span></tt></a>.</td>
94</tr>
95<tr><td><tt class="literal"><span class="pre"><a href="./erase-key.html" class="identifier">erase_key</a>&lt;s,k&gt;::type</span></tt></td>
96<td>Erases elements in <tt class="literal"><span class="pre">s</span></tt> associated with the key <tt class="literal"><span class="pre">k</span></tt>;
97the resulting sequence <tt class="literal"><span class="pre">r</span></tt> is equivalent to <tt class="literal"><span class="pre">s</span></tt> except
98that <tt class="literal"><span class="pre"><a href="./has-key.html" class="identifier">has_key</a>&lt;r,k&gt;::value</span> <span class="pre">==</span> <span class="pre">false</span></tt>; see <a class="refentry reference" href="./erase-key.html"><tt class="refentry literal"><span class="pre">erase_key</span></tt></a>.</td>
99</tr>
100<tr><td><tt class="literal"><span class="pre"><a href="./erase.html" class="identifier">erase</a>&lt;s,pos&gt;::type</span></tt></td>
101<td>Erases the element at a specific position; equivalent to
102<tt class="literal"><span class="pre"><a href="./erase-key.html" class="identifier">erase_key</a>&lt;s,</span> <span class="pre"><a href="./deref.html" class="identifier">deref</a>&lt;pos&gt;::type</span> <span class="pre">&gt;::type</span></tt>; see <a class="refentry reference" href="./erase.html"><tt class="refentry literal"><span class="pre">erase</span></tt></a>.</td>
103</tr>
104<tr><td><tt class="literal"><span class="pre"><a href="./clear.html" class="identifier">clear</a>&lt;s&gt;::type</span></tt></td>
105<td>An empty sequence concept-identical to <tt class="literal"><span class="pre">s</span></tt>; see
106<a class="refentry reference" href="./clear.html"><tt class="refentry literal"><span class="pre">clear</span></tt></a>.</td>
107</tr>
108</tbody>
109</table>
110<!-- Invariants
111- - - - - - - - - -
112
113For any extensible associative sequence ``s`` the following invariants always hold:  -->
114</div>
115<div class="section" id="concepts-extensible-models">
116<h3><a class="subsection-title" href="#models" name="models">Models</a></h3>
117<ul class="simple">
118<li><a class="refentry reference" href="./set.html"><tt class="refentry literal"><span class="pre">set</span></tt></a></li>
119<li><a class="refentry reference" href="./map.html"><tt class="refentry literal"><span class="pre">map</span></tt></a></li>
120</ul>
121<!-- * |multiset| -->
122</div>
123<div class="section" id="concepts-extensible-see-also">
124<h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
125<p><a class="reference" href="./sequences.html">Sequences</a>, <a class="reference" href="./associative-sequence.html">Associative Sequence</a>, <a class="refentry reference" href="./insert.html"><tt class="refentry literal"><span class="pre">insert</span></tt></a>, <a class="refentry reference" href="./erase.html"><tt class="refentry literal"><span class="pre">erase</span></tt></a>, <a class="refentry reference" href="./clear.html"><tt class="refentry literal"><span class="pre">clear</span></tt></a></p>
126<!-- modtime: November 13, 2004 00:49:10 +0000 -->
127<!-- Sequences/Concepts//Integral Sequence Wrapper |90 -->
128</div>
129</div>
130
131<div class="footer-separator"></div>
132<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./associative-sequence.html" class="navigation-link">Prev</a>&nbsp;<a href="./integral-sequence-wrapper.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./associative-sequence.html" class="navigation-link">Back</a>&nbsp;<a href="./integral-sequence-wrapper.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./concepts.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
133</tr></table></body>
134</html>
Note: See TracBrowser for help on using the repository browser.