1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>deref</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="../functions.html" title="Functions"> 10<link rel="next" href="next.html" title="next"> 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="../functions.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="next.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.iterator.functions.deref"></a><a class="link" href="deref.html" title="deref">deref</a> 28</h4></div></div></div> 29<h6> 30<a name="fusion.iterator.functions.deref.h0"></a> 31 <span class="phrase"><a name="fusion.iterator.functions.deref.description"></a></span><a class="link" href="deref.html#fusion.iterator.functions.deref.description">Description</a> 32 </h6> 33<p> 34 Deferences an iterator. 35 </p> 36<h6> 37<a name="fusion.iterator.functions.deref.h1"></a> 38 <span class="phrase"><a name="fusion.iterator.functions.deref.synopsis"></a></span><a class="link" href="deref.html#fusion.iterator.functions.deref.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">I</span> 42 <span class="special">></span> 43<span class="keyword">typename</span> <a class="link" href="../metafunctions/deref.html" title="deref"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">deref</span></code></a><span class="special"><</span><span class="identifier">I</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">deref</span><span class="special">(</span><span class="identifier">I</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">i</span><span class="special">);</span> 44</pre> 45<div class="table"> 46<a name="fusion.iterator.functions.deref.t0"></a><p class="title"><b>Table 1.1. 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">i</span></code> 74 </p> 75 </td> 76<td> 77 <p> 78 Model of <a class="link" href="../concepts/forward_iterator.html" title="Forward Iterator">Forward 79 Iterator</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.iterator.functions.deref.h2"></a> 92 <span class="phrase"><a name="fusion.iterator.functions.deref.expression_semantics"></a></span><a class="link" href="deref.html#fusion.iterator.functions.deref.expression_semantics">Expression 93 Semantics</a> 94 </h6> 95<pre class="programlisting"><a class="link" href="deref.html" title="deref"><code class="computeroutput"><span class="identifier">deref</span></code></a><span class="special">(</span><span class="identifier">i</span><span class="special">);</span> 96</pre> 97<p> 98 <span class="bold"><strong>Return type</strong></span>: <code class="computeroutput"><a class="link" href="../metafunctions/deref.html" title="deref"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">deref</span></code></a><span class="special"><</span><span class="identifier">I</span><span class="special">>::</span><span class="identifier">type</span></code> 99 </p> 100<p> 101 <span class="bold"><strong>Semantics</strong></span>: Dereferences the iterator 102 <code class="computeroutput"><span class="identifier">i</span></code>. 103 </p> 104<h6> 105<a name="fusion.iterator.functions.deref.h3"></a> 106 <span class="phrase"><a name="fusion.iterator.functions.deref.header"></a></span><a class="link" href="deref.html#fusion.iterator.functions.deref.header">Header</a> 107 </h6> 108<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">iterator</span><span class="special">/</span><span class="identifier">deref</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 109<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">deref</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 110</pre> 111<h6> 112<a name="fusion.iterator.functions.deref.h4"></a> 113 <span class="phrase"><a name="fusion.iterator.functions.deref.example"></a></span><a class="link" href="deref.html#fusion.iterator.functions.deref.example">Example</a> 114 </h6> 115<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">int</span><span class="special">&></span> <span class="identifier">vec</span><span class="special">;</span> 116 117<span class="keyword">int</span> <span class="identifier">i</span><span class="special">(</span><span class="number">0</span><span class="special">);</span> 118<span class="identifier">vec</span> <span class="identifier">v</span><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="identifier">i</span><span class="special">);</span> 119<span class="identifier">assert</span><span class="special">(</span><a class="link" href="deref.html" title="deref"><code class="computeroutput"><span class="identifier">deref</span></code></a><span class="special">(</span><a class="link" href="../../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">v</span><span class="special">))</span> <span class="special">==</span> <span class="number">1</span><span class="special">);</span> 120<span class="identifier">assert</span><span class="special">(</span><a class="link" href="deref.html" title="deref"><code class="computeroutput"><span class="identifier">deref</span></code></a><span class="special">(</span><a class="link" href="next.html" title="next"><code class="computeroutput"><span class="identifier">next</span></code></a><span class="special">(</span><a class="link" href="../../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">v</span><span class="special">)))</span> <span class="special">==</span> <span class="number">0</span><span class="special">);</span> 121<span class="identifier">assert</span><span class="special">(&(</span><a class="link" href="deref.html" title="deref"><code class="computeroutput"><span class="identifier">deref</span></code></a><span class="special">(</span><a class="link" href="next.html" title="next"><code class="computeroutput"><span class="identifier">next</span></code></a><span class="special">(</span><a class="link" href="../../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">v</span><span class="special">))))</span> <span class="special">==</span> <span class="special">&</span><span class="identifier">i</span><span class="special">);</span> 122</pre> 123</div> 124<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 125<td align="left"></td> 126<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 127 Dan Marsden, Tobias Schwinger<p> 128 Distributed under the Boost Software License, Version 1.0. (See accompanying 129 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>) 130 </p> 131</div></td> 132</tr></table> 133<hr> 134<div class="spirit-nav"> 135<a accesskey="p" href="../functions.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="next.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 136</div> 137</body> 138</html> 139