• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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="../functions.html" title="Functions">
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="../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="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.functions.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.functions.make_cons.h0"></a>
31            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.description"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.description">Description</a>
32          </h6>
33<p>
34            Create a <a class="link" href="../../cons.html" title="cons"><code class="computeroutput"><span class="identifier">cons</span></code></a>
35            from <code class="computeroutput"><span class="identifier">car</span></code> (<span class="emphasis"><em>head</em></span>)
36            and optional <code class="computeroutput"><span class="identifier">cdr</span></code> (<span class="emphasis"><em>tail</em></span>).
37          </p>
38<h6>
39<a name="fusion.container.generation.functions.make_cons.h1"></a>
40            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.synopsis"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.synopsis">Synopsis</a>
41          </h6>
42<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Car</span><span class="special">&gt;</span>
43<span class="keyword">typename</span> <a class="link" href="../metafunctions/make_cons.html" title="make_cons"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span></code></a><span class="special">&lt;</span><span class="identifier">Car</span><span class="special">&gt;::</span><span class="identifier">type</span>
44<span class="identifier">make_cons</span><span class="special">(</span><span class="identifier">Car</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">car</span><span class="special">);</span>
45
46<span class="keyword">template</span> <span class="special">&lt;</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">&gt;</span>
47<span class="keyword">typename</span> <a class="link" href="../metafunctions/make_cons.html" title="make_cons"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span></code></a><span class="special">&lt;</span><span class="identifier">Car</span><span class="special">,</span> <span class="identifier">Cdr</span><span class="special">&gt;::</span><span class="identifier">type</span>
48<span class="identifier">make_cons</span><span class="special">(</span><span class="identifier">Car</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">car</span><span class="special">,</span> <span class="identifier">Cdr</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">cdr</span><span class="special">);</span>
49</pre>
50<h6>
51<a name="fusion.container.generation.functions.make_cons.h2"></a>
52            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.parameters"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.parameters">Parameters</a>
53          </h6>
54<div class="informaltable"><table class="table">
55<colgroup>
56<col>
57<col>
58<col>
59</colgroup>
60<thead><tr>
61<th>
62                    <p>
63                      Parameter
64                    </p>
65                  </th>
66<th>
67                    <p>
68                      Requirement
69                    </p>
70                  </th>
71<th>
72                    <p>
73                      Description
74                    </p>
75                  </th>
76</tr></thead>
77<tbody>
78<tr>
79<td>
80                    <p>
81                      <code class="computeroutput"><span class="identifier">car</span></code>
82                    </p>
83                  </td>
84<td>
85                    <p>
86                      Instance of <code class="computeroutput"><span class="identifier">Car</span></code>
87                    </p>
88                  </td>
89<td>
90                    <p>
91                      The list's head
92                    </p>
93                  </td>
94</tr>
95<tr>
96<td>
97                    <p>
98                      <code class="computeroutput"><span class="identifier">cdr</span></code>
99                    </p>
100                  </td>
101<td>
102                    <p>
103                      Instance of <code class="computeroutput"><span class="identifier">Cdr</span></code>
104                    </p>
105                  </td>
106<td>
107                    <p>
108                      The list's tail (optional)
109                    </p>
110                  </td>
111</tr>
112</tbody>
113</table></div>
114<h6>
115<a name="fusion.container.generation.functions.make_cons.h3"></a>
116            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.expression_semantics"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.expression_semantics">Expression
117            Semantics</a>
118          </h6>
119<pre class="programlisting"><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>
120</pre>
121<p>
122            <span class="bold"><strong>Return type</strong></span>: <a class="link" href="../metafunctions/make_cons.html" title="make_cons"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span></code></a><code class="computeroutput"><span class="special">&lt;</span><span class="identifier">Car</span><span class="special">,</span> <span class="identifier">Cdr</span><span class="special">&gt;::</span><span class="identifier">type</span></code> or <a class="link" href="../metafunctions/make_cons.html" title="make_cons"><code class="computeroutput"><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">make_cons</span></code></a><code class="computeroutput"><span class="special">&lt;</span><span class="identifier">Car</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
123          </p>
124<p>
125            <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>
126            (<span class="emphasis"><em>head</em></span>) and optional <code class="computeroutput"><span class="identifier">cdr</span></code>
127            (<span class="emphasis"><em>tail</em></span>).
128          </p>
129<h6>
130<a name="fusion.container.generation.functions.make_cons.h4"></a>
131            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.header"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.header">Header</a>
132          </h6>
133<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
134<span class="preprocessor">#include</span> <span class="special">&lt;</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">&gt;</span>
135</pre>
136<h6>
137<a name="fusion.container.generation.functions.make_cons.h5"></a>
138            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.example"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.example">Example</a>
139          </h6>
140<pre class="programlisting"><span class="identifier">make_cons</span><span class="special">(</span><span class="char">'x'</span><span class="special">,</span> <span class="identifier">make_cons</span><span class="special">(</span><span class="number">123</span><span class="special">))</span>
141</pre>
142<h6>
143<a name="fusion.container.generation.functions.make_cons.h6"></a>
144            <span class="phrase"><a name="fusion.container.generation.functions.make_cons.see_also"></a></span><a class="link" href="make_cons.html#fusion.container.generation.functions.make_cons.see_also">See
145            also</a>
146          </h6>
147<p>
148            <a class="link" href="../../../notes.html#fusion.notes.reference_wrappers"><code class="computeroutput"><span class="identifier">Reference</span>
149            <span class="identifier">Wrappers</span></code></a>
150          </p>
151</div>
152<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
153<td align="left"></td>
154<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman,
155      Dan Marsden, Tobias Schwinger<p>
156        Distributed under the Boost Software License, Version 1.0. (See accompanying
157        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>)
158      </p>
159</div></td>
160</tr></table>
161<hr>
162<div class="spirit-nav">
163<a accesskey="p" href="make_list.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="make_vector.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
164</div>
165</body>
166</html>
167