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 callable_eval</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.context.callable_hpp" title="Header <boost/proto/context/callable.hpp>"> 10<link rel="prev" href="../external_transforms/when.html" title="Struct template when"> 11<link rel="next" href="callable_context.html" title="Struct template callable_context"> 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="../external_transforms/when.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../proto/reference.html#header.boost.proto.context.callable_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="callable_context.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.proto.context.callable_eval"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Struct template callable_eval</span></h2> 30<p>boost::proto::context::callable_eval — A BinaryFunction that accepts a Proto expression and a callable context and calls 31 the context with the expression tag and children as arguments, effectively fanning the 32 expression out. </p> 33</div> 34<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 35<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../proto/reference.html#header.boost.proto.context.callable_hpp" title="Header <boost/proto/context/callable.hpp>">boost/proto/context/callable.hpp</a>> 36 37</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <a class="link" href="../../../Expr.html" title="Concept Expr">Expr</a><span class="special">,</span> <span class="keyword">typename</span> Context<span class="special">></span> 38<span class="keyword">struct</span> <a class="link" href="callable_eval.html" title="Struct template callable_eval">callable_eval</a> <span class="special">{</span> 39 <span class="comment">// types</span> 40 <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">result_of</span><span class="special"><</span> 41 <span class="identifier">Context</span><span class="special">(</span> 42 <span class="keyword">typename</span> <span class="identifier">Expr</span><span class="special">::</span><span class="identifier">proto_tag</span><span class="special">,</span> 43 <span class="keyword">typename</span> <span class="identifier">proto</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">child_c</span><span class="special"><</span><span class="number">0</span><span class="special">></span><span class="special">::</span><span class="identifier">type</span><span class="special">,</span> 44 <span class="special">...</span> 45 <span class="keyword">typename</span> <span class="identifier">proto</span><span class="special">::</span><span class="identifier">result_of</span><span class="special">::</span><span class="identifier">child_c</span><span class="special"><</span><span class="identifier">N</span><span class="special">></span><span class="special">::</span><span class="identifier">type</span><span class="special">,</span> 46 <span class="special">)</span><span class="special">></span><span class="special">::</span><span class="identifier">type</span> 47 <a name="boost.proto.context.callable_eval.result_type"></a><span class="identifier">result_type</span><span class="special">;</span> 48 49 <span class="comment">// <a class="link" href="callable_eval.html#id-1_3_33_5_54_2_1_1_1_5-bb">public member functions</a></span> 50 <span class="identifier">result_type</span> <a class="link" href="callable_eval.html#id-1_3_33_5_54_2_1_1_1_5_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="special">&</span><span class="special">,</span> <span class="identifier">Context</span> <span class="special">&</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 51<span class="special">}</span><span class="special">;</span></pre></div> 52<div class="refsect1"> 53<a name="id-1.3.33.5.56.4.4"></a><h2>Description</h2> 54<p> 55 <code class="computeroutput">proto::context::callable_eval<></code> requires that 56 <code class="computeroutput">Context</code> is a <a class="link" href="../../../PolymorphicFunctionObject.html" title="Concept PolymorphicFunctionObject">PolymorphicFunctionObject</a> 57 that can be invoked with <code class="computeroutput">Expr</code>'s tag and children as 58 expressions, as follows: 59 </p> 60<pre class="programlisting"><span class="identifier">context</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">Expr</span><span class="special">::</span><span class="identifier">proto_tag</span><span class="special">(</span><span class="special">)</span><span class="special">,</span> <a class="link" href="../child_c.html" title="Function child_c">proto::child_c</a><span class="special"><</span><span class="number">0</span><span class="special">></span><span class="special">(</span><span class="identifier">expr</span><span class="special">)</span><span class="special">,</span> <span class="special">...</span> <a class="link" href="../child_c.html" title="Function child_c">proto::child_c</a><span class="special"><</span><span class="identifier">N</span><span class="special">></span><span class="special">(</span><span class="identifier">expr</span><span class="special">)</span><span class="special">)</span></pre> 61<p> 62 </p> 63<div class="refsect2"> 64<a name="id-1.3.33.5.56.4.4.3"></a><h3> 65<a name="id-1_3_33_5_54_2_1_1_1_5-bb"></a><code class="computeroutput">callable_eval</code> public member functions</h3> 66<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 67<pre class="literallayout"><span class="identifier">result_type</span> <a name="id-1_3_33_5_54_2_1_1_1_5_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="special">&</span> expr<span class="special">,</span> <span class="identifier">Context</span> <span class="special">&</span> context<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre> 68<div class="variablelist"><table border="0" class="variablelist compact"> 69<colgroup> 70<col align="left" valign="top"> 71<col> 72</colgroup> 73<tbody> 74<tr> 75<td><p><span class="term">Parameters:</span></p></td> 76<td><div class="variablelist"><table border="0" class="variablelist compact"> 77<colgroup> 78<col align="left" valign="top"> 79<col> 80</colgroup> 81<tbody> 82<tr> 83<td><p><span class="term"><code class="computeroutput">context</code></span></p></td> 84<td><p>The callable evaluation context </p></td> 85</tr> 86<tr> 87<td><p><span class="term"><code class="computeroutput">expr</code></span></p></td> 88<td><p>The current expression </p></td> 89</tr> 90</tbody> 91</table></div></td> 92</tr> 93<tr> 94<td><p><span class="term">Returns:</span></p></td> 95<td><p> 96 <code class="computeroutput"> 97 context(typename Expr::proto_tag(), 98 <a class="link" href="../child_c.html" title="Function child_c">proto::child_c</a><0>(expr),... 99 <a class="link" href="../child_c.html" title="Function child_c">proto::child_c</a><N>(expr)) 100 </code> 101 </p></td> 102</tr> 103</tbody> 104</table></div> 105</li></ol></div> 106</div> 107</div> 108</div> 109<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 110<td align="left"></td> 111<td align="right"><div class="copyright-footer">Copyright © 2008 Eric Niebler<p> 112 Distributed under the Boost Software License, Version 1.0. (See accompanying 113 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>) 114 </p> 115</div></td> 116</tr></table> 117<hr> 118<div class="spirit-nav"> 119<a accesskey="p" href="../external_transforms/when.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../proto/reference.html#header.boost.proto.context.callable_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="callable_context.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 120</div> 121</body> 122</html> 123