aux-lambda-support.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
  7. <title>The MPL Reference Manual: BOOST_MPL_AUX_LAMBDA_SUPPORT</title>
  8. <link rel="stylesheet" href="../style.css" type="text/css" />
  9. </head>
  10. <body class="docframe refmanual">
  11. <table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Prev</a>&nbsp;<a href="./terminology.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Back&nbsp;Along</span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
  12. <td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./macros.html" class="navigation-link">Macros</a> / <a href="./broken-compiler-workarounds.html" class="navigation-link">Broken Compiler Workarounds</a> / <a href="./aux-lambda-support.html" class="navigation-link">BOOST_MPL_AUX_LAMBDA_SUPPORT</a></td>
  13. </tr></table><div class="header-separator"></div>
  14. <div class="section" id="boost-mpl-aux-lambda-support">
  15. <h1><a class="toc-backref" href="./broken-compiler-workarounds.html#id1609">BOOST_MPL_AUX_LAMBDA_SUPPORT</a></h1>
  16. <div class="section" id="id1384">
  17. <h3><a class="subsection-title" href="#synopsis" name="synopsis">Synopsis</a></h3>
  18. <pre class="literal-block">
  19. #define <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(arity, fun, params) \
  20. <em>unspecified token sequence</em> \
  21. /**/
  22. </pre>
  23. </div>
  24. <div class="section" id="id1385">
  25. <h3><a class="subsection-title" href="#description" name="description">Description</a></h3>
  26. <p>Enables metafunction <tt class="literal"><span class="pre">fun</span></tt> for the use in <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a>s on
  27. compilers that don't support partial template specialization or/and
  28. template template parameters. Expands to nothing on conforming compilers.</p>
  29. </div>
  30. <div class="section" id="id1386">
  31. <h3><a class="subsection-title" href="#header" name="header">Header</a></h3>
  32. <pre class="literal-block">
  33. #include &lt;<a href="../../../../boost/mpl/aux_/lambda_support.hpp" class="header">boost/mpl/aux_/lambda_support.hpp</a>&gt;
  34. </pre>
  35. </div>
  36. <div class="section" id="id1387">
  37. <h3><a class="subsection-title" href="#parameters" name="parameters">Parameters</a></h3>
  38. <table border="1" class="docutils table">
  39. <colgroup>
  40. <col width="15%" />
  41. <col width="32%" />
  42. <col width="53%" />
  43. </colgroup>
  44. <thead valign="bottom">
  45. <tr><th class="head">Parameter</th>
  46. <th class="head">Requirement</th>
  47. <th class="head">Description</th>
  48. </tr>
  49. </thead>
  50. <tbody valign="top">
  51. <tr><td><tt class="literal"><span class="pre">arity</span></tt></td>
  52. <td>An integral constant</td>
  53. <td>The metafunction's arity, i.e. the number of its
  54. template parameters, including the defaults.</td>
  55. </tr>
  56. <tr><td><tt class="literal"><span class="pre">fun</span></tt></td>
  57. <td>A legal identifier token</td>
  58. <td>The metafunction's name.</td>
  59. </tr>
  60. <tr><td><tt class="literal"><span class="pre">params</span></tt></td>
  61. <td>A <a class="reference external" href="http://www.boost.org/libs/preprocessor/doc/data/tuples.html" target="_top">PP-tuple</a></td>
  62. <td>A tuple of the metafunction's parameter names, in
  63. their original order, including the defaults.</td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </div>
  68. <div class="section" id="id1388">
  69. <h3><a class="subsection-title" href="#expression-semantics" name="expression-semantics">Expression semantics</a></h3>
  70. <p>For any integral constant <tt class="literal"><span class="pre">n</span></tt>, a <a class="reference internal" href="./metafunction.html">Metafunction</a> <tt class="literal"><span class="pre">fun</span></tt>, and arbitrary types <tt class="literal"><span class="pre">A1</span></tt>,... <tt class="literal"><span class="pre">An</span></tt>:</p>
  71. <pre class="literal-block">
  72. template&lt; typename A1,<em>...</em> typename A<em>n</em> &gt; struct fun
  73. {
  74. // <em>...</em>
  75. <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(n, fun, (A1,<em>...</em>A<em>n</em>))
  76. };
  77. </pre>
  78. <table class="docutils field-list" frame="void" rules="none">
  79. <col class="field-name" />
  80. <col class="field-body" />
  81. <tbody valign="top">
  82. <tr class="field"><th class="field-name">Precondition:</th><td class="field-body">Appears in <tt class="literal"><span class="pre">fun</span></tt>'s scope, immediately followed by the scope-closing
  83. bracket (<tt class="literal"><span class="pre">}</span></tt>).</td>
  84. </tr>
  85. <tr class="field"><th class="field-name">Return type:</th><td class="field-body">None.</td>
  86. </tr>
  87. <tr class="field"><th class="field-name">Semantics:</th><td class="field-body">Expands to nothing and has no effect on conforming compilers. On compilers that
  88. don't support partial template specialization or/and template template parameters
  89. expands to an unspecified token sequence enabling <tt class="literal"><span class="pre">fun</span></tt> to participate in
  90. <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a>s with the semantics described in this manual.</td>
  91. </tr>
  92. </tbody>
  93. </table>
  94. </div>
  95. <div class="section" id="id1389">
  96. <h3><a class="subsection-title" href="#example" name="example">Example</a></h3>
  97. <pre class="literal-block">
  98. template&lt; typename T, typename U = int &gt; struct f
  99. {
  100. typedef T type[sizeof(U)];
  101. <a href="./aux-lambda-support.html" class="identifier">BOOST_MPL_AUX_LAMBDA_SUPPORT</a>(2, f, (T,U))
  102. };
  103. typedef <a href="./apply.html" class="identifier">apply</a><tt class="literal"><span class="pre">1</span></tt>&lt; f&lt;char,<a href="./placeholders.html" class="identifier">_1</a>&gt;,long &gt;::type r;
  104. <a href="./assert.html" class="identifier">BOOST_MPL_ASSERT</a>(( is_same&lt; r, char[sizeof(long)] > ));
  105. </pre>
  106. </div>
  107. <div class="section" id="id1390">
  108. <h3><a class="subsection-title" href="#see-also" name="see-also">See also</a></h3>
  109. <p><a class="reference internal" href="./macros.html">Macros</a>, <a class="reference internal" href="./metafunctions.html">Metafunctions</a>, <a class="reference internal" href="./lambda-expression.html">Lambda Expression</a></p>
  110. </div>
  111. </div>
  112. <div class="footer-separator"></div>
  113. <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Prev</a>&nbsp;<a href="./terminology.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group">Back&nbsp;Along</span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./broken-compiler-workarounds.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
  114. <td><div class="copyright-footer"><div class="copyright">Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</div>
  115. Distributed under the Boost Software License, Version 1.0. (See accompanying
  116. file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body>
  117. </html>