<?xml version="1.0" encoding="utf-8"?>
<header name="boost/proto/expr.hpp">
  <namespace name="boost">
    <namespace name="proto">

      <!-- boost::proto::expr -->

      <struct name="expr">
        <template>
          <template-type-parameter name="Tag"/>
          <template-type-parameter name="Args"/>
          <template-nontype-parameter name="Arity">
            <type>long</type>
            <default>Args::arity</default>
          </template-nontype-parameter>
        </template>

        <purpose>Representation of a node in an expression tree.</purpose>

        <description>
          <para>
            <computeroutput>proto::expr&lt;&gt;</computeroutput> is a node in an expression
            template tree. It is a container for its child sub-trees. It also serves as the
            terminal nodes of the tree.
          </para>
          <para>
            <computeroutput>Tag</computeroutput> is type that represents the operation
            encoded by this expression. It is typically one of the structs in the
            <computeroutput>boost::proto::tag</computeroutput> namespace, but it doesn't
            have to be. If <computeroutput>Arity</computeroutput> is 0 then this
            <computeroutput>expr&lt;&gt;</computeroutput> type represents a leaf in the
            expression tree.
          </para>
          <para>
            <computeroutput>Args</computeroutput> is a list of types representing
            the children of this expression. It is an instantiation of one of
            <computeroutput>proto::list1&lt;&gt;</computeroutput>,
            <computeroutput>proto::list2&lt;&gt;</computeroutput>, etc. The child types
            must all themselves be either <computeroutput>expr&lt;&gt;</computeroutput>
            or <computeroutput>proto::expr&lt;&gt;&amp;</computeroutput>, unless
            <computeroutput>Arity</computeroutput> is 0, in which case
            <computeroutput>Args</computeroutput> must be
            <computeroutput>proto::term&lt;T&gt;</computeroutput>, where
            <computeroutput>T</computeroutput> can be any type.
          </para>
          <para>
            <computeroutput>proto::expr&lt;&gt;</computeroutput> is a valid Fusion
            random-access sequence, where the elements of the sequence are the child
            expressions.
          </para>
        </description>

        <!-- typedefs -->

        <typedef name="proto_tag">
          <type>Tag</type>
        </typedef>

        <typedef name="proto_args">
          <type>Args</type>
        </typedef>

        <typedef name="proto_arity">
          <type>mpl::long_&lt; Arity &gt;</type>
        </typedef>

        <typedef name="proto_domain">
          <type><classname>default_domain</classname></type>
        </typedef>

        <typedef name="proto_base_expr">
          <type>expr</type>
        </typedef>

        <typedef name="proto_derived_expr">
          <type>expr</type>
        </typedef>

        <typedef name="proto_childN">
          <type>typename Args::child<replaceable>N</replaceable></type>
          <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(Arity,1))</replaceable>.</purpose>
        </typedef>

        <struct name="result">
          <template>
            <template-type-parameter name="Signature"/>
          </template>
          <description>
            <para>
              Encodes the return type of <computeroutput>expr&lt;&gt;::operator()</computeroutput>.
              Makes <computeroutput>expr&lt;&gt;</computeroutput> a TR1-style function object type
              usable with <computeroutput>boost::result_of&lt;&gt;</computeroutput>
            </para>
          </description>
          <typedef name="type">
            <type><replaceable>unspecified</replaceable></type>
          </typedef>
        </struct>

        <method-group name="public static functions">

          <!-- make -->
          <method name="make">
            <type>static expr const</type>
            <template>
              <template-type-parameter name="A" pack="1"/>
            </template>
            <parameter name="a" pack="1">
              <paramtype>A const &amp;</paramtype>
            </parameter>
            <requires>
              <para>
                The number of supplied arguments must be <computeroutput>Arity</computeroutput>.
              </para>
            </requires>
            <returns>
              <para>
                A new <computeroutput>expr</computeroutput> object initialized with the specified arguments.
              </para>
            </returns>
          </method>

        </method-group>

        <method-group name="public member functions">

          <method name="proto_base">
            <type>expr &amp;</type>
            <returns><para><computeroutput>*this</computeroutput></para></returns>
          </method>

          <method name="proto_base" cv="const">
            <type>expr const &amp;</type>
            <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>

          <!-- operator= -->
          <method name="operator=">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A &amp;</paramtype>
            </parameter>
            <description>
              <para>Lazy assignment expression</para>
            </description>
            <returns>
              <para>A new expression node representing the assignment operation.</para>
            </returns>
          </method>

          <method name="operator=">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A 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 name="operator=" cv="const">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A &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 name="operator=" cv="const">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A 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>

          <!-- operator[] -->
          <method name="operator[]">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A &amp;</paramtype>
            </parameter>
            <description>
              <para>Lazy subscript expression</para>
            </description>
            <returns>
              <para>A new expression node representing the subscript operation.</para>
            </returns>
          </method>

          <method name="operator[]">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A 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 name="operator[]" cv="const">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A &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 name="operator[]" cv="const">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A"/>
            </template>
            <parameter name="a">
              <paramtype>A 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>

          <!-- operator() -->
          <method name="operator()">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A" pack="1"/>
            </template>
            <parameter name="a" pack="1">
              <paramtype>A const &amp;</paramtype>
            </parameter>
            <description>
              <para>Lazy function call</para>
            </description>
            <returns>
              <para>A new expression node representing the function call operation.</para>
            </returns>
          </method>

          <method name="operator()" cv="const">
            <type><replaceable>unspecified</replaceable></type>
            <template>
              <template-type-parameter name="A" pack="1"/>
            </template>
            <parameter name="a" pack="1">
              <paramtype>A 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>

        <data-member name="childN">
          <type>proto_child<replaceable>N</replaceable></type>
          <purpose>For each <replaceable>N</replaceable> in <replaceable>[0,max(Arity,1))</replaceable>.</purpose>
        </data-member>

      </struct>

      <!-- proto::unexpr -->
      <struct name="unexpr">
        <template>
          <template-type-parameter name="Expr"/>
        </template>
        <purpose>Lets you inherit the interface of an expression while hiding from Proto the fact that
          the type is a Proto expression.</purpose>
        <method-group name="public member functions"/>
        <constructor>
          <parameter name="expr">
            <paramtype>Expr const &amp;</paramtype>
          </parameter>
        </constructor>
      </struct>

    </namespace>
  </namespace>
</header>
