1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>make_cons</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="make_list.html" title="make_list"> 10<link rel="next" href="make_vector.html" title="make_vector"> 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="make_list.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="make_vector.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.container.generation.metafunctions.make_cons"></a><a class="link" href="make_cons.html" title="make_cons">make_cons</a> 28</h5></div></div></div> 29<h6> 30<a name="fusion.container.generation.metafunctions.make_cons.h0"></a> 31 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.description"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.description">Description</a> 32 </h6> 33<p> 34 Returns the result type of <a class="link" href="../functions/make_cons.html" title="make_cons"><code class="computeroutput"><span class="identifier">make_cons</span></code></a>. 35 </p> 36<h6> 37<a name="fusion.container.generation.metafunctions.make_cons.h1"></a> 38 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.synopsis"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.synopsis">Synopsis</a> 39 </h6> 40<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Car</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Cdr</span> <span class="special">=</span> <span class="identifier">nil</span><span class="special">></span> 41<span class="keyword">struct</span> <span class="identifier">make_cons</span><span class="special">;</span> 42</pre> 43<h6> 44<a name="fusion.container.generation.metafunctions.make_cons.h2"></a> 45 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.parameters"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.parameters">Parameters</a> 46 </h6> 47<div class="informaltable"><table class="table"> 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> 71<tr> 72<td> 73 <p> 74 <code class="computeroutput"><span class="identifier">Car</span></code> 75 </p> 76 </td> 77<td> 78 <p> 79 Any type 80 </p> 81 </td> 82<td> 83 <p> 84 The list's head type 85 </p> 86 </td> 87</tr> 88<tr> 89<td> 90 <p> 91 <code class="computeroutput"><span class="identifier">Cdr</span></code> 92 </p> 93 </td> 94<td> 95 <p> 96 A <code class="computeroutput"><span class="identifier">cons</span></code> 97 </p> 98 </td> 99<td> 100 <p> 101 The list's tail type (optional) 102 </p> 103 </td> 104</tr> 105</tbody> 106</table></div> 107<h6> 108<a name="fusion.container.generation.metafunctions.make_cons.h3"></a> 109 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.expression_semantics"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.expression_semantics">Expression 110 Semantics</a> 111 </h6> 112<pre class="programlisting"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span><span class="special"><</span><span class="identifier">Car</span><span class="special">,</span> <span class="identifier">Cdr</span><span class="special">>::</span><span class="identifier">type</span> 113</pre> 114<p> 115 <span class="bold"><strong>Return type</strong></span>: A <a class="link" href="../../cons.html" title="cons"><code class="computeroutput"><span class="identifier">cons</span></code></a> with head element, <code class="computeroutput"><span class="identifier">Car</span></code>, of type converted following the 116 rules for <a class="link" href="../../../notes.html#fusion.notes.element_conversion"><span class="emphasis"><em>element 117 conversion</em></span></a>, and tail, <code class="computeroutput"><span class="identifier">Cdr</span></code>. 118 </p> 119<p> 120 <span class="bold"><strong>Semantics</strong></span>: Create a <a class="link" href="../../cons.html" title="cons"><code class="computeroutput"><span class="identifier">cons</span></code></a> from <code class="computeroutput"><span class="identifier">Car</span></code> 121 (<span class="emphasis"><em>head</em></span>) and optional <code class="computeroutput"><span class="identifier">Cdr</span></code> 122 (<span class="emphasis"><em>tail</em></span>). 123 </p> 124<h6> 125<a name="fusion.container.generation.metafunctions.make_cons.h4"></a> 126 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.header"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.header">Header</a> 127 </h6> 128<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">container</span><span class="special">/</span><span class="identifier">generation</span><span class="special">/</span><span class="identifier">make_cons</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 129<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">make_cons</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 130</pre> 131<h6> 132<a name="fusion.container.generation.metafunctions.make_cons.h5"></a> 133 <span class="phrase"><a name="fusion.container.generation.metafunctions.make_cons.example"></a></span><a class="link" href="make_cons.html#fusion.container.generation.metafunctions.make_cons.example">Example</a> 134 </h6> 135<pre class="programlisting"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span><span class="special"><</span><span class="keyword">char</span><span class="special">,</span> <span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span><span class="special"><</span><span class="keyword">int</span><span class="special">>::</span><span class="identifier">type</span><span class="special">>::</span><span class="identifier">type</span> 136</pre> 137</div> 138<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 139<td align="left"></td> 140<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman, 141 Dan Marsden, Tobias Schwinger<p> 142 Distributed under the Boost Software License, Version 1.0. (See accompanying 143 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>) 144 </p> 145</div></td> 146</tr></table> 147<hr> 148<div class="spirit-nav"> 149<a accesskey="p" href="make_list.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="make_vector.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 150</div> 151</body> 152</html> 153