tti_reference.xml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. <?xml version="1.0" standalone="yes"?>
  2. <library-reference id="reference"><title>Reference</title><header name="boost/tti/gen/has_data_gen.hpp">
  3. <macro name="BOOST_TTI_HAS_DATA_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_DATA. </purpose><description><para>name = the name of the member data.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  4. </header>
  5. <header name="boost/tti/gen/has_function_gen.hpp">
  6. <macro name="BOOST_TTI_HAS_FUNCTION_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_FUNCTION. </purpose><description><para>name = the name of the static member function.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  7. </header>
  8. <header name="boost/tti/gen/has_member_data_gen.hpp">
  9. <macro name="BOOST_TTI_HAS_MEMBER_DATA_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_DATA. </purpose><description><para>name = the name of the member data.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  10. </header>
  11. <header name="boost/tti/gen/has_member_function_gen.hpp">
  12. <macro name="BOOST_TTI_HAS_MEMBER_FUNCTION_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_MEMBER_FUNCTION. </purpose><description><para>name = the name of the member function.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  13. </header>
  14. <header name="boost/tti/gen/has_static_member_data_gen.hpp">
  15. <macro name="BOOST_TTI_HAS_STATIC_MEMBER_DATA_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_DATA. </purpose><description><para>name = the name of the static member data.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  16. </header>
  17. <header name="boost/tti/gen/has_static_member_function_gen.hpp">
  18. <macro name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION. </purpose><description><para>name = the name of the static member function.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  19. </header>
  20. <header name="boost/tti/gen/has_template_gen.hpp">
  21. <macro name="BOOST_TTI_HAS_TEMPLATE_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_TEMPLATE. </purpose><description><para>name = the name of the class template.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  22. </header>
  23. <header name="boost/tti/gen/has_type_gen.hpp">
  24. <macro name="BOOST_TTI_HAS_TYPE_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_HAS_TYPE. </purpose><description><para>name = the name of the type.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  25. </header>
  26. <header name="boost/tti/gen/member_type_gen.hpp">
  27. <macro name="BOOST_TTI_MEMBER_TYPE_GEN" kind="functionlike"><macro-parameter name="name"/><purpose>Generates the macro metafunction name for BOOST_TTI_MEMBER_TYPE. </purpose><description><para>name = the name of the inner type.</para><para>returns = the generated macro metafunction name. </para></description></macro>
  28. </header>
  29. <header name="boost/tti/gen/namespace_gen.hpp">
  30. <macro name="BOOST_TTI_NAMESPACE"><purpose>Generates the name of the Boost TTI namespace. </purpose><description><para>returns = the generated name of the Boost TTI namespace. </para></description></macro>
  31. </header>
  32. <header name="boost/tti/has_data.hpp">
  33. <macro name="BOOST_TTI_TRAIT_HAS_DATA" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether member data or static member with a particular name and type exists. </purpose><description><para>trait = the name of the metafunction.</para><para>name = the name of the inner member to introspect.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE&gt;
  34. struct trait
  35. {
  36. static const value = unspecified;
  37. typedef mpl::bool_&lt;true-or-false&gt; type;
  38. };
  39. The metafunction types and return:
  40. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
  41. BOOST_TTI_TP_TYPE = The type of the member data or static member.
  42. returns = 'value' is true if the 'name' exists, with the correct data type,
  43. otherwise 'value' is false.
  44. </para></description></macro>
  45. <macro name="BOOST_TTI_HAS_DATA" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether member data or static member data with a particular name and type exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_data_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_TYPE&gt;
  46. struct has_data_name
  47. {
  48. static const value = unspecified;
  49. typedef mpl::bool_&lt;true-or-false&gt; type;
  50. };
  51. The metafunction types and return:
  52. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
  53. BOOST_TTI_TP_TYPE = The type of the member data or static member.
  54. returns = 'value' is true if the 'name' exists, with the correct data type,
  55. otherwise 'value' is false.
  56. </para></description></macro>
  57. </header>
  58. <header name="boost/tti/has_function.hpp">
  59. <macro name="BOOST_TTI_TRAIT_HAS_FUNCTION" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists. </purpose><description><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner member.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG&gt;
  60. struct trait
  61. {
  62. static const value = unspecified;
  63. typedef mpl::bool_&lt;true-or-false&gt; type;
  64. };
  65. The metafunction types and return:
  66. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  67. BOOST_TTI_TP_R = the return type of the function
  68. BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence
  69. if function parameters are not empty.
  70. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function
  71. if the need for a tag exists.
  72. returns = 'value' is true if the 'name' exists,
  73. with the appropriate static member function type,
  74. otherwise 'value' is false.
  75. </para></description></macro>
  76. <macro name="BOOST_TTI_HAS_FUNCTION" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_function_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG&gt;
  77. struct trait
  78. {
  79. static const value = unspecified;
  80. typedef mpl::bool_&lt;true-or-false&gt; type;
  81. };
  82. The metafunction types and return:
  83. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  84. BOOST_TTI_TP_R = the return type of the function
  85. BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence
  86. if function parameters are not empty.
  87. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function
  88. if the need for a tag exists.
  89. returns = 'value' is true if the 'name' exists,
  90. with the appropriate function type,
  91. otherwise 'value' is false.
  92. </para></description></macro>
  93. </header>
  94. <header name="boost/tti/has_member_data.hpp">
  95. <macro name="BOOST_TTI_TRAIT_HAS_MEMBER_DATA" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member data with a particular name and type exists. </purpose><description><para>trait = the name of the metafunction.</para><para>name = the name of the inner member to introspect.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE&gt;
  96. struct trait
  97. {
  98. static const value = unspecified;
  99. typedef mpl::bool_&lt;true-or-false&gt; type;
  100. };
  101. The metafunction types and return:
  102. BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name'
  103. OR
  104. The type of the member data in the form of a pointer
  105. to member data.
  106. BOOST_TTI_TP_TYPE = (optional) The type of the member data if the first
  107. parameter is the enclosing type.
  108. returns = 'value' is true if the 'name' exists, with the correct data type,
  109. otherwise 'value' is false.
  110. </para></description></macro>
  111. <macro name="BOOST_TTI_HAS_MEMBER_DATA" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member data with a particular name and type exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_member_data_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_ET,class BOOST_TTI_TP_TYPE&gt;
  112. struct has_member_data_name
  113. {
  114. static const value = unspecified;
  115. typedef mpl::bool_&lt;true-or-false&gt; type;
  116. };
  117. The metafunction types and return:
  118. BOOST_TTI_TP_ET = the enclosing type in which to look for our 'name'
  119. OR
  120. The type of the member data in the form of a pointer
  121. to member data.
  122. BOOST_TTI_TP_TYPE = (optional) The type of the member data if the first
  123. parameter is the enclosing type.
  124. returns = 'value' is true if the 'name' exists, with the correct data type,
  125. otherwise 'value' is false.
  126. </para></description></macro>
  127. </header>
  128. <header name="boost/tti/has_member_function.hpp">
  129. <macro name="BOOST_TTI_TRAIT_HAS_MEMBER_FUNCTION" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member function with a particular name and signature exists. </purpose><description><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner member.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter.<sbr/>
  130. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_R,class BOOST_TTI_FS,class BOOST_TTI_TAG&gt;
  131. struct trait
  132. {
  133. static const value = unspecified;
  134. typedef mpl::bool_&lt;true-or-false&gt; type;
  135. };
  136. The metafunction types and return:
  137. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
  138. OR
  139. a pointer to member function as a single type.
  140. BOOST_TTI_TP_R = (optional) the return type of the member function
  141. if the first parameter is the enclosing type.
  142. BOOST_TTI_TP_FS = (optional) the parameters of the member function as a boost::mpl forward sequence
  143. if the first parameter is the enclosing type and the member function parameters
  144. are not empty.
  145. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function
  146. if the first parameter is the enclosing type and a tag is needed.
  147. returns = 'value' is true if the 'name' exists,
  148. with the appropriate member function type,
  149. otherwise 'value' is false.
  150. </para></description></macro>
  151. <macro name="BOOST_TTI_HAS_MEMBER_FUNCTION" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a member function with a particular name and signature exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_member_function_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG&gt;
  152. struct has_member_function_name
  153. {
  154. static const value = unspecified;
  155. typedef mpl::bool_&lt;true-or-false&gt; type;
  156. };
  157. The metafunction types and return:
  158. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'
  159. OR
  160. a pointer to member function as a single type.
  161. BOOST_TTI_TP_R = (optional) the return type of the member function
  162. if the first parameter is the enclosing type.
  163. BOOST_TTI_TP_FS = (optional) the parameters of the member function as a boost::mpl forward sequence
  164. if the first parameter is the enclosing type and the member function parameters
  165. are not empty.
  166. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the member function
  167. if the first parameter is the enclosing type and a tag is needed.
  168. returns = 'value' is true if the 'name' exists,
  169. with the appropriate member function type,
  170. otherwise 'value' is false.
  171. </para></description></macro>
  172. </header>
  173. <header name="boost/tti/has_static_member_data.hpp">
  174. <macro name="BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_DATA" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a static member data with a particular name and type exists. </purpose><description><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner member.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. The metafunction types and return:
  175. BOOST_TTI_TP_T = the enclosing type.
  176. BOOST_TTI_TP_TYPE = the static member data type,
  177. in the form of a data type,
  178. in which to look for our 'name'.
  179. returns = 'value' is true if the 'name' exists,
  180. with the BOOST_TTI_TP_TYPE type,
  181. within the enclosing BOOST_TTI_TP_T type,
  182. otherwise 'value' is false.
  183. </para></description></macro>
  184. <macro name="BOOST_TTI_HAS_STATIC_MEMBER_DATA" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a static member data with a particular name and type exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_static_member_data_name" where 'name' is the macro parameter. The metafunction types and return:
  185. BOOST_TTI_TP_T = the enclosing type.
  186. BOOST_TTI_TP_TYPE = the static member data type,
  187. in the form of a data type,
  188. in which to look for our 'name'.
  189. returns = 'value' is true if the 'name' exists,
  190. with the appropriate BOOST_TTI_TP_TYPE type,
  191. within the enclosing BOOST_TTI_TP_T type,
  192. otherwise 'value' is false.
  193. </para></description></macro>
  194. </header>
  195. <header name="boost/tti/has_static_member_function.hpp">
  196. <macro name="BOOST_TTI_TRAIT_HAS_STATIC_MEMBER_FUNCTION" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a static member function with a particular name and signature exists. </purpose><description><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner member.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG&gt;
  197. struct trait
  198. {
  199. static const value = unspecified;
  200. typedef mpl::bool_&lt;true-or-false&gt; type;
  201. };
  202. The metafunction types and return:
  203. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  204. BOOST_TTI_TP_R = the return type of the static member function
  205. OR
  206. the signature of a function in the form of Return_Type ( Parameter_Types )
  207. BOOST_TTI_TP_FS = (optional) the parameters of the static member function as a boost::mpl forward sequence
  208. if the second parameter is a return type and the function parameters exist.
  209. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function
  210. if the second parameter is a return type and the need for a tag exists.
  211. returns = 'value' is true if the 'name' exists,
  212. with the appropriate static member function type,
  213. otherwise 'value' is false.
  214. </para></description></macro>
  215. <macro name="BOOST_TTI_HAS_STATIC_MEMBER_FUNCTION" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction which tests whether a static member function with a particular name and signature exists. </purpose><description><para>name = the name of the inner member.</para><para>generates a metafunction called "has_static_member_function_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG&gt;
  216. struct trait
  217. {
  218. static const value = unspecified;
  219. typedef mpl::bool_&lt;true-or-false&gt; type;
  220. };
  221. The metafunction types and return:
  222. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  223. BOOST_TTI_TP_R = the return type of the static member function
  224. OR
  225. the signature of a function in the form of Return_Type ( Parameter_Types )
  226. BOOST_TTI_TP_FS = (optional) the parameters of the static member function as a boost::mpl forward sequence
  227. if the second parameter is a return type and the function parameters exist.
  228. BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the static member function
  229. if the second parameter is a return type and the need for a tag exists.
  230. returns = 'value' is true if the 'name' exists,
  231. with the appropriate static member function type,
  232. otherwise 'value' is false.
  233. </para></description></macro>
  234. </header>
  235. <header name="boost/tti/has_template.hpp">
  236. <macro name="BOOST_TTI_TRAIT_HAS_TEMPLATE" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="..."/><purpose>Expands to a metafunction which tests whether an inner class template with a particular name exists. </purpose><description><para>trait = the name of the metafunction. ... = variadic parameters. The first variadic parameter is the inner class template name.
  237. Following variadic parameters are optional.
  238. If no following variadic parameters exist, then the inner class template
  239. being introspected must be all template type parameters ( template parameters
  240. starting with `class` or `typename` ) and any number of template type parameters
  241. can occur.
  242. If the second variadic parameter is BOOST_PP_NIL and no other variadic
  243. parameter is given, then just as in the previous case the inner class template
  244. being introspected must be all template type parameters ( template parameters
  245. starting with `class` or `typename` ) and any number of template type parameters
  246. can occur. This form is allowed in order to be consistent with using the
  247. non-variadic form of this macro.
  248. If the second variadic parameter is a Boost preprocessor library array and no other
  249. variadic parameter is given, then the inner class template must have its template
  250. parameters matching the sequence in the tuple portion of the Boost PP array. This
  251. form is allowed in order to be consistent with using the non-variadic form of this
  252. macro.
  253. Otherwise the inner class template must have its template parameters matching the
  254. sequence of the optional variadic parameters.
  255. </para><para>generates a metafunction called "trait" where 'trait' is the first macro parameter. template&lt;class BOOST_TTI_TP_T&gt;
  256. struct trait
  257. {
  258. static const value = unspecified;
  259. typedef mpl::bool_&lt;true-or-false&gt; type;
  260. };
  261. The metafunction types and return:
  262. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  263. returns = 'value' is true if the 'name' template exists within the enclosing type,
  264. otherwise 'value' is false.
  265. </para><para>Examples:</para><para>1) Search for an inner class template called 'MyTemplate', with all template type parameters, nested within the class 'MyClass' using a metafunction name of 'MyMeta'.</para><para>BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate)</para><para>or</para><para>BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,BOOST_PP_NIL) // Non-variadic macro form</para><para>MyMeta&lt;MyClass&gt;::value</para><para>is a compile time boolean constant which is either 'true' or 'false' if the nested template exists.</para><para>2) Search for an inner class template called 'MyTemplate', with template parameters of 'class T,int x,template&lt;class&gt; class U', nested within the class 'MyClass' using a metafunction name of 'MyMeta'.</para><para>BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,class,int,template&lt;class&gt; class)</para><para>or</para><para>BOOST_TTI_TRAIT_HAS_TEMPLATE(MyMeta,MyTemplate,(3,(class,int,template&lt;class&gt; class))) // Non-variadic macro form</para><para>MyMeta&lt;MyClass&gt;::value</para><para>is a compile time boolean constant which is either 'true' or 'false' if the nested template exists. </para></description></macro>
  266. <macro name="BOOST_TTI_HAS_TEMPLATE" kind="functionlike"><macro-parameter name="..."/><purpose>Expands to a metafunction which tests whether an inner class template with a particular name exists. </purpose><description><para>... = variadic parameters. The first variadic parameter is the inner class template name.
  267. Following variadic parameters are optional.
  268. If no following variadic parameters exist, then the inner class template
  269. being introspected must be all template type parameters ( template parameters
  270. starting with `class` or `typename` ) and any number of template type parameters
  271. can occur.
  272. If the second variadic parameter is BOOST_PP_NIL and no other variadic
  273. parameter is given, then just as in the previous case the inner class template
  274. being introspected must be all template type parameters ( template parameters
  275. starting with `class` or `typename` ) and any number of template type parameters
  276. can occur. This form is allowed in order to be consistent with using the
  277. non-variadic form of this macro.
  278. If the second variadic parameter is a Boost preprocessor library array and no other
  279. variadic parameter is given, then the inner class template must have its template
  280. parameters matching the sequence in the tuple portion of the Boost PP array. This
  281. form is allowed in order to be consistent with using the non-variadic form of this
  282. macro.
  283. Otherwise the inner class template must have its template parameters matching the
  284. sequence of the optional variadic parameters.
  285. </para><para>generates a metafunction called "has_template_'name'" where 'name' is the first variadic parameter. template&lt;class BOOST_TTI_TP_T&gt;
  286. struct has_template_'name'
  287. {
  288. static const value = unspecified;
  289. typedef mpl::bool_&lt;true-or-false&gt; type;
  290. };
  291. The metafunction types and return:
  292. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  293. returns = 'value' is true if the 'name' template exists within the enclosing type,
  294. otherwise 'value' is false.
  295. </para><para>Examples:</para><para>1) Search for an inner class template called 'MyTemplate', with all template type parameters, nested within the class 'MyClass'.</para><para>BOOST_TTI_HAS_TEMPLATE(MyTemplate)</para><para>or</para><para>BOOST_TTI_HAS_TEMPLATE(MyTemplate,BOOST_PP_NIL) // Non-variadic macro form</para><para>has_template_MyTemplate&lt;MyClass&gt;::value</para><para>is a compile time boolean constant which is either 'true' or 'false' if the nested template exists.</para><para>2) Search for an inner class template called 'MyTemplate' with template parameters of 'class T,int x,template&lt;class&gt; class U' nested within the class 'MyClass'.</para><para>BOOST_TTI_HAS_TEMPLATE(MyTemplate,class,int,template&lt;class&gt; class)</para><para>or</para><para>BOOST_TTI_HAS_TEMPLATE(MyTemplate,(3,(class,int,template&lt;class&gt; class))) // Non-variadic macro form</para><para>has_template_MyTemplate&lt;MyClass&gt;::value</para><para>is a compile time boolean constant which is either 'true' or 'false' if the nested template exists. </para></description></macro>
  296. </header>
  297. <header name="boost/tti/has_type.hpp">
  298. <macro name="BOOST_TTI_TRAIT_HAS_TYPE" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><description><para>BOOST_TTI_TRAIT_HAS_TYPE is a macro which expands to a metafunction. The metafunction tests whether an inner type with a particular name exists and, optionally, whether a lambda expression invoked with the inner type is true or not.</para><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner type.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_U&gt;
  299. struct trait
  300. {
  301. static const value = unspecified;
  302. typedef mpl::bool_&lt;true-or-false&gt; type;
  303. };
  304. The metafunction types and return:
  305. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  306. BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
  307. If specified it is an MPL lambda expression which is invoked
  308. with the inner type found and must return a constant boolean
  309. value.
  310. returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
  311. If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' type
  312. exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
  313. If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists
  314. within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified
  315. by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns
  316. a 'value' of true; otherwise 'value' is false.
  317. The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists
  318. within the enclosing type BOOST_TTI_TP_T.
  319. </para><para>Example usage:</para><para>BOOST_TTI_TRAIT_HAS_TYPE(LookFor,MyType) generates the metafunction LookFor in the current scope to look for an inner type called MyType.</para><para>LookFor&lt;EnclosingType&gt;::value is true if MyType is an inner type of EnclosingType, otherwise false.</para><para>LookFor&lt;EnclosingType,ALambdaExpression&gt;::value is true if MyType is an inner type of EnclosingType and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.</para><para>A popular use of the optional MPL lambda expression is to check whether the type found is the same</para><para>as another type, when the type found is a typedef. In that case our example would be:</para><para>LookFor&lt;EnclosingType,boost::is_same&lt;_,SomeOtherType&gt; &gt;::value is true if MyType is an inner type of EnclosingType and is the same type as SomeOtherType. </para></description></macro>
  320. <macro name="BOOST_TTI_HAS_TYPE" kind="functionlike"><macro-parameter name="name"/><description><para>BOOST_TTI_HAS_TYPE is a macro which expands to a metafunction. The metafunction tests whether an inner type with a particular name exists and, optionally, whether a lambda expression invoked with the inner type is true or not.</para><para>name = the name of the inner type.</para><para>generates a metafunction called "has_type_'name'" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_U&gt;
  321. struct has_type_'name'
  322. {
  323. static const value = unspecified;
  324. typedef mpl::bool_&lt;true-or-false&gt; type;
  325. };
  326. The metafunction types and return:
  327. BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
  328. BOOST_TTI_TP_U = (optional) An optional template parameter, defaulting to a marker type.
  329. If specified it is an MPL lambda expression which is invoked
  330. with the inner type found and must return a constant boolean
  331. value.
  332. returns = 'value' depends on whether or not the optional BOOST_TTI_TP_U is specified.
  333. If BOOST_TTI_TP_U is not specified, then 'value' is true if the 'name' type
  334. exists within the enclosing type BOOST_TTI_TP_T; otherwise 'value' is false.
  335. If BOOST_TTI_TP_U is specified , then 'value' is true if the 'name' type exists
  336. within the enclosing type BOOST_TTI_TP_T and the lambda expression as specified
  337. by BOOST_TTI_TP_U, invoked by passing the actual inner type of 'name', returns
  338. a 'value' of true; otherwise 'value' is false.
  339. The action taken with BOOST_TTI_TP_U occurs only when the 'name' type exists
  340. within the enclosing type BOOST_TTI_TP_T.
  341. </para><para>Example usage:</para><para>BOOST_TTI_HAS_TYPE(MyType) generates the metafunction has_type_MyType in the current scope to look for an inner type called MyType.</para><para>has_type_MyType&lt;EnclosingType&gt;::value is true if MyType is an inner type of EnclosingType, otherwise false.</para><para>has_type_MyType&lt;EnclosingType,ALambdaExpression&gt;::value is true if MyType is an inner type of EnclosingType and invoking ALambdaExpression with the inner type returns a value of true, otherwise false.</para><para>A popular use of the optional MPL lambda expression is to check whether the type found is the same</para><para>as another type, when the type found is a typedef. In that case our example would be:</para><para>has_type_MyType&lt;EnclosingType,boost::is_same&lt;_,SomeOtherType&gt; &gt;::value is true if MyType is an inner type of EnclosingType and is the same type as SomeOtherType. </para></description></macro>
  342. </header>
  343. <header name="boost/tti/member_type.hpp">
  344. <namespace name="boost">
  345. <namespace name="tti">
  346. <struct name="valid_member_metafunction"><template>
  347. <template-type-parameter name="TTI_METAFUNCTION"/>
  348. </template><inherit access="public">boost::mpl::not_&lt; boost::is_same&lt; TTI_METAFUNCTION::type, TTI_METAFUNCTION::boost_tti_marker_type &gt; &gt;</inherit><purpose>A metafunction which checks whether the invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) hold a valid type. </purpose><description><para>template&lt;class TTI_METAFUNCTION&gt; struct <classname alt="boost::tti::valid_member_metafunction">valid_member_metafunction</classname> { static const value = unspecified; typedef mpl::bool_&lt;true-or-false&gt; type; };</para><para>The metafunction types and return:</para><para>TTI_METAFUNCTION = The invoked macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ).</para><para>returns = 'value' is true if the nested type of the invoked metafunction is valid, otherwise 'value' is false. A valid type means that the invoked metafunction's inner 'type' is not the marker type. </para></description></struct><struct name="valid_member_type"><template>
  349. <template-type-parameter name="BOOST_TTI_TP_T"/>
  350. <template-type-parameter name="BOOST_TTI_TP_MARKER_TYPE"><default>BOOST_TTI_NAMESPACE::detail::notype</default></template-type-parameter>
  351. </template><inherit access="public">boost::mpl::not_&lt; boost::is_same&lt; BOOST_TTI_TP_T, BOOST_TTI_TP_MARKER_TYPE &gt; &gt;</inherit><purpose>A metafunction which checks whether the member 'type' returned from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ) is a valid type. </purpose><description><para>template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype&gt; struct <classname alt="boost::tti::valid_member_type">valid_member_type</classname> { static const value = unspecified; typedef mpl::bool_&lt;true-or-false&gt; type; };</para><para>The metafunction types and return:</para><para>BOOST_TTI_TP_T = returned inner 'type' from invoking the macro metafunction generated by BOOST_TTI_MEMBER_TYPE ( BOOST_TTI_TRAIT_MEMBER_TYPE ). BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type. defaults to the internal boost::tti::detail::notype.</para><para>returns = 'value' is true if the type is valid, otherwise 'value' is false. A valid type means that the returned inner 'type' is not the marker type. </para></description></struct></namespace>
  352. </namespace>
  353. <macro name="BOOST_TTI_TRAIT_MEMBER_TYPE" kind="functionlike"><macro-parameter name="trait"/><macro-parameter name="name"/><purpose>Expands to a metafunction whose typedef 'type' is either the named type or a marker type. </purpose><description><para>trait = the name of the metafunction within the tti namespace.</para><para>name = the name of the inner type.</para><para>generates a metafunction called "trait" where 'trait' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype&gt;
  354. struct trait
  355. {
  356. typedef unspecified type;
  357. typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type;
  358. };
  359. The metafunction types and return:
  360. BOOST_TTI_TP_T = the enclosing type.
  361. BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
  362. defaults to the internal boost::tti::detail::notype.
  363. returns = 'type' is the inner type of 'name' if the inner type exists
  364. within the enclosing type, else 'type' is a marker type.
  365. if the end-user does not specify a marker type then
  366. an internal boost::tti::detail::notype marker type is used.
  367. The metafunction also encapsulates the type of the marker type as
  368. a nested 'boost_tti_marker_type'.
  369. </para><para>The purpose of this macro is to encapsulate the 'name' type as the typedef 'type' of a metafunction, but only if it exists within the enclosing type. This allows for an evaluation of inner type existence, without generating a compiler error, which can be used by other metafunctions in this library. </para></description></macro>
  370. <macro name="BOOST_TTI_MEMBER_TYPE" kind="functionlike"><macro-parameter name="name"/><purpose>Expands to a metafunction whose typedef 'type' is either the named type or a marker type. </purpose><description><para>name = the name of the inner type.</para><para>generates a metafunction called "member_type_name" where 'name' is the macro parameter. template&lt;class BOOST_TTI_TP_T,class BOOST_TTI_TP_MARKER_TYPE = boost::tti::detail::notype&gt;
  371. struct member_type_name
  372. {
  373. typedef unspecified type;
  374. typedef BOOST_TTI_TP_MARKER_TYPE boost_tti_marker_type;
  375. };
  376. The metafunction types and return:
  377. BOOST_TTI_TP_T = the enclosing type.
  378. BOOST_TTI_TP_MARKER_TYPE = (optional) a type to use as the marker type.
  379. defaults to the internal boost::tti::detail::notype.
  380. returns = 'type' is the inner type of 'name' if the inner type exists
  381. within the enclosing type, else 'type' is a marker type.
  382. if the end-user does not specify a marker type then
  383. an internal boost::tti::detail::notype marker type is used.
  384. The metafunction also encapsulates the type of the marker type as
  385. a nested 'boost_tti_marker_type'.
  386. </para><para>The purpose of this macro is to encapsulate the 'name' type as the typedef 'type' of a metafunction, but only if it exists within the enclosing type. This allows for an evaluation of inner type existence, without generating a compiler error, which can be used by other metafunctions in this library. </para></description></macro>
  387. </header>
  388. </library-reference>