local_macro.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LOCAL_MACRO</title>
  4. <link rel="stylesheet" type="text/css" href="../styles.css">
  5. </head>
  6. <body>
  7. <div style="margin-left: 0px;">
  8. The <b>BOOST_PP_LOCAL_MACRO</b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_LOCAL_ITERATE</b>.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. #define <b>BOOST_PP_LOCAL_MACRO</b>(<i>n</i>) ...
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>n</dt>
  17. <dd>
  18. The current iteration value received from the <i>local-iteration</i> mechanism.
  19. </dd>
  20. </dl>
  21. <h4>Remarks</h4>
  22. <div>
  23. This macro is automatically undefined for reuse by a call to <b>BOOST_PP_LOCAL_ITERATE</b>.
  24. </div>
  25. <h4>See Also</h4>
  26. <ul>
  27. <li><a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a></li>
  28. </ul>
  29. <h4>Sample Code</h4>
  30. <div><pre>
  31. #include &lt;<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>&gt;
  32. template&lt;int&gt; struct sample;
  33. #define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \
  34. template&lt;&gt; struct sample&lt;n&gt; { \
  35. enum { value = n }; \
  36. }; \
  37. /**/
  38. #define <a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a> (1, 5)
  39. #include <a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a>()
  40. /* expands to...
  41. template&lt;&gt; struct sample&lt;1&gt; { enum { value = 1 }; };
  42. template&lt;&gt; struct sample&lt;2&gt; { enum { value = 2 }; };
  43. template&lt;&gt; struct sample&lt;3&gt; { enum { value = 3 }; };
  44. template&lt;&gt; struct sample&lt;4&gt; { enum { value = 4 }; };
  45. template&lt;&gt; struct sample&lt;5&gt; { enum { value = 5 }; };
  46. */
  47. </pre></div>
  48. <hr size="1">
  49. <div style="margin-left: 0px;">
  50. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  51. </br><i>© Copyright Paul Mensonides 2002</i>
  52. </div>
  53. <div style="margin-left: 0px;">
  54. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  55. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  56. copy at <a href=
  57. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  58. </div>
  59. </body>
  60. </html>