9
3

utility.xml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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/functional/std/utility.hpp">
  9. <para>Defines Proto callables <computeroutput><classname>boost::proto::functional::make_pair</classname></computeroutput>,
  10. <computeroutput><classname>boost::proto::functional::first</classname></computeroutput> and
  11. <computeroutput><classname>boost::proto::functional::second</classname></computeroutput>.</para>
  12. <namespace name="boost">
  13. <namespace name="proto">
  14. <namespace name="functional">
  15. <!-- proto::functional::make_pair -->
  16. <struct name="make_pair">
  17. <purpose>A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes
  18. <computeroutput>std::make_pair()</computeroutput> on its arguments.</purpose>
  19. <description>
  20. <para>
  21. A <conceptname>PolymorphicFunctionObject</conceptname> type that invokes
  22. <computeroutput>std::make_pair()</computeroutput> on its arguments.</para>
  23. </description>
  24. <inherit>
  25. <type><classname>proto::callable</classname></type>
  26. </inherit>
  27. <struct-specialization name="result">
  28. <template>
  29. <template-type-parameter name="This"/>
  30. <template-type-parameter name="First"/>
  31. <template-type-parameter name="Second"/>
  32. </template>
  33. <specialization>
  34. <template-arg>This(First, Second)</template-arg>
  35. </specialization>
  36. <typedef name="type">
  37. <type>std::pair&lt;
  38. typename boost::remove_const&lt;typename boost::remove_reference&lt;First&gt;::type&gt;::type
  39. , typename boost::remove_const&lt;typename boost::remove_reference&lt;Second&gt;::type&gt;::type
  40. &gt;</type>
  41. </typedef>
  42. </struct-specialization>
  43. <method-group name="public member functions">
  44. <method name="operator()" cv="const">
  45. <type>typename std::pair&lt; First, Second &gt;</type>
  46. <template>
  47. <template-type-parameter name="First"/>
  48. <template-type-parameter name="Second"/>
  49. </template>
  50. <parameter name="first">
  51. <paramtype>First const &amp;</paramtype>
  52. </parameter>
  53. <parameter name="second">
  54. <paramtype>Second const &amp;</paramtype>
  55. </parameter>
  56. <returns>
  57. <para><computeroutput>std::make_pair(first, second)</computeroutput></para>
  58. </returns>
  59. </method>
  60. </method-group>
  61. </struct>
  62. <!-- proto::functional::first -->
  63. <struct name="first">
  64. <purpose>
  65. A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
  66. the first element of a <computeroutput>std::pair&lt;&gt;</computeroutput>.
  67. </purpose>
  68. <description>
  69. <para>
  70. A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
  71. the first element of a <computeroutput>std::pair&lt;&gt;</computeroutput>.</para>
  72. </description>
  73. <inherit><type><classname>proto::callable</classname></type>
  74. </inherit>
  75. <struct-specialization name="result">
  76. <template>
  77. <template-type-parameter name="This"/>
  78. <template-type-parameter name="Pair"/>
  79. </template>
  80. <specialization>
  81. <template-arg>This(Pair)</template-arg>
  82. </specialization>
  83. <typedef name="type">
  84. <type>typename Pair::first_type</type>
  85. </typedef>
  86. </struct-specialization>
  87. <struct-specialization name="result">
  88. <template>
  89. <template-type-parameter name="This"/>
  90. <template-type-parameter name="Pair"/>
  91. </template>
  92. <specialization>
  93. <template-arg>This(Pair &amp;)</template-arg>
  94. </specialization>
  95. <typedef name="type">
  96. <type>typename Pair::first_type &amp;</type>
  97. </typedef>
  98. </struct-specialization>
  99. <struct-specialization name="result">
  100. <template>
  101. <template-type-parameter name="This"/>
  102. <template-type-parameter name="Pair"/>
  103. </template>
  104. <specialization>
  105. <template-arg>This(Pair const &amp;)</template-arg>
  106. </specialization>
  107. <typedef name="type">
  108. <type>typename Pair::first_type const &amp;</type>
  109. </typedef>
  110. </struct-specialization>
  111. <method-group name="public member functions">
  112. <method name="operator()" cv="const">
  113. <type>typename Pair::first_type &amp;</type>
  114. <template>
  115. <template-type-parameter name="Pair"/>
  116. </template>
  117. <parameter name="pair">
  118. <paramtype>Pair &amp;</paramtype>
  119. </parameter>
  120. <returns>
  121. <para>
  122. <computeroutput>pair.first</computeroutput>
  123. </para>
  124. </returns>
  125. </method>
  126. <method name="operator()" cv="const">
  127. <type>typename Pair::first_type const &amp;</type>
  128. <template>
  129. <template-type-parameter name="Pair"/>
  130. </template>
  131. <parameter name="pair">
  132. <paramtype>Pair const &amp;</paramtype>
  133. </parameter>
  134. <returns>
  135. <para>
  136. <computeroutput>pair.first</computeroutput>
  137. </para>
  138. </returns>
  139. </method>
  140. </method-group>
  141. </struct>
  142. <!-- proto::functional::second -->
  143. <struct name="second">
  144. <purpose>
  145. A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
  146. the second element of a <computeroutput>std::pair&lt;&gt;</computeroutput>.
  147. </purpose>
  148. <description>
  149. <para>
  150. A <conceptname>PolymorphicFunctionObject</conceptname> type that returns
  151. the second element of a <computeroutput>std::pair&lt;&gt;</computeroutput>.
  152. </para>
  153. </description>
  154. <inherit><type><classname>proto::callable</classname></type></inherit>
  155. <struct-specialization name="result">
  156. <template>
  157. <template-type-parameter name="This"/>
  158. <template-type-parameter name="Pair"/>
  159. </template>
  160. <specialization>
  161. <template-arg>This(Pair)</template-arg>
  162. </specialization>
  163. <typedef name="type">
  164. <type>typename Pair::second_type</type>
  165. </typedef>
  166. </struct-specialization>
  167. <struct-specialization name="result">
  168. <template>
  169. <template-type-parameter name="This"/>
  170. <template-type-parameter name="Pair"/>
  171. </template>
  172. <specialization>
  173. <template-arg>This(Pair &amp;)</template-arg>
  174. </specialization>
  175. <typedef name="type">
  176. <type>typename Pair::second_type &amp;</type>
  177. </typedef>
  178. </struct-specialization>
  179. <struct-specialization name="result">
  180. <template>
  181. <template-type-parameter name="This"/>
  182. <template-type-parameter name="Pair"/>
  183. </template>
  184. <specialization>
  185. <template-arg>This(Pair const &amp;)</template-arg>
  186. </specialization>
  187. <typedef name="type">
  188. <type>typename Pair::second_type const &amp;</type>
  189. </typedef>
  190. </struct-specialization>
  191. <method-group name="public member functions">
  192. <method name="operator()" cv="const">
  193. <type>typename Pair::second_type &amp;</type>
  194. <template>
  195. <template-type-parameter name="Pair"/>
  196. </template>
  197. <parameter name="pair">
  198. <paramtype>Pair &amp;</paramtype>
  199. </parameter>
  200. <returns>
  201. <para>
  202. <computeroutput>pair.second</computeroutput>
  203. </para>
  204. </returns>
  205. </method>
  206. <method name="operator()" cv="const">
  207. <type>typename Pair::second_type const &amp;</type>
  208. <template>
  209. <template-type-parameter name="Pair"/>
  210. </template>
  211. <parameter name="pair">
  212. <paramtype>Pair const &amp;</paramtype>
  213. </parameter>
  214. <returns>
  215. <para>
  216. <computeroutput>pair.second</computeroutput>
  217. </para>
  218. </returns>
  219. </method>
  220. </method-group>
  221. </struct>
  222. </namespace>
  223. </namespace>
  224. </namespace>
  225. </header>