1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright 2012 Eric Niebler 4 5 Distributed under the Boost 6 Software License, Version 1.0. (See accompanying 7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 --> 9<header name="boost/proto/eval.hpp"> 10 <para> 11 Contains the 12 <computeroutput> 13 <functionname alt="boost::proto::eval">proto::eval()</functionname> 14 </computeroutput> expression evaluator. 15 </para> 16 <namespace name="boost"> 17 <namespace name="proto"> 18 <namespace name="functional"> 19 <!-- proto::functional::eval--> 20 <struct name="eval"> 21 <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type for evaluating a given Proto 22 expression with a given context.</purpose> 23 <inherit> 24 <type><classname>proto::callable</classname></type> 25 </inherit> 26 <struct-specialization name="result"> 27 <template> 28 <template-type-parameter name="This"/> 29 <template-type-parameter name="Expr"/> 30 <template-type-parameter name="Context"/> 31 </template> 32 <specialization> 33 <template-arg>This(Expr, Context)</template-arg> 34 </specialization> 35 <inherit> 36 <type> 37 <classname>proto::result_of::eval</classname>< 38 typename boost::remove_reference< Expr >::type, 39 typename boost::remove_reference< Context >::type 40 ></type> 41 </inherit> 42 </struct-specialization> 43 <method-group name="public member functions"> 44 <method name="operator()" cv="const"> 45 <type>typename <classname>proto::result_of::eval</classname>< Expr, Context >::type</type> 46 <template> 47 <template-type-parameter name="Expr"/> 48 <template-type-parameter name="Context"/> 49 </template> 50 <parameter name="expr"> 51 <paramtype>Expr &</paramtype> 52 <description> 53 <para>The Proto expression to evaluate.</para> 54 </description> 55 </parameter> 56 <parameter name="context"> 57 <paramtype>Context &</paramtype> 58 <description> 59 <para>The context in which the expression should be evaluated. </para> 60 </description> 61 </parameter> 62 <purpose>Evaluate a given Proto expression with a given context. </purpose> 63 <returns> 64 <para> 65 <computeroutput>typename Context::template eval<Expr>()(expr, context)</computeroutput> 66 </para> 67 </returns> 68 </method> 69 <method name="operator()" cv="const"> 70 <type>typename <classname>proto::result_of::eval</classname>< Expr, Context >::type</type> 71 <template> 72 <template-type-parameter name="Expr"/> 73 <template-type-parameter name="Context"/> 74 </template> 75 <parameter name="expr"> 76 <paramtype>Expr &</paramtype> 77 </parameter> 78 <parameter name="context"> 79 <paramtype>Context const &</paramtype> 80 </parameter> 81 <description> 82 <para> 83 This is an overloaded member function, provided for convenience. It differs from the above 84 function only in what argument(s) it accepts. 85 </para> 86 </description> 87 </method> 88 </method-group> 89 </struct> 90 </namespace> 91 <namespace name="result_of"> 92 <!-- proto::result_of::eval --> 93 <struct name="eval"> 94 <template> 95 <template-type-parameter name="Expr"/> 96 <template-type-parameter name="Context"/> 97 </template> 98 <purpose>A metafunction for calculating the return type of <computeroutput> 99 <functionname alt="proto::eval">proto::eval()</functionname></computeroutput> given a 100 certain <computeroutput>Expr</computeroutput> and <computeroutput>Context</computeroutput> types.</purpose> 101 <typedef name="type"> 102 <type>typename Context::template eval< Expr >::result_type</type> 103 </typedef> 104 </struct> 105 </namespace> 106 <!-- proto::eval() --> 107 <overloaded-function name="eval"> 108 <signature> 109 <type>typename <classname>proto::result_of::eval</classname>< Expr, Context >::type</type> 110 <template> 111 <template-type-parameter name="Expr"/> 112 <template-type-parameter name="Context"/> 113 </template> 114 <parameter name="expr"> 115 <paramtype>Expr &</paramtype> 116 <description> 117 <para>The Proto expression to evaluate.</para> 118 </description> 119 </parameter> 120 <parameter name="context"> 121 <paramtype>Context &</paramtype> 122 <description> 123 <para>The context in which the expression should be evaluated.</para> 124 </description> 125 </parameter> 126 </signature> 127 <signature> 128 <type>typename <classname>proto::result_of::eval</classname>< Expr, Context >::type</type> 129 <template> 130 <template-type-parameter name="Expr"/> 131 <template-type-parameter name="Context"/> 132 </template> 133 <parameter name="expr"> 134 <paramtype>Expr &</paramtype> 135 </parameter> 136 <parameter name="context"> 137 <paramtype>Context const &</paramtype> 138 </parameter> 139 </signature> 140 <purpose>Evaluate a given Proto expression with a given context. </purpose> 141 <returns> 142 <para> 143 <computeroutput>typename Context::template eval<Expr>()(expr, context)</computeroutput> 144 </para> 145 </returns> 146 </overloaded-function> 147 </namespace> 148 </namespace> 149</header> 150