ObjectTransform.xml 3.1 KB

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