1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>reverse_fold</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="../metafunctions.html" title="Metafunctions"> 9<link rel="prev" href="fold.html" title="fold"> 10<link rel="next" href="iter_fold.html" title="iter_fold"> 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="fold.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../metafunctions.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="iter_fold.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.iteration.metafunctions.reverse_fold"></a><a class="link" href="reverse_fold.html" title="reverse_fold">reverse_fold</a> 28</h5></div></div></div> 29<h6> 30<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.h0"></a> 31 <span class="phrase"><a name="fusion.algorithm.iteration.metafunctions.reverse_fold.description"></a></span><a class="link" href="reverse_fold.html#fusion.algorithm.iteration.metafunctions.reverse_fold.description">Description</a> 32 </h6> 33<p> 34 Returns the result type of <a class="link" href="../functions/reverse_fold.html" title="reverse_fold"><code class="computeroutput"><span class="identifier">reverse_fold</span></code></a>. 35 </p> 36<h6> 37<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.h1"></a> 38 <span class="phrase"><a name="fusion.algorithm.iteration.metafunctions.reverse_fold.synopsis"></a></span><a class="link" href="reverse_fold.html#fusion.algorithm.iteration.metafunctions.reverse_fold.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><span class="special">,</span> 42 <span class="keyword">typename</span> <span class="identifier">State</span><span class="special">,</span> 43 <span class="keyword">typename</span> <span class="identifier">F</span><span class="special">></span> 44<span class="keyword">struct</span> reverse_fold 45<span class="special">{</span> 46 <span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span> 47<span class="special">};</span> 48</pre> 49<div class="table"> 50<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.t0"></a><p class="title"><b>Table 1.47. Parameters</b></p> 51<div class="table-contents"><table class="table" summary="Parameters"> 52<colgroup> 53<col> 54<col> 55<col> 56</colgroup> 57<thead><tr> 58<th> 59 <p> 60 Parameter 61 </p> 62 </th> 63<th> 64 <p> 65 Requirement 66 </p> 67 </th> 68<th> 69 <p> 70 Description 71 </p> 72 </th> 73</tr></thead> 74<tbody> 75<tr> 76<td> 77 <p> 78 <code class="computeroutput"><span class="identifier">Sequence</span></code> 79 </p> 80 </td> 81<td> 82 <p> 83 A model of <a class="link" href="../../../sequence/concepts/bidirectional_sequence.html" title="Bidirectional Sequence">Bidirectional 84 Sequence</a> 85 </p> 86 </td> 87<td> 88 <p> 89 The sequence to iterate 90 </p> 91 </td> 92</tr> 93<tr> 94<td> 95 <p> 96 <code class="computeroutput"><span class="identifier">State</span></code> 97 </p> 98 </td> 99<td> 100 <p> 101 Any type 102 </p> 103 </td> 104<td> 105 <p> 106 The initial state for the first application of <code class="computeroutput"><span class="identifier">F</span></code> 107 </p> 108 </td> 109</tr> 110<tr> 111<td> 112 <p> 113 <code class="computeroutput"><span class="identifier">F</span></code> 114 </p> 115 </td> 116<td> 117 <p> 118 <code class="computeroutput"><a href="http://www.boost.org/libs/utility/utility.htm#result_of" target="_top"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span></code></a><span class="special"><</span><span class="identifier">F</span><span class="special">(</span><span class="identifier">S</span><span class="special">,</span>E<span class="special">)>::</span><span class="identifier">type</span></code> is the return type of 119 <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span>e<span class="special">)</span></code> with current state <code class="computeroutput"><span class="identifier">s</span></code> of type <code class="computeroutput"><span class="identifier">S</span></code>, 120 and an element <code class="computeroutput"><span class="identifier">e</span></code> 121 of type <code class="computeroutput"><span class="identifier">E</span></code> in 122 <code class="computeroutput"><span class="identifier">seq</span></code> 123 </p> 124 </td> 125<td> 126 <p> 127 The operation to be applied on traversal 128 </p> 129 </td> 130</tr> 131</tbody> 132</table></div> 133</div> 134<br class="table-break"><h6> 135<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.h2"></a> 136 <span class="phrase"><a name="fusion.algorithm.iteration.metafunctions.reverse_fold.expression_semantics"></a></span><a class="link" href="reverse_fold.html#fusion.algorithm.iteration.metafunctions.reverse_fold.expression_semantics">Expression 137 Semantics</a> 138 </h6> 139<pre class="programlisting">reverse_fold<span class="special"><</span><span class="identifier">Sequence</span><span class="special">,</span> <span class="identifier">State</span><span class="special">,</span> <span class="identifier">F</span><span class="special">>::</span><span class="identifier">type</span> 140</pre> 141<p> 142 <span class="bold"><strong>Return type</strong></span>: Any type 143 </p> 144<p> 145 <span class="bold"><strong>Semantics</strong></span>: Returns the result of applying 146 <a class="link" href="../functions/reverse_fold.html" title="reverse_fold"><code class="computeroutput"><span class="identifier">reverse_fold</span></code></a> to a sequence of 147 type <code class="computeroutput"><span class="identifier">Sequence</span></code>, with an 148 initial state of type <code class="computeroutput"><span class="identifier">State</span></code> 149 and binary function object or function pointer of type <code class="computeroutput"><span class="identifier">F</span></code>. 150 </p> 151<h6> 152<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.h3"></a> 153 <span class="phrase"><a name="fusion.algorithm.iteration.metafunctions.reverse_fold.complexity"></a></span><a class="link" href="reverse_fold.html#fusion.algorithm.iteration.metafunctions.reverse_fold.complexity">Complexity</a> 154 </h6> 155<p> 156 Linear, exactly <code class="computeroutput"><a class="link" href="../../../sequence/intrinsic/metafunctions/size.html" title="size"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">size</span></code></a><span class="special"><</span><span class="identifier">Sequence</span><span class="special">>::</span><span class="identifier">value</span></code> applications of <code class="computeroutput"><span class="identifier">F</span></code>. 157 </p> 158<h6> 159<a name="fusion.algorithm.iteration.metafunctions.reverse_fold.h4"></a> 160 <span class="phrase"><a name="fusion.algorithm.iteration.metafunctions.reverse_fold.header"></a></span><a class="link" href="reverse_fold.html#fusion.algorithm.iteration.metafunctions.reverse_fold.header">Header</a> 161 </h6> 162<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">iteration</span><span class="special">/</span>reverse_fold<span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 163<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>reverse_fold<span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 164</pre> 165</div> 166<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 167<td align="left"></td> 168<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 169 Dan Marsden, Tobias Schwinger<p> 170 Distributed under the Boost Software License, Version 1.0. (See accompanying 171 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>) 172 </p> 173</div></td> 174</tr></table> 175<hr> 176<div class="spirit-nav"> 177<a accesskey="p" href="fold.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../metafunctions.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="iter_fold.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 178</div> 179</body> 180</html> 181