1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>reverse</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="remove_if.html" title="remove_if"> 10<link rel="next" href="clear.html" title="clear"> 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="remove_if.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="clear.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.algorithm.transformation.functions.reverse"></a><a class="link" href="reverse.html" title="reverse">reverse</a> 28</h5></div></div></div> 29<h6> 30<a name="fusion.algorithm.transformation.functions.reverse.h0"></a> 31 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.description"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.description">Description</a> 32 </h6> 33<p> 34 Returns a new sequence with the elements of the original in reverse order. 35 </p> 36<h6> 37<a name="fusion.algorithm.transformation.functions.reverse.h1"></a> 38 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.synopsis"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.synopsis">Synopsis</a> 39 </h6> 40<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> 41 <span class="keyword">typename</span> <span class="identifier">Sequence</span> 42 <span class="special">></span> 43<span class="keyword">typename</span> <a class="link" href="../metafunctions/reverse.html" title="reverse"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">reverse</span></code></a><span class="special"><</span><span class="identifier">Sequence</span> <span class="keyword">const</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">reverse</span><span class="special">(</span><span class="identifier">Sequence</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">seq</span><span class="special">);</span> 44</pre> 45<div class="table"> 46<a name="fusion.algorithm.transformation.functions.reverse.t0"></a><p class="title"><b>Table 1.74. Parameters</b></p> 47<div class="table-contents"><table class="table" summary="Parameters"> 48<colgroup> 49<col> 50<col> 51<col> 52</colgroup> 53<thead><tr> 54<th> 55 <p> 56 Parameter 57 </p> 58 </th> 59<th> 60 <p> 61 Requirement 62 </p> 63 </th> 64<th> 65 <p> 66 Description 67 </p> 68 </th> 69</tr></thead> 70<tbody><tr> 71<td> 72 <p> 73 <code class="computeroutput"><span class="identifier">seq</span></code> 74 </p> 75 </td> 76<td> 77 <p> 78 A model of <a class="link" href="../../../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 79 Sequence</a> 80 </p> 81 </td> 82<td> 83 <p> 84 Operation's argument 85 </p> 86 </td> 87</tr></tbody> 88</table></div> 89</div> 90<br class="table-break"><h6> 91<a name="fusion.algorithm.transformation.functions.reverse.h2"></a> 92 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.expression_semantics"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.expression_semantics">Expression 93 Semantics</a> 94 </h6> 95<pre class="programlisting"><a class="link" href="reverse.html" title="reverse"><code class="computeroutput"><span class="identifier">reverse</span></code></a><span class="special">(</span><span class="identifier">seq</span><span class="special">);</span> 96</pre> 97<p> 98 <span class="bold"><strong>Return type</strong></span>: 99 </p> 100<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 101<li class="listitem"> 102 A model of <a class="link" href="../../../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 103 Sequence</a> if <code class="computeroutput"><span class="identifier">seq</span></code> 104 is a <a class="link" href="../../../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 105 Sequence</a> else, <a class="link" href="../../../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random 106 Access Sequence</a> if <code class="computeroutput"><span class="identifier">seq</span></code> 107 is a <a class="link" href="../../../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random 108 Access Sequence</a>. 109 </li> 110<li class="listitem"> 111 A model of <a class="link" href="../../../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative 112 Sequence</a> if <code class="computeroutput"><span class="identifier">seq</span></code> 113 implements the <a class="link" href="../../../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative 114 Sequence</a> model. 115 </li> 116</ul></div> 117<p> 118 <span class="bold"><strong>Semantics</strong></span>: Returns a new sequence containing 119 all the elements of <code class="computeroutput"><span class="identifier">seq</span></code> 120 in reverse order. 121 </p> 122<h6> 123<a name="fusion.algorithm.transformation.functions.reverse.h3"></a> 124 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.complexity"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.complexity">Complexity</a> 125 </h6> 126<p> 127 Constant. Returns a view which is lazily evaluated. 128 </p> 129<h6> 130<a name="fusion.algorithm.transformation.functions.reverse.h4"></a> 131 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.header"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.header">Header</a> 132 </h6> 133<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">algorithm</span><span class="special">/</span><span class="identifier">transformation</span><span class="special">/</span><span class="identifier">reverse</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 134<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</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 135</pre> 136<h6> 137<a name="fusion.algorithm.transformation.functions.reverse.h5"></a> 138 <span class="phrase"><a name="fusion.algorithm.transformation.functions.reverse.example"></a></span><a class="link" href="reverse.html#fusion.algorithm.transformation.functions.reverse.example">Example</a> 139 </h6> 140<pre class="programlisting"><span class="identifier">assert</span><span class="special">(</span><a class="link" href="reverse.html" title="reverse"><code class="computeroutput"><span class="identifier">reverse</span></code></a><span class="special">(</span><a class="link" href="../../../container/generation/functions/make_vector.html" title="make_vector"><code class="computeroutput"><span class="identifier">make_vector</span></code></a><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">))</span> <span class="special">==</span> <a class="link" href="../../../container/generation/functions/make_vector.html" title="make_vector"><code class="computeroutput"><span class="identifier">make_vector</span></code></a><span class="special">(</span><span class="number">3</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">1</span><span class="special">));</span> 141</pre> 142</div> 143<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 144<td align="left"></td> 145<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 146 Dan Marsden, Tobias Schwinger<p> 147 Distributed under the Boost Software License, Version 1.0. (See accompanying 148 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>) 149 </p> 150</div></td> 151</tr></table> 152<hr> 153<div class="spirit-nav"> 154<a accesskey="p" href="remove_if.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="clear.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 155</div> 156</body> 157</html> 158