fusion.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Copyright 2012 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. <header name="boost/proto/fusion.hpp">
  9. <para>Make any Proto expression a valid Fusion sequence </para>
  10. <namespace name="boost">
  11. <namespace name="proto">
  12. <namespace name="functional">
  13. <!-- proto::functional::flatten -->
  14. <struct name="flatten">
  15. <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened"
  16. view of a Proto expression tree. </purpose>
  17. <description>
  18. <para>
  19. A <conceptname>PolymorphicFunctionObject</conceptname> type that returns a "flattened" view
  20. of a Proto expression tree. For a tree with a top-most node tag of type
  21. <computeroutput>T</computeroutput>, the elements of the flattened sequence are determined by
  22. recursing into each child node with the same tag type and returning those nodes of different
  23. type. So for instance, the Proto expression tree corresponding to the expression
  24. <computeroutput>a | b | c</computeroutput> has a flattened view with elements [a, b, c], even
  25. though the tree is grouped as <computeroutput>((a | b) | c)</computeroutput>.
  26. </para>
  27. <para>
  28. The resulting view is a Fusion Forward Sequence.
  29. </para>
  30. </description>
  31. <inherit>
  32. <type><classname>proto::callable</classname></type>
  33. </inherit>
  34. <struct-specialization name="result">
  35. <template>
  36. <template-type-parameter name="This"/>
  37. <template-type-parameter name="Expr"/>
  38. </template>
  39. <specialization>
  40. <template-arg>This(Expr)</template-arg>
  41. </specialization>
  42. <inherit>
  43. <type>result&lt; This(Expr const &amp;) &gt;</type>
  44. </inherit>
  45. </struct-specialization>
  46. <struct-specialization name="result">
  47. <template>
  48. <template-type-parameter name="This"/>
  49. <template-type-parameter name="Expr"/>
  50. </template>
  51. <specialization>
  52. <template-arg>This(Expr &amp;)</template-arg>
  53. </specialization>
  54. <inherit>
  55. <type><classname>proto::result_of::flatten</classname>&lt; Expr &gt;</type>
  56. </inherit>
  57. </struct-specialization>
  58. <method-group name="public member functions">
  59. <method name="operator()" cv="const">
  60. <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr &gt;::type const</type>
  61. <template>
  62. <template-type-parameter name="Expr"/>
  63. </template>
  64. <parameter name="expr">
  65. <paramtype>Expr &amp;</paramtype>
  66. </parameter>
  67. <description>
  68. <para>
  69. Returns a Fusion Forward Sequence representing a flattened view of <computeroutput>expr</computeroutput>.
  70. </para>
  71. </description>
  72. </method>
  73. <method name="operator()" cv="const">
  74. <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type const</type>
  75. <template>
  76. <template-type-parameter name="Expr"/>
  77. </template>
  78. <parameter name="expr">
  79. <paramtype>Expr const &amp;</paramtype>
  80. </parameter>
  81. <description>
  82. <para>
  83. Returns a Fusion Forward Sequence representing a flattened view of <computeroutput>expr</computeroutput>.
  84. </para>
  85. </description>
  86. </method>
  87. </method-group>
  88. </struct>
  89. </namespace>
  90. <namespace name="result_of">
  91. <!-- proto::result_of::flatten -->
  92. <struct name="flatten">
  93. <template>
  94. <template-type-parameter name="Expr"/>
  95. </template>
  96. <purpose>Metafunction that computes the return type of <computeroutput>
  97. <functionname alt="proto::flatten">proto::flatten()</functionname></computeroutput></purpose>
  98. <typedef name="type">
  99. <type><emphasis>unspecified</emphasis></type>
  100. <purpose>A Fusion Forward Sequence</purpose>
  101. </typedef>
  102. </struct>
  103. </namespace>
  104. <!-- proto::flatten() -->
  105. <overloaded-function name="flatten">
  106. <signature>
  107. <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr &gt;::type const</type>
  108. <template>
  109. <template-type-parameter name="Expr"/>
  110. </template>
  111. <parameter name="expr">
  112. <paramtype>Expr &amp;</paramtype>
  113. </parameter>
  114. </signature>
  115. <signature>
  116. <type>typename <classname>proto::result_of::flatten</classname>&lt; Expr const &gt;::type const</type>
  117. <template>
  118. <template-type-parameter name="Expr"/>
  119. </template>
  120. <parameter name="expr">
  121. <paramtype>Expr const &amp;</paramtype>
  122. </parameter>
  123. </signature>
  124. <purpose>A function that returns a "flattened" view of a Proto expression tree. </purpose>
  125. <description>
  126. <para>
  127. For a tree with a top-most node tag of type <computeroutput>T</computeroutput>, the elements
  128. of the flattened sequence are determined by recursing into each child node with the same tag
  129. type and returning those nodes of different type. So for instance, the Proto expression tree
  130. corresponding to the expression <computeroutput>a | b | c</computeroutput> has a flattened
  131. view with elements [a, b, c], even though the tree is grouped as
  132. <computeroutput>((a | b) | c)</computeroutput>.
  133. </para>
  134. <para>
  135. The returned view is a Fusion Forward Sequence.
  136. </para>
  137. </description>
  138. </overloaded-function>
  139. </namespace>
  140. </namespace>
  141. </header>