1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>reverse_view</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="../view.html" title="View"> 9<link rel="prev" href="transform_view.html" title="transform_view"> 10<link rel="next" href="nview.html" title="nview"> 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="transform_view.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../view.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="nview.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="fusion.view.reverse_view"></a><a class="link" href="reverse_view.html" title="reverse_view">reverse_view</a> 28</h3></div></div></div> 29<p> 30 <code class="computeroutput"><span class="identifier">reverse_view</span></code> presents a reversed 31 view of underlying sequence. The first element will be its last and the last 32 element will be its first. 33 </p> 34<h5> 35<a name="fusion.view.reverse_view.h0"></a> 36 <span class="phrase"><a name="fusion.view.reverse_view.header"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.header">Header</a> 37 </h5> 38<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">view</span><span class="special">/</span><span class="identifier">reverse_view</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 39<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">reverse_view</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 40</pre> 41<h5> 42<a name="fusion.view.reverse_view.h1"></a> 43 <span class="phrase"><a name="fusion.view.reverse_view.synopsis"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.synopsis">Synopsis</a> 44 </h5> 45<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Sequence</span><span class="special">></span> 46<span class="keyword">struct</span> <span class="identifier">reverse_view</span><span class="special">;</span> 47</pre> 48<h5> 49<a name="fusion.view.reverse_view.h2"></a> 50 <span class="phrase"><a name="fusion.view.reverse_view.template_parameters"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.template_parameters">Template 51 parameters</a> 52 </h5> 53<div class="informaltable"><table class="table"> 54<colgroup> 55<col> 56<col> 57<col> 58</colgroup> 59<thead><tr> 60<th> 61 <p> 62 Parameter 63 </p> 64 </th> 65<th> 66 <p> 67 Description 68 </p> 69 </th> 70<th> 71 <p> 72 Default 73 </p> 74 </th> 75</tr></thead> 76<tbody><tr> 77<td> 78 <p> 79 <code class="computeroutput"><span class="identifier">Sequence</span></code> 80 </p> 81 </td> 82<td> 83 <p> 84 A <a class="link" href="../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 85 Sequence</a> 86 </p> 87 </td> 88<td> 89 </td> 90</tr></tbody> 91</table></div> 92<h5> 93<a name="fusion.view.reverse_view.h3"></a> 94 <span class="phrase"><a name="fusion.view.reverse_view.model_of"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.model_of">Model 95 of</a> 96 </h5> 97<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 98<li class="listitem"> 99 A model of <a class="link" href="../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 100 Sequence</a> if <code class="computeroutput"><span class="identifier">Sequence</span></code> 101 is a <a class="link" href="../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 102 Sequence</a> else, <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random 103 Access Sequence</a> if <code class="computeroutput"><span class="identifier">Sequence</span></code> 104 is a <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random 105 Access Sequence</a>. 106 </li> 107<li class="listitem"> 108 <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative 109 Sequence</a> if <code class="computeroutput"><span class="identifier">Sequence</span></code> 110 implements the <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative 111 Sequence</a> model. 112 </li> 113</ul></div> 114<div class="variablelist"> 115<p class="title"><b>Notation</b></p> 116<dl class="variablelist"> 117<dt><span class="term"><code class="computeroutput"><span class="identifier">RV</span></code></span></dt> 118<dd><p> 119 A <code class="computeroutput"><span class="identifier">reverse_view</span></code> type 120 </p></dd> 121<dt><span class="term"><code class="computeroutput"><span class="identifier">s</span></code></span></dt> 122<dd><p> 123 An instance of <code class="computeroutput"><span class="identifier">Sequence</span></code> 124 </p></dd> 125<dt><span class="term"><code class="computeroutput"><span class="identifier">rv</span></code>, <code class="computeroutput"><span class="identifier">rv2</span></code></span></dt> 126<dd><p> 127 Instances of <code class="computeroutput"><span class="identifier">reverse_view</span></code> 128 </p></dd> 129</dl> 130</div> 131<h5> 132<a name="fusion.view.reverse_view.h4"></a> 133 <span class="phrase"><a name="fusion.view.reverse_view.expression_semantics"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.expression_semantics">Expression 134 Semantics</a> 135 </h5> 136<p> 137 Semantics of an expression is defined only where it differs from, or is not 138 defined in the implemented models. 139 </p> 140<div class="informaltable"><table class="table"> 141<colgroup> 142<col> 143<col> 144</colgroup> 145<thead><tr> 146<th> 147 <p> 148 Expression 149 </p> 150 </th> 151<th> 152 <p> 153 Semantics 154 </p> 155 </th> 156</tr></thead> 157<tbody> 158<tr> 159<td> 160 <p> 161 <code class="computeroutput"><span class="identifier">RV</span><span class="special">(</span><span class="identifier">s</span><span class="special">)</span></code> 162 </p> 163 </td> 164<td> 165 <p> 166 Creates a unary <code class="computeroutput"><span class="identifier">reverse_view</span></code> 167 given sequence, <code class="computeroutput"><span class="identifier">s</span></code>. 168 </p> 169 </td> 170</tr> 171<tr> 172<td> 173 <p> 174 <code class="computeroutput"><span class="identifier">RV</span><span class="special">(</span><span class="identifier">rv</span><span class="special">)</span></code> 175 </p> 176 </td> 177<td> 178 <p> 179 Copy constructs a <code class="computeroutput"><span class="identifier">reverse_view</span></code> 180 from another <code class="computeroutput"><span class="identifier">reverse_view</span></code>, 181 <code class="computeroutput"><span class="identifier">rv</span></code>. 182 </p> 183 </td> 184</tr> 185<tr> 186<td> 187 <p> 188 <code class="computeroutput"><span class="identifier">rv</span> <span class="special">=</span> 189 <span class="identifier">rv2</span></code> 190 </p> 191 </td> 192<td> 193 <p> 194 Assigns to a <code class="computeroutput"><span class="identifier">reverse_view</span></code>, 195 <code class="computeroutput"><span class="identifier">rv</span></code>, from another 196 <code class="computeroutput"><span class="identifier">reverse_view</span></code>, 197 <code class="computeroutput"><span class="identifier">rv2</span></code>. 198 </p> 199 </td> 200</tr> 201</tbody> 202</table></div> 203<h5> 204<a name="fusion.view.reverse_view.h5"></a> 205 <span class="phrase"><a name="fusion.view.reverse_view.example"></a></span><a class="link" href="reverse_view.html#fusion.view.reverse_view.example">Example</a> 206 </h5> 207<pre class="programlisting"><span class="keyword">typedef</span> <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">short</span><span class="special">,</span> <span class="keyword">double</span><span class="special">></span> <span class="identifier">vector_type</span><span class="special">;</span> 208<span class="identifier">vector_type</span> <span class="identifier">vec</span><span class="special">(</span><span class="number">2</span><span class="special">,</span> <span class="number">5</span><span class="special">,</span> <span class="number">3.3</span><span class="special">);</span> 209 210<span class="identifier">reverse_view</span><span class="special"><</span><span class="identifier">vector_type</span><span class="special">></span> <span class="identifier">reverse</span><span class="special">(</span><span class="identifier">vec</span><span class="special">);</span> 211<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">reverse</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> 212</pre> 213</div> 214<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 215<td align="left"></td> 216<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 217 Dan Marsden, Tobias Schwinger<p> 218 Distributed under the Boost Software License, Version 1.0. (See accompanying 219 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>) 220 </p> 221</div></td> 222</tr></table> 223<hr> 224<div class="spirit-nav"> 225<a accesskey="p" href="transform_view.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../view.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="nview.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 226</div> 227</body> 228</html> 229