1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>at</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="size.html" title="size"> 10<link rel="next" href="at_c.html" title="at_c"> 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="size.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="at_c.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.sequence.intrinsic.metafunctions.at"></a><a class="link" href="at.html" title="at">at</a> 28</h5></div></div></div> 29<h6> 30<a name="fusion.sequence.intrinsic.metafunctions.at.h0"></a> 31 <span class="phrase"><a name="fusion.sequence.intrinsic.metafunctions.at.description"></a></span><a class="link" href="at.html#fusion.sequence.intrinsic.metafunctions.at.description">Description</a> 32 </h6> 33<p> 34 Returns the result type of <a class="link" href="../functions/at.html" title="at"><code class="computeroutput"><span class="identifier">at</span></code></a><a href="#ftn.fusion.sequence.intrinsic.metafunctions.at.f0" class="footnote" name="fusion.sequence.intrinsic.metafunctions.at.f0"><sup class="footnote">[7]</sup></a>. 35 </p> 36<h6> 37<a name="fusion.sequence.intrinsic.metafunctions.at.h1"></a> 38 <span class="phrase"><a name="fusion.sequence.intrinsic.metafunctions.at.synopsis"></a></span><a class="link" href="at.html#fusion.sequence.intrinsic.metafunctions.at.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">Seq</span><span class="special">,</span> 42 <span class="keyword">typename</span> <span class="identifier">M</span><span class="special">></span> 43<span class="keyword">struct</span> <span class="identifier">at</span> 44<span class="special">{</span> 45 <span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span> 46<span class="special">};</span> 47</pre> 48<div class="table"> 49<a name="fusion.sequence.intrinsic.metafunctions.at.t0"></a><p class="title"><b>Table 1.28. Parameters</b></p> 50<div class="table-contents"><table class="table" summary="Parameters"> 51<colgroup> 52<col> 53<col> 54<col> 55</colgroup> 56<thead><tr> 57<th> 58 <p> 59 Parameter 60 </p> 61 </th> 62<th> 63 <p> 64 Requirement 65 </p> 66 </th> 67<th> 68 <p> 69 Description 70 </p> 71 </th> 72</tr></thead> 73<tbody> 74<tr> 75<td> 76 <p> 77 <code class="computeroutput"><span class="identifier">Seq</span></code> 78 </p> 79 </td> 80<td> 81 <p> 82 A model of <a class="link" href="../../concepts/random_access_sequence.html" title="Random Access Sequence">Random 83 Access Sequence</a> 84 </p> 85 </td> 86<td> 87 <p> 88 Argument sequence 89 </p> 90 </td> 91</tr> 92<tr> 93<td> 94 <p> 95 <code class="computeroutput"><span class="identifier">M</span></code> 96 </p> 97 </td> 98<td> 99 <p> 100 An <a href="http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL 101 Integral Constant</a> 102 </p> 103 </td> 104<td> 105 <p> 106 Index of element 107 </p> 108 </td> 109</tr> 110</tbody> 111</table></div> 112</div> 113<br class="table-break"><h6> 114<a name="fusion.sequence.intrinsic.metafunctions.at.h2"></a> 115 <span class="phrase"><a name="fusion.sequence.intrinsic.metafunctions.at.expression_semantics"></a></span><a class="link" href="at.html#fusion.sequence.intrinsic.metafunctions.at.expression_semantics">Expression 116 Semantics</a> 117 </h6> 118<pre class="programlisting"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">at</span><span class="special"><</span><span class="identifier">Seq</span><span class="special">,</span> <span class="identifier">M</span><span class="special">>::</span><span class="identifier">type</span> 119</pre> 120<p> 121 <span class="bold"><strong>Return type</strong></span>: Any type. 122 </p> 123<p> 124 <span class="bold"><strong>Precondition</strong></span>: <code class="computeroutput"><span class="number">0</span> 125 <span class="special"><=</span> <span class="identifier">M</span><span class="special">::</span><span class="identifier">value</span> <span class="special"><</span> <a class="link" href="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">Seq</span><span class="special">>::</span><span class="identifier">value</span></code> (where <code class="computeroutput"><span class="identifier">Seq</span></code> 126 is not <a class="link" href="../../concepts/unbounded_sequence.html" title="Unbounded Sequence">Unbounded 127 Sequence</a>) 128 </p> 129<p> 130 <span class="bold"><strong>Semantics</strong></span>: Returns the result type of 131 using <a class="link" href="../functions/at.html" title="at"><code class="computeroutput"><span class="identifier">at</span></code></a> to access the <code class="computeroutput"><span class="identifier">M</span></code>th element of <code class="computeroutput"><span class="identifier">Seq</span></code>. 132 </p> 133<h6> 134<a name="fusion.sequence.intrinsic.metafunctions.at.h3"></a> 135 <span class="phrase"><a name="fusion.sequence.intrinsic.metafunctions.at.header"></a></span><a class="link" href="at.html#fusion.sequence.intrinsic.metafunctions.at.header">Header</a> 136 </h6> 137<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">sequence</span><span class="special">/</span><span class="identifier">intrinsic</span><span class="special">/</span><span class="identifier">at</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 138<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">at</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 139</pre> 140<h6> 141<a name="fusion.sequence.intrinsic.metafunctions.at.h4"></a> 142 <span class="phrase"><a name="fusion.sequence.intrinsic.metafunctions.at.example"></a></span><a class="link" href="at.html#fusion.sequence.intrinsic.metafunctions.at.example">Example</a> 143 </h6> 144<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">float</span><span class="special">,</span><span class="keyword">char</span><span class="special">></span> <span class="identifier">vec</span><span class="special">;</span> 145<span class="identifier">BOOST_MPL_ASSERT</span><span class="special">((</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_same</span><span class="special"><</span><a class="link" href="at.html" title="at"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">at</span></code></a><span class="special"><</span><span class="identifier">vec</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">int_</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&>));</span> 146</pre> 147<div class="footnotes"> 148<br><hr style="width:100; text-align:left;margin-left: 0"> 149<div id="ftn.fusion.sequence.intrinsic.metafunctions.at.f0" class="footnote"><p><a href="#fusion.sequence.intrinsic.metafunctions.at.f0" class="para"><sup class="para">[7] </sup></a> 150 <a class="link" href="at.html" title="at"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">at</span></code></a> reflects the actual return 151 type of the function <a class="link" href="../functions/at.html" title="at"><code class="computeroutput"><span class="identifier">at</span></code></a>. <a class="link" href="../../../sequence.html" title="Sequence">Sequence</a>(s) 152 typically return references to its elements via the <a class="link" href="../functions/at.html" title="at"><code class="computeroutput"><span class="identifier">at</span></code></a> function. If you want to 153 get the actual element type, use <a class="link" href="value_at.html" title="value_at"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">value_at</span></code></a> 154 </p></div> 155</div> 156</div> 157<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 158<td align="left"></td> 159<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 160 Dan Marsden, Tobias Schwinger<p> 161 Distributed under the Boost Software License, Version 1.0. (See accompanying 162 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>) 163 </p> 164</div></td> 165</tr></table> 166<hr> 167<div class="spirit-nav"> 168<a accesskey="p" href="size.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="at_c.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 169</div> 170</body> 171</html> 172