1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Tuple helper classes</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="../class_template_tuple.html" title="Class template tuple"> 9<link rel="prev" href="tuple_creation_functions.html" title="Tuple creation functions"> 10<link rel="next" href="element_access.html" title="Element access"> 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="tuple_creation_functions.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../class_template_tuple.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="element_access.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.tuple.class_template_tuple.tuple_helper_classes"></a><a class="link" href="tuple_helper_classes.html" title="Tuple helper classes">Tuple 28 helper classes</a> 29</h4></div></div></div> 30<h6> 31<a name="fusion.tuple.class_template_tuple.tuple_helper_classes.h0"></a> 32 <span class="phrase"><a name="fusion.tuple.class_template_tuple.tuple_helper_classes.description"></a></span><a class="link" href="tuple_helper_classes.html#fusion.tuple.class_template_tuple.tuple_helper_classes.description">Description</a> 33 </h6> 34<p> 35 The <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf" target="_top">TR1 36 Tuple</a> provides 2 helper traits, for compile time access to the 37 tuple size, and the element types. 38 </p> 39<h6> 40<a name="fusion.tuple.class_template_tuple.tuple_helper_classes.h1"></a> 41 <span class="phrase"><a name="fusion.tuple.class_template_tuple.tuple_helper_classes.specification"></a></span><a class="link" href="tuple_helper_classes.html#fusion.tuple.class_template_tuple.tuple_helper_classes.specification">Specification</a> 42 </h6> 43<pre class="programlisting"><span class="identifier">tuple_size</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">value</span> 44</pre> 45<p> 46 <span class="bold"><strong>Requires</strong></span>: <code class="computeroutput"><span class="identifier">T</span></code> 47 is any fusion sequence type, including <code class="computeroutput"><span class="identifier">tuple</span></code>. 48 </p> 49<p> 50 <span class="bold"><strong>Type</strong></span>: <a href="http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL 51 Integral Constant</a> 52 </p> 53<p> 54 <span class="bold"><strong>Value</strong></span>: The number of elements in the sequence. 55 Equivalent to <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">T</span><span class="special">>::</span><span class="identifier">type</span></code>. 56 </p> 57<pre class="programlisting"><span class="identifier">tuple_element</span><span class="special"><</span><span class="identifier">I</span><span class="special">,</span> <span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span> 58</pre> 59<p> 60 <span class="bold"><strong>Requires</strong></span>: <code class="computeroutput"><span class="identifier">T</span></code> 61 is any fusion sequence type, including <code class="computeroutput"><span class="identifier">tuple</span></code>. 62 <code class="computeroutput"><span class="number">0</span> <span class="special"><=</span> 63 <span class="identifier">I</span> <span class="special"><</span> 64 <span class="identifier">N</span></code> or the program is ill formed. 65 </p> 66<p> 67 <span class="bold"><strong>Value</strong></span>: The type of the <code class="computeroutput"><span class="identifier">I</span></code>th 68 element of <code class="computeroutput"><span class="identifier">T</span></code>. Equivalent 69 to <code class="computeroutput"><a class="link" href="../../sequence/intrinsic/metafunctions/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><span class="special"><</span><span class="identifier">I</span><span class="special">,</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span></code>. 70 </p> 71</div> 72<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 73<td align="left"></td> 74<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 75 Dan Marsden, Tobias Schwinger<p> 76 Distributed under the Boost Software License, Version 1.0. (See accompanying 77 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>) 78 </p> 79</div></td> 80</tr></table> 81<hr> 82<div class="spirit-nav"> 83<a accesskey="p" href="tuple_creation_functions.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../class_template_tuple.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="element_access.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 84</div> 85</body> 86</html> 87