<?xml version="1.0" encoding="utf-8"?>
<header name="boost/proto/transform/arg.hpp">
  <para>Contains definition of the childN transforms and friends.</para>
  <namespace name="boost">
    <namespace name="proto">
      <struct name="_expr">
        <inherit><classname>proto::transform</classname>&lt; _expr &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that returns the current expression unmodified. </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
<classname>proto::terminal</classname>&lt;int&gt;::type &amp; j = proto::_expr()(i);
assert( boost::addressof(i) == boost::addressof(j) );</programlisting>
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="result_type">
            <type>Expr</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename impl::expr_param</type>
              <parameter name="expr">
                <paramtype>typename impl::expr_param</paramtype>
                <description>
                  <para>The current expression. </para>
                </description>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::state_param</paramtype>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::data_param</paramtype>
              </parameter>
              <description>
                <para>
                  Returns the current expression.
                </para>
              </description>
              <returns>
                <para>
                  <computeroutput>expr</computeroutput>
                </para>
              </returns>
              <throws>
                <simpara>Will not throw.</simpara>
              </throws>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="_state">
        <inherit><classname>proto::transform</classname>&lt; _state &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that returns the current state unmodified. </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
char ch = proto::_state()(i, 'a');
assert( ch == 'a' );</programlisting>
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="result_type">
            <type>State</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename impl::state_param</type>
              <parameter name="">
                <paramtype>typename impl::expr_param</paramtype>
              </parameter>
              <parameter name="state">
                <paramtype>typename impl::state_param</paramtype>
                <description>
                  <para>The current state. </para>
                </description>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::data_param</paramtype>
              </parameter>
              <description>
                <para>
                  Returns the current state.
                </para>
              </description>
              <returns>
                <para>
                  <computeroutput>state</computeroutput>
                </para>
              </returns>
              <throws>
                <simpara>Will not throw.</simpara>
              </throws>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="_data">
        <inherit><classname>proto::transform</classname>&lt; _data &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that returns the current data unmodified. </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
std::string str("hello");
std::string &amp; data = proto::_data()(i, 'a', str);
assert( &amp;str == &amp;data );</programlisting>
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="result_type">
            <type>Data</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename impl::data_param</type>
              <parameter name="">
                <paramtype>typename impl::expr_param</paramtype>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::state_param</paramtype>
              </parameter>
              <parameter name="data">
                <paramtype>typename impl::data_param</paramtype>
                <description>
                  <para>The current data. </para>
                </description>
              </parameter>
              <description>
                <para>
                  Returns the current data.
                </para>
              </description>
              <returns>
                <para>
                  <computeroutput>data</computeroutput>
                </para>
              </returns>
              <throws>
                <simpara>Will not throw.</simpara>
              </throws>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="_child_c">
        <template>
          <template-nontype-parameter name="N">
            <type>int</type>
          </template-nontype-parameter>
        </template>
        <inherit><classname>proto::transform</classname>&lt; _child_c&lt;N&gt; &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that returns N-th child of the current expression. </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
<classname>proto::terminal</classname>&lt;int&gt;::type &amp; j = proto::_child_c&lt;0&gt;()(-i);
assert( boost::addressof(i) == boost::addressof(j) );</programlisting>
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="result_type">
            <type>typename <classname>proto::result_of::child_c</classname>&lt; Expr, N &gt;::type</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename <classname>proto::result_of::child_c</classname>&lt; typename impl::expr_param, N &gt;::type</type>
              <parameter name="expr">
                <paramtype>typename impl::expr_param</paramtype>
                <description>
                  <para>The current expression. </para>
                </description>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::state_param</paramtype>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::data_param</paramtype>
              </parameter>
              <description>
                <para>
                  Returns the N-th child of <computeroutput>expr</computeroutput>
                </para>
              </description>
              <requires>
                <para>
                  <computeroutput>Expr::proto_arity::value &gt; N</computeroutput>
                </para>
              </requires>
              <returns>
                <para>
                  <computeroutput><functionname>proto::child_c</functionname>&lt;N&gt;(expr)</computeroutput>
                </para>
              </returns>
              <throws>
                <simpara>Will not throw.</simpara>
              </throws>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="_value">
        <inherit><classname>proto::transform</classname>&lt; _value &gt;</inherit>
        <purpose>A <conceptname>PrimitiveTransform</conceptname> that returns the value of the current terminal expression. </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
int j = proto::_value()(i);
assert( 42 == j );</programlisting>
          </para>
        </description>
        <struct name="impl">
          <template>
            <template-type-parameter name="Expr"/>
            <template-type-parameter name="State"/>
            <template-type-parameter name="Data"/>
          </template>
          <inherit><classname>proto::transform_impl</classname>&lt; Expr, State, Data &gt;</inherit>
          <typedef name="result_type">
            <type>typename <classname>proto::result_of::value</classname>&lt; Expr &gt;::type</type>
          </typedef>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename <classname>proto::result_of::value</classname>&lt; typename impl::expr_param &gt;::type</type>
              <parameter name="expr">
                <paramtype>typename impl::expr_param</paramtype>
                <description>
                  <para>The current expression. </para>
                </description>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::state_param</paramtype>
              </parameter>
              <parameter name="">
                <paramtype>typename impl::data_param</paramtype>
              </parameter>
              <description>
                <para>
                  Returns the value of the specified terminal expression.
                </para>
              </description>
              <requires>
                <para>
                  <computeroutput>Expr::proto_arity::value == 0</computeroutput>.
                </para>
              </requires>
              <returns>
                <para>
                  <computeroutput><functionname>proto::value</functionname>(expr)</computeroutput>
                </para>
              </returns>
              <throws>
                <simpara>Will not throw.</simpara>
              </throws>
            </method>
          </method-group>
        </struct>
      </struct>

      <struct name="_byref">
        <inherit><classname>proto::callable</classname></inherit>
        <purpose>A unary callable <conceptname>PolymorphicFunctionObject</conceptname> that wraps its argument
          in a <computeroutput>boost::reference_wrapper&lt;&gt;</computeroutput>.</purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
boost::reference_wrapper&lt;<classname>proto::terminal</classname>&lt;int&gt;::type&gt; j
  = <classname>proto::when</classname>&lt;<classname>proto::_</classname>, proto::_byref(_)&gt;()(i);
assert( boost::addressof(i) == boost::addressof(j.get()) );</programlisting>
          </para>
        </description>
        <struct-specialization name="result">
          <template>
            <template-type-parameter name="This"/>
            <template-type-parameter name="T"/>
          </template>
          <specialization>
            <template-arg>This(T &amp;)</template-arg>
          </specialization>
          <typedef name="type">
            <type>boost::reference_wrapper&lt; T &gt; const</type>
          </typedef>
        </struct-specialization>
        <struct-specialization name="result">
          <template>
            <template-type-parameter name="This"/>
            <template-type-parameter name="T"/>
          </template>
          <specialization>
            <template-arg>This(T)</template-arg>
          </specialization>
          <typedef name="type">
            <type>boost::reference_wrapper&lt; T const  &gt; const</type>
          </typedef>
        </struct-specialization>
        <method-group name="public member functions">
          <method name="operator()" cv="const">
            <type>boost::reference_wrapper&lt; T &gt; const</type>
            <template>
              <template-type-parameter name="T"/>
            </template>
            <parameter name="t">
              <paramtype>T &amp;</paramtype>
              <description>
                <para>The object to wrap </para>
              </description>
            </parameter>
            <description>
              <para>
                Wrap the parameter <computeroutput>t</computeroutput> in a
                <computeroutput>boost::reference_wrapper&lt;&gt;</computeroutput>
              </para>
            </description>
            <returns>
              <para>
                <computeroutput>boost::ref(t)</computeroutput>
              </para>
            </returns>
            <throws>
              <simpara>Will not throw.</simpara>
            </throws>
          </method>
          <method name="operator()" cv="const">
            <type>boost::reference_wrapper&lt; T const &gt; const</type>
            <template>
              <template-type-parameter name="T"/>
            </template>
            <parameter name="t">
              <paramtype>T const &amp;</paramtype>
            </parameter>
            <description>
              <para>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </para>
            </description>
          </method>
        </method-group>
      </struct>

      <struct name="_byval">
        <inherit><classname>proto::callable</classname></inherit>
        <purpose>
          A unary callable <conceptname>PolymorphicFunctionObject</conceptname> that strips references and
          <computeroutput>boost::reference_wrapper&lt;&gt;</computeroutput> from its argument.
        </purpose>
        <description>
          <para>
            Example:
            <programlisting><classname>proto::terminal</classname>&lt;int&gt;::type i = {42};
int j = 67;
int k = <classname>proto::when</classname>&lt;<classname>proto::_</classname>, proto::_byval(<classname>proto::_state</classname>)&gt;()(i, boost::ref(j));
assert( 67 == k );</programlisting>
          </para>
        </description>
        <struct-specialization name="result">
          <template>
            <template-type-parameter name="This"/>
            <template-type-parameter name="T"/>
          </template>
          <specialization>
            <template-arg>This(boost::reference_wrapper&lt; T &gt;)</template-arg>
          </specialization>
          <inherit>result&lt;This(T)&gt;</inherit>
        </struct-specialization>
        <struct-specialization name="result">
          <template>
            <template-type-parameter name="This"/>
            <template-type-parameter name="T"/>
          </template>
          <specialization>
            <template-arg>This(T &amp;)</template-arg>
          </specialization>
          <inherit>result&lt;This(T)&gt;</inherit>
        </struct-specialization>
        <struct-specialization name="result">
          <template>
            <template-type-parameter name="This"/>
            <template-type-parameter name="T"/>
          </template>
          <specialization>
            <template-arg>This(T)</template-arg>
          </specialization>
          <typedef name="type">
            <type>T</type>
          </typedef>
        </struct-specialization>
        <method-group name="public member functions">
          <method name="operator()" cv="const">
            <type>T</type>
            <template>
              <template-type-parameter name="T"/>
            </template>
            <parameter name="t">
              <paramtype>T const &amp;</paramtype>
              <description>
                <para>The object to unref </para>
              </description>
            </parameter>
            <returns>
              <para>
                <computeroutput>t</computeroutput>
              </para>
            </returns>
            <throws>
              <simpara>Will not throw.</simpara>
            </throws>
          </method>
          <method name="operator()" cv="const">
            <type>T</type>
            <template>
              <template-type-parameter name="T"/>
            </template>
            <parameter name="t">
              <paramtype>boost::reference_wrapper&lt; T &gt; const &amp;</paramtype>
            </parameter>
            <description>
              <para>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </para>
            </description>
          </method>
        </method-group>
      </struct>
    </namespace>
  </namespace>
</header>
