﻿<?xml version="1.0" encoding="utf-8"?>
<header name="boost/proto/fusion.hpp">
  <para>Make any Proto expression a valid Fusion sequence </para>
  <namespace name="boost">
    <namespace name="proto">
      <namespace name="functional">

        <!-- proto::functional::flatten -->
        <struct name="flatten">
          <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened"
            view of a Proto expression tree. </purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened" view
              of a Proto expression tree. For a tree with a top-most node tag of type
              <computeroutput>T</computeroutput>, the elements of the flattened sequence are determined by
              recursing into each child node with the same tag type and returning those nodes of different
              type. So for instance, the Proto expression tree corresponding to the expression
              <computeroutput>a | b | c</computeroutput> has a flattened view with elements [a, b, c], even
              though the tree is grouped as <computeroutput>((a | b) | c)</computeroutput>.
            </para>
          </description>
          <inherit>
            <type><classname>proto::callable</classname></type>
          </inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Expr"/>
            </template>
            <specialization>
              <template-arg>This(Expr)</template-arg>
            </specialization>
            <inherit>
              <type>
    <classname>proto::result_of::flatten</classname>&lt;
      typename boost::remove_reference&lt; Expr &gt;::type
    &gt;</type>
            </inherit>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type</type>
              <template>
                <template-type-parameter name="Expr"/>
              </template>
              <parameter name="expr">
                <paramtype>Expr const &amp;</paramtype>
              </parameter>
            </method>
          </method-group>
        </struct>

        <!-- proto::functional::pop_front -->
        <struct name="pop_front">
          <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
            <computeroutput>fusion::pop_front()</computeroutput> algorithm on its argument.</purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
              <computeroutput>fusion::pop_front()</computeroutput> algorithm on its argument. This is
              useful for defining a <conceptname>CallableTransform</conceptname> such as
              <computeroutput>pop_front(_)</computeroutput>, which removes the first child from a Proto
              expression node. Such a transform might be used as the first argument to the
              <computeroutput><classname alt="proto::fold">proto::fold&lt;&gt;</classname></computeroutput>
              transform; that is, fold all but the first child.
            </para>
          </description>
          <inherit>
            <type><classname>proto::callable</classname></type>
          </inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Expr"/>
            </template>
            <specialization>
              <template-arg>This(Expr)</template-arg>
            </specialization>
            <inherit>
              <type>
    fusion::result_of::pop_front&lt;
      typename boost::remove_reference&lt; Expr &gt;::type const
    &gt;</type>
            </inherit>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename fusion::result_of::pop_front&lt; Expr const  &gt;::type</type>
              <template>
                <template-type-parameter name="Expr"/>
              </template>
              <parameter name="expr">
                <paramtype>Expr const &amp;</paramtype>
              </parameter>
            </method>
          </method-group>
        </struct>

        <!-- proto::functional::reverse -->
        <struct name="reverse">
          <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
            <computeroutput>fusion::reverse()</computeroutput> algorithm on its argument.
          </purpose>
          <description>
            <para>
              A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes the
              <computeroutput>fusion::reverse()</computeroutput> algorithm on its argument. This is
              useful for defining a <conceptname>CallableTransform</conceptname> like
              <computeroutput>reverse(_)</computeroutput>, which reverses the order of the children
              of a Proto expression node.
            </para>
          </description>
          <inherit>
            <type><classname>proto::callable</classname></type>
          </inherit>
          <struct-specialization name="result">
            <template>
              <template-type-parameter name="This"/>
              <template-type-parameter name="Expr"/>
            </template>
            <specialization>
              <template-arg>This(Expr)</template-arg>
            </specialization>
            <inherit>
              <type>
    fusion::result_of::reverse&lt;
      typename boost::remove_reference&lt; Expr &gt;::type const 
    &gt;</type>
            </inherit>
          </struct-specialization>
          <method-group name="public member functions">
            <method name="operator()" cv="const">
              <type>typename fusion::result_of::reverse&lt; Expr const  &gt;::type</type>
              <template>
                <template-type-parameter name="Expr"/>
              </template>
              <parameter name="expr">
                <paramtype>Expr const &amp;</paramtype>
              </parameter>
            </method>
          </method-group>
        </struct>
      </namespace>
      
      <namespace name="result_of">
        <!-- proto::result_of::flatten -->
        <struct name="flatten">
          <template>
            <template-type-parameter name="Expr"/>
          </template>
          <purpose>Metafunction that computes the return type of <computeroutput>
            <functionname alt="proto::flatten">proto::flatten()</functionname></computeroutput></purpose>
          <typedef name="type">
            <type><emphasis>unspecified</emphasis></type>
          </typedef>
        </struct>
      </namespace>

      <!-- proto::flatten() -->
      <function name="flatten">
        <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type</type>
        <template>
          <template-type-parameter name="Expr"/>
        </template>
        <parameter name="expr">
          <paramtype>Expr const &amp;</paramtype>
        </parameter>
        <purpose>A function that returns a "flattened" view of a Proto expression tree. </purpose>
        <description>
          <para>
            For a tree with a top-most node tag of type <computeroutput>T</computeroutput>, the elements
            of the flattened sequence are determined by recursing into each child node with the same tag
            type and returning those nodes of different type. So for instance, the Proto expression tree
            corresponding to the expression <computeroutput>a | b | c</computeroutput> has a flattened
            view with elements [a, b, c], even though the tree is grouped as
            <computeroutput>((a | b) | c)</computeroutput>.
          </para>
        </description>
      </function>
    </namespace>
  </namespace>
</header>
