<?xml version="1.0" ?>
<concept name="PrimitiveTransform" category="utility">
  <!--
  Copyright 2008 Eric Niebler

  Distributed under the Boost
  Software License, Version 1.0. (See accompanying
  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  -->
  <param name="Fn" role="primitive-transform-type" />
  <param name="Expr" role="expression-type" />
  <param name="State" role="state-type" />
  <param name="Visitor" role="visitor-type" />

  <models-sentence>
    The type <arg num="1" /> must be a model of <self/>.
  </models-sentence>

  <description>
    <para>A PrimitiveTransform is class type that
    has an overloaded function call operator and 
    uses a narrow subset of the TR1.ResultOf protocol
    for return type calculation. It takes three
    parameters: expression, state and visitor.</para>
  </description>

  <notation variables="fn">
    <sample-value>
      <type name="Fn" />
    </sample-value>
  </notation>

  <notation variables="expr">
    <sample-value>
      <type name="Expr" />
    </sample-value>
  </notation>

  <notation variables="state">
    <sample-value>
      <type name="State" />
    </sample-value>
  </notation>

  <notation variables="visitor">
    <sample-value>
      <type name="Visitor" />
    </sample-value>
  </notation>

  <associated-type name="result_type">
    <get-member-type name="type">
      <apply-template name="typename Fn::template result">
        <apply-function name="Fn">
          <type name="Expr"/>
          <type name="State"/>
          <type name="Visitor"/>
        </apply-function>
      </apply-template>
    </get-member-type>
    <description>
      <simpara>The return type of the overloaded function call operator.</simpara>
    </description>
  </associated-type>

  <valid-expression name="Function Call">
    <apply-function name="fn">
      <sample-value>
        <type name="Expr" />
      </sample-value>
      <sample-value>
        <type name="State" />
      </sample-value>
      <sample-value>
        <type name="Visitor" />
      </sample-value>
    </apply-function>
    <return-type>
      <require-same-type testable="yes">
        <type name="result_type"/>
      </require-same-type>
    </return-type>
    <semantics>Applies the transform.</semantics>
  </valid-expression>

  <example-model>
    <type name="boost::proto::transform::arg_c&lt; 0 &gt;" />
  </example-model>

</concept>
