• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5<title>Struct template compose_generators</title>
6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
9<link rel="up" href="../../proto/reference.html#header.boost.proto.generate_hpp" title="Header &lt;boost/proto/generate.hpp&gt;">
10<link rel="prev" href="by_value_generator/result_1_3_33_5_29_2_1_5_4.html" title="Struct template result&lt;This(Expr)&gt;">
11<link rel="next" href="compose_generators/result_1_3_33_5_29_2_1_6_5.html" title="Struct template result&lt;This(Expr)&gt;">
12</head>
13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
14<table cellpadding="2" width="100%"><tr>
15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
16<td align="center"><a href="../../../../index.html">Home</a></td>
17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
20<td align="center"><a href="../../../../more/index.htm">More</a></td>
21</tr></table>
22<hr>
23<div class="spirit-nav">
24<a accesskey="p" href="by_value_generator/result_1_3_33_5_29_2_1_5_4.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.generate_hpp"><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="compose_generators/result_1_3_33_5_29_2_1_6_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.proto.compose_generators"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Struct template compose_generators</span></h2>
30<p>boost::proto::compose_generators — A composite generator that first applies one transform to an expression and then forwards
31          the result on to another generator for further transformation.</p>
32</div>
33<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
34<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../proto/reference.html#header.boost.proto.generate_hpp" title="Header &lt;boost/proto/generate.hpp&gt;">boost/proto/generate.hpp</a>&gt;
35
36</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> First<span class="special">,</span> <span class="keyword">typename</span> Second<span class="special">&gt;</span>
37<span class="keyword">struct</span> <a class="link" href="compose_generators.html" title="Struct template compose_generators">compose_generators</a> <span class="special">:</span> <span class="keyword"></span> <a class="link" href="callable.html" title="Struct callable">proto::callable</a> <span class="special">{</span>
38  <span class="comment">// member classes/structs/unions</span>
39  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> This<span class="special">,</span> <span class="keyword">typename</span> <a class="link" href="../../Expr.html" title="Concept Expr">Expr</a><span class="special">&gt;</span>
40  <span class="keyword">struct</span> <a class="link" href="compose_generators/result_1_3_33_5_29_2_1_6_5.html" title="Struct template result&lt;This(Expr)&gt;">result</a><span class="special">&lt;</span><span class="identifier">This</span><span class="special">(</span><span class="identifier">Expr</span><span class="special">)</span><span class="special">&gt;</span> <span class="special">:</span> <span class="keyword"></span>
41    <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span>
42      <span class="identifier">Second</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span><span class="identifier">First</span><span class="special">(</span><span class="identifier">Expr</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span><span class="special">)</span>
43    <span class="special">&gt;</span>
44  <span class="special">{</span>
45  <span class="special">}</span><span class="special">;</span>
46
47  <span class="comment">// <a class="link" href="compose_generators.html#id-1_3_33_5_29_2_1_6_6-bb">public member functions</a></span>
48  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <a class="link" href="../../Expr.html" title="Concept Expr">Expr</a><span class="special">&gt;</span>
49    <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span>
50      <span class="identifier">Second</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span><span class="identifier">First</span><span class="special">(</span><span class="identifier">Expr</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span><span class="special">)</span>
51    <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>
52    <a class="link" href="compose_generators.html#id-1_3_33_5_29_2_1_6_6_1-bb"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="identifier">Expr</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
53<span class="special">}</span><span class="special">;</span></pre></div>
54<div class="refsect1">
55<a name="id-1.3.33.5.31.9.4"></a><h2>Description</h2>
56<p>
57            Generators are intended for use as the first template parameter to the
58            <code class="computeroutput"><a class="link" href="domain.html" title="Struct template domain">proto::domain&lt;&gt;</a></code>
59            class template and control if and how expressions within that domain are to be customized.
60            <code class="computeroutput">proto::compose_generators&lt;&gt;</code> is a composite generator
61            that first applies one transform to an expression and then forwards the result on to another
62            generator for further transformation.
63          </p>
64<div class="refsect2">
65<a name="id-1.3.33.5.31.9.4.3"></a><h3>
66<a name="id-1_3_33_5_29_2_1_6_6-bb"></a><code class="computeroutput">compose_generators</code> public member functions</h3>
67<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
68<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <a class="link" href="../../Expr.html" title="Concept Expr">Expr</a><span class="special">&gt;</span>
69  <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span>
70      <span class="identifier">Second</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">&lt;</span><span class="identifier">First</span><span class="special">(</span><span class="identifier">Expr</span><span class="special">)</span><span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span><span class="special">)</span>
71    <span class="special">&gt;</span><span class="special">::</span><span class="identifier">type</span>
72  <a name="id-1_3_33_5_29_2_1_6_6_1-bb"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="identifier">Expr</span> <span class="keyword">const</span> <span class="special">&amp;</span> expr<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
73<div class="variablelist"><table border="0" class="variablelist compact">
74<colgroup>
75<col align="left" valign="top">
76<col>
77</colgroup>
78<tbody>
79<tr>
80<td><p><span class="term">Parameters:</span></p></td>
81<td><div class="variablelist"><table border="0" class="variablelist compact">
82<colgroup>
83<col align="left" valign="top">
84<col>
85</colgroup>
86<tbody><tr>
87<td><p><span class="term"><code class="computeroutput">expr</code></span></p></td>
88<td><p>A Proto expression.</p></td>
89</tr></tbody>
90</table></div></td>
91</tr>
92<tr>
93<td><p><span class="term">Returns:</span></p></td>
94<td><p><code class="computeroutput">Second()(First()(expr))</code></p></td>
95</tr>
96</tbody>
97</table></div>
98</li></ol></div>
99</div>
100</div>
101</div>
102<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
103<td align="left"></td>
104<td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p>
105        Distributed under the Boost Software License, Version 1.0. (See accompanying
106        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>)
107      </p>
108</div></td>
109</tr></table>
110<hr>
111<div class="spirit-nav">
112<a accesskey="p" href="by_value_generator/result_1_3_33_5_29_2_1_5_4.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../proto/reference.html#header.boost.proto.generate_hpp"><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="compose_generators/result_1_3_33_5_29_2_1_6_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
113</div>
114</body>
115</html>
116