• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Bidirectional Sequence</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="../concepts.html" title="Concepts">
9<link rel="prev" href="forward_sequence.html" title="Forward Sequence">
10<link rel="next" href="random_access_sequence.html" title="Random Access Sequence">
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="forward_sequence.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.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="random_access_sequence.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h4 class="title">
27<a name="fusion.sequence.concepts.bidirectional_sequence"></a><a class="link" href="bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional
28        Sequence</a>
29</h4></div></div></div>
30<h6>
31<a name="fusion.sequence.concepts.bidirectional_sequence.h0"></a>
32          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.description"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.description">Description</a>
33        </h6>
34<p>
35          A Bidirectional Sequence is a <a class="link" href="forward_sequence.html" title="Forward Sequence">Forward
36          Sequence</a> whose iterators model <a class="link" href="../../iterator/concepts/bidirectional_iterator.html" title="Bidirectional Iterator">Bidirectional
37          Iterator</a>.
38        </p>
39<h6>
40<a name="fusion.sequence.concepts.bidirectional_sequence.h1"></a>
41          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.refinement_of"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.refinement_of">Refinement
42          of</a>
43        </h6>
44<p>
45          <a class="link" href="forward_sequence.html" title="Forward Sequence">Forward Sequence</a>
46        </p>
47<div class="variablelist">
48<p class="title"><b>Notation</b></p>
49<dl class="variablelist">
50<dt><span class="term"><code class="computeroutput"><span class="identifier">s</span></code></span></dt>
51<dd><p>
52                A Bidirectional Sequence
53              </p></dd>
54<dt><span class="term"><code class="computeroutput"><span class="identifier">S</span></code></span></dt>
55<dd><p>
56                A Bidirectional Sequence type
57              </p></dd>
58<dt><span class="term"><code class="computeroutput"><span class="identifier">o</span></code></span></dt>
59<dd><p>
60                An arbitrary object
61              </p></dd>
62<dt><span class="term"><code class="computeroutput"><span class="identifier">e</span></code></span></dt>
63<dd><p>
64                A Sequence element
65              </p></dd>
66</dl>
67</div>
68<h6>
69<a name="fusion.sequence.concepts.bidirectional_sequence.h2"></a>
70          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.valid_expressions"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.valid_expressions">Valid
71          Expressions</a>
72        </h6>
73<p>
74          In addition to the requirements defined in <a class="link" href="forward_sequence.html" title="Forward Sequence">Forward
75          Sequence</a>, for any Bidirectional Sequence the following must be met:
76        </p>
77<div class="informaltable"><table class="table">
78<colgroup>
79<col>
80<col>
81<col>
82<col>
83</colgroup>
84<thead><tr>
85<th>
86                  <p>
87                    Expression
88                  </p>
89                </th>
90<th>
91                  <p>
92                    Return type
93                  </p>
94                </th>
95<th>
96                  <p>
97                    Type Requirements
98                  </p>
99                </th>
100<th>
101                  <p>
102                    Runtime Complexity
103                  </p>
104                </th>
105</tr></thead>
106<tbody>
107<tr>
108<td>
109                  <p>
110                    <code class="computeroutput"><a class="link" href="../intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></code>
111                  </p>
112                </td>
113<td>
114                  <p>
115                    <a class="link" href="../../iterator/concepts/bidirectional_iterator.html" title="Bidirectional Iterator">Bidirectional
116                    Iterator</a>
117                  </p>
118                </td>
119<td>
120                </td>
121<td>
122                  <p>
123                    Constant
124                  </p>
125                </td>
126</tr>
127<tr>
128<td>
129                  <p>
130                    <code class="computeroutput"><a class="link" href="../intrinsic/functions/end.html" title="end"><code class="computeroutput"><span class="identifier">end</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></code>
131                  </p>
132                </td>
133<td>
134                  <p>
135                    <a class="link" href="../../iterator/concepts/bidirectional_iterator.html" title="Bidirectional Iterator">Bidirectional
136                    Iterator</a>
137                  </p>
138                </td>
139<td>
140                </td>
141<td>
142                  <p>
143                    Constant
144                  </p>
145                </td>
146</tr>
147<tr>
148<td>
149                  <p>
150                    <code class="computeroutput"><a class="link" href="../intrinsic/functions/back.html" title="back"><code class="computeroutput"><span class="identifier">back</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></code>
151                  </p>
152                </td>
153<td>
154                  <p>
155                    Any type
156                  </p>
157                </td>
158<td>
159                </td>
160<td>
161                  <p>
162                    Constant
163                  </p>
164                </td>
165</tr>
166<tr>
167<td>
168                  <p>
169                    <code class="computeroutput"><a class="link" href="../intrinsic/functions/back.html" title="back"><code class="computeroutput"><span class="identifier">back</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">)</span>
170                    <span class="special">=</span> <span class="identifier">o</span></code>
171                  </p>
172                </td>
173<td>
174                  <p>
175                    Any type
176                  </p>
177                </td>
178<td>
179                  <p>
180                    <code class="computeroutput"><span class="identifier">s</span></code> is mutable
181                    and <code class="computeroutput"><span class="identifier">e</span> <span class="special">=</span>
182                    <span class="identifier">o</span></code>, where <code class="computeroutput"><span class="identifier">e</span></code> is the first element in the
183                    sequence, is a valid expression.
184                  </p>
185                </td>
186<td>
187                  <p>
188                    Constant
189                  </p>
190                </td>
191</tr>
192</tbody>
193</table></div>
194<h6>
195<a name="fusion.sequence.concepts.bidirectional_sequence.h3"></a>
196          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.result_type_expressions"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.result_type_expressions">Result
197          Type Expressions</a>
198        </h6>
199<div class="informaltable"><table class="table">
200<colgroup>
201<col>
202<col>
203</colgroup>
204<thead><tr>
205<th>
206                  <p>
207                    Expression
208                  </p>
209                </th>
210<th>
211                  <p>
212                    Compile Time Complexity
213                  </p>
214                </th>
215</tr></thead>
216<tbody>
217<tr>
218<td>
219                  <p>
220                    <code class="computeroutput"><a class="link" href="../intrinsic/metafunctions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">begin</span></code></a><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
221                  </p>
222                </td>
223<td>
224                  <p>
225                    Amortized constant time
226                  </p>
227                </td>
228</tr>
229<tr>
230<td>
231                  <p>
232                    <code class="computeroutput"><a class="link" href="../intrinsic/metafunctions/end.html" title="end"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">end</span></code></a><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
233                  </p>
234                </td>
235<td>
236                  <p>
237                    Amortized constant time
238                  </p>
239                </td>
240</tr>
241<tr>
242<td>
243                  <p>
244                    <code class="computeroutput"><a class="link" href="../intrinsic/metafunctions/back.html" title="back"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">back</span></code></a><span class="special">&lt;</span><span class="identifier">S</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
245                  </p>
246                </td>
247<td>
248                  <p>
249                    Amortized constant time
250                  </p>
251                </td>
252</tr>
253</tbody>
254</table></div>
255<h6>
256<a name="fusion.sequence.concepts.bidirectional_sequence.h4"></a>
257          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.expression_semantics"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.expression_semantics">Expression
258          Semantics</a>
259        </h6>
260<p>
261          The semantics of an expression are defined only where they differ from,
262          or are not defined in <a class="link" href="forward_sequence.html" title="Forward Sequence">Forward
263          Sequence</a>.
264        </p>
265<div class="informaltable"><table class="table">
266<colgroup>
267<col>
268<col>
269</colgroup>
270<thead><tr>
271<th>
272                  <p>
273                    Expression
274                  </p>
275                </th>
276<th>
277                  <p>
278                    Semantics
279                  </p>
280                </th>
281</tr></thead>
282<tbody><tr>
283<td>
284                  <p>
285                    <code class="computeroutput"><a class="link" href="../intrinsic/functions/back.html" title="back"><code class="computeroutput"><span class="identifier">back</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></code>
286                  </p>
287                </td>
288<td>
289                  <p>
290                    The last element in the sequence; see <a class="link" href="../intrinsic/functions/back.html" title="back"><code class="computeroutput"><span class="identifier">back</span></code></a>.
291                  </p>
292                </td>
293</tr></tbody>
294</table></div>
295<h6>
296<a name="fusion.sequence.concepts.bidirectional_sequence.h5"></a>
297          <span class="phrase"><a name="fusion.sequence.concepts.bidirectional_sequence.models"></a></span><a class="link" href="bidirectional_sequence.html#fusion.sequence.concepts.bidirectional_sequence.models">Models</a>
298        </h6>
299<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
300<li class="listitem">
301              <a class="link" href="../../adapted/std__pair.html" title="std::pair"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code></a>
302            </li>
303<li class="listitem">
304              <a class="link" href="../../adapted/boost__array.html" title="boost::array"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span></code></a>
305            </li>
306<li class="listitem">
307              <a class="link" href="../../container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a>
308            </li>
309<li class="listitem">
310              <a class="link" href="../../container/map.html" title="map"><code class="computeroutput"><span class="identifier">map</span></code></a>
311            </li>
312<li class="listitem">
313              <a class="link" href="../../view/reverse_view.html" title="reverse_view"><code class="computeroutput"><span class="identifier">reverse_view</span></code></a>
314            </li>
315<li class="listitem">
316              <a class="link" href="../../view/single_view.html" title="single_view"><code class="computeroutput"><span class="identifier">single_view</span></code></a>
317            </li>
318<li class="listitem">
319              <a class="link" href="../../view/iterator_range.html" title="iterator_range"><code class="computeroutput"><span class="identifier">iterator_range</span></code></a>
320              (where adapted sequence is a Bidirectional Sequence)
321            </li>
322<li class="listitem">
323              <a class="link" href="../../view/transform_view.html" title="transform_view"><code class="computeroutput"><span class="identifier">transform_view</span></code></a>
324              (where adapted sequence is a Bidirectional Sequence)
325            </li>
326<li class="listitem">
327              <a class="link" href="../../view/zip_view.html" title="zip_view"><code class="computeroutput"><span class="identifier">zip_view</span></code></a>
328              (where adapted sequences are models of Bidirectional Sequence)
329            </li>
330</ul></div>
331</div>
332<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
333<td align="left"></td>
334<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman,
335      Dan Marsden, Tobias Schwinger<p>
336        Distributed under the Boost Software License, Version 1.0. (See accompanying
337        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>)
338      </p>
339</div></td>
340</tr></table>
341<hr>
342<div class="spirit-nav">
343<a accesskey="p" href="forward_sequence.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.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="random_access_sequence.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
344</div>
345</body>
346</html>
347