• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>deduce_sequence</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="../support.html" title="Support">
9<link rel="prev" href="deduce.html" title="deduce">
10<link rel="next" href="pair.html" title="pair">
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="deduce.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.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="pair.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="fusion.support.deduce_sequence"></a><a class="link" href="deduce_sequence.html" title="deduce_sequence">deduce_sequence</a>
28</h3></div></div></div>
29<h5>
30<a name="fusion.support.deduce_sequence.h0"></a>
31        <span class="phrase"><a name="fusion.support.deduce_sequence.description"></a></span><a class="link" href="deduce_sequence.html#fusion.support.deduce_sequence.description">Description</a>
32      </h5>
33<p>
34        Applies <a class="link" href="../notes.html#fusion.notes.element_conversion"><span class="emphasis"><em>element
35        conversion</em></span></a> to each element in a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward
36        Sequence</a>. The resulting type is a <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
37        Access Sequence</a> that provides a converting constructor accepting the
38        original type as its argument.
39      </p>
40<h5>
41<a name="fusion.support.deduce_sequence.h1"></a>
42        <span class="phrase"><a name="fusion.support.deduce_sequence.header"></a></span><a class="link" href="deduce_sequence.html#fusion.support.deduce_sequence.header">Header</a>
43      </h5>
44<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">support</span><span class="special">/</span><span class="identifier">deduce_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
45<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">deduce_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
46</pre>
47<h5>
48<a name="fusion.support.deduce_sequence.h2"></a>
49        <span class="phrase"><a name="fusion.support.deduce_sequence.synopsis"></a></span><a class="link" href="deduce_sequence.html#fusion.support.deduce_sequence.synopsis">Synopsis</a>
50      </h5>
51<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">traits</span>
52<span class="special">{</span>
53    <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Sequence</span><span class="special">&gt;</span>
54    <span class="keyword">struct</span> <span class="identifier">deduce_sequence</span>
55    <span class="special">{</span>
56        <span class="keyword">typedef</span> <span class="emphasis"><em>unspecified</em></span> <span class="identifier">type</span><span class="special">;</span>
57    <span class="special">};</span>
58<span class="special">}</span>
59</pre>
60<h5>
61<a name="fusion.support.deduce_sequence.h3"></a>
62        <span class="phrase"><a name="fusion.support.deduce_sequence.example"></a></span><a class="link" href="deduce_sequence.html#fusion.support.deduce_sequence.example">Example</a>
63      </h5>
64<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Seq</span><span class="special">&gt;</span>
65<span class="keyword">struct</span> <span class="identifier">holder</span>
66<span class="special">{</span>
67    <span class="keyword">typename</span> <span class="identifier">traits</span><span class="special">::</span><span class="identifier">deduce_sequence</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">element</span><span class="special">;</span>
68
69    <span class="identifier">holder</span><span class="special">(</span><span class="identifier">Seq</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a</span><span class="special">)</span>
70      <span class="special">:</span> <span class="identifier">element</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span>
71    <span class="special">{</span> <span class="special">}</span>
72<span class="special">};</span>
73
74<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T0</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">T1</span><span class="special">&gt;</span>
75<span class="identifier">holder</span><span class="special">&lt;</span> <a class="link" href="../container/vector.html" title="vector"><code class="computeroutput"><span class="identifier">vector</span></code></a><span class="special">&lt;</span><span class="identifier">T0</span> <span class="keyword">const</span> <span class="special">&amp;,</span> <span class="identifier">T1</span> <span class="keyword">const</span> <span class="special">&amp;&gt;</span> <span class="special">&gt;</span>
76<span class="identifier">make_holder</span><span class="special">(</span><span class="identifier">T0</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a0</span><span class="special">,</span> <span class="identifier">T1</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a1</span><span class="special">)</span>
77<span class="special">{</span>
78    <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">&lt;</span><span class="identifier">T0</span> <span class="keyword">const</span> <span class="special">&amp;,</span> <span class="identifier">T1</span> <span class="keyword">const</span> <span class="special">&amp;&gt;</span> <span class="identifier">arg_vec_t</span><span class="special">;</span>
79    <span class="keyword">return</span> <span class="identifier">holder</span><span class="special">&lt;</span><span class="identifier">arg_vec_t</span><span class="special">&gt;(</span> <span class="identifier">arg_vec_t</span><span class="special">(</span><span class="identifier">a0</span><span class="special">,</span><span class="identifier">a1</span><span class="special">)</span> <span class="special">);</span>
80<span class="special">}</span>
81</pre>
82<h5>
83<a name="fusion.support.deduce_sequence.h4"></a>
84        <span class="phrase"><a name="fusion.support.deduce_sequence.see_also"></a></span><a class="link" href="deduce_sequence.html#fusion.support.deduce_sequence.see_also">See
85        also</a>
86      </h5>
87<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
88            <a class="link" href="deduce.html" title="deduce"><code class="computeroutput"><span class="identifier">deduce</span></code></a>
89          </li></ul></div>
90</div>
91<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
92<td align="left"></td>
93<td align="right"><div class="copyright-footer">Copyright © 2001-2006, 2011, 2012 Joel de Guzman,
94      Dan Marsden, Tobias Schwinger<p>
95        Distributed under the Boost Software License, Version 1.0. (See accompanying
96        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>)
97      </p>
98</div></td>
99</tr></table>
100<hr>
101<div class="spirit-nav">
102<a accesskey="p" href="deduce.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../support.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="pair.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
103</div>
104</body>
105</html>
106