1<?xml version="1.0" ?>
2  <!--
3  Copyright 2008 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<concept name="ObjectTransform" category="utility">
10  <param name="Obj" role="object-type" />
11  <param name="Tn" role="transform-type" />
12  <param name="Expr" role="expression-type" />
13  <param name="State" role="state-type" />
14  <param name="Data" role="data-type" />
15
16  <models-sentence>
17    The type <arg num="1" /> must be a model of <conceptname name="Regular"/>, or
18    else it is a template specialization representing a lamda expression that,
19    subsequent to type substitution, is a type that models <conceptname name="Regular"/>.
20    The type <arg num="2" /> must be a model of <conceptname name="Transform"/>.
21  </models-sentence>
22
23  <description>
24    <para>
25      An ObjectTransform is a function type or a function
26      pointer type where the return type Obj is a
27      an object type and the arguments are
28      Transforms. is_callable&lt; Obj &gt;::value
29      must be false. The ObjectTransform, when applied,
30      has the effect of constructing an object of type
31      Obj' (see below), passing as construction parameters
32      the result(s) of applying transform(s) Tn.
33    </para>
34    <para>
35      The type Obj may be a template specialization representing
36      a compile-time lambda expression. For instance, if Obj is
37      std::pair&lt; proto::_value, int &gt;, the result type of the
38      ObjectTransform is computed by replacing the type proto::_value
39      with the result of applying the proto::_value transform. For
40      given types Obj, Expr, State and Data, we can say that the
41      type Obj' represents the type Obj after all nested transforms
42      have been replaced with the results of applying the transforms
43      with Expr, State and Data as transform arguments.
44    </para>
45    <para>
46      If the type Obj is not a template specialization representing
47      a compile-time lambda expression, then the result type Obj' is
48      the same as Obj.
49    </para>
50  </description>
51
52  <notation variables="expr">
53    <sample-value>
54      <type name="Expr" />
55    </sample-value>
56  </notation>
57
58  <notation variables="state">
59    <sample-value>
60      <type name="State" />
61    </sample-value>
62  </notation>
63
64  <notation variables="data">
65    <sample-value>
66      <type name="Data" />
67    </sample-value>
68  </notation>
69
70  <valid-expression name="Apply Transform">
71    <apply-function name="when&lt; _, Obj(Tn...)&gt;()">
72      <sample-value>
73        <type name="Expr" />
74      </sample-value>
75      <sample-value>
76        <type name="State" />
77      </sample-value>
78      <sample-value>
79        <type name="Data" />
80      </sample-value>
81    </apply-function>
82    <return-type>
83      <require-same-type testable="yes">
84        <type name="Obj'"/>
85      </require-same-type>
86    </return-type>
87    <semantics>Applies the transform.</semantics>
88  </valid-expression>
89
90  <example-model>
91    <type name="std::pair&lt; boost::proto::_value, int &gt;(boost::proto::_value, int())" />
92  </example-model>
93
94</concept>
95