local_iterate.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LOCAL_ITERATE</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_ITERATE</b> macro initiates a <i>local-iteration</i>.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. #include <b>BOOST_PP_LOCAL_ITERATE</b>()
  13. </div>
  14. <h4>Remarks</h4>
  15. <div>
  16. This macro causes the user-defined macro <b>BOOST_PP_LOCAL_MACRO</b> to be expanded vertically with values in the range specified by <b>BOOST_PP_LOCAL_LIMITS</b>.
  17. </div>
  18. <h4>See Also</h4>
  19. <ul>
  20. <li><a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a></li>
  21. <li><a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a></li>
  22. </ul>
  23. <h4>Requirements</h4>
  24. <div>
  25. <b>Header:</b> &nbsp;<a href="../headers/iteration/local.html">&lt;boost/preprocessor/iteration/local.hpp&gt;</a>
  26. </div>
  27. <h4>Sample Code</h4>
  28. <div><pre>
  29. #include &lt;<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>&gt;
  30. template&lt;int&gt; struct sample;
  31. #define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \
  32. template&lt;&gt; struct sample&lt;n&gt; { \
  33. enum { value = n }; \
  34. }; \
  35. /**/
  36. #define <a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a> (1, 5)
  37. #include <a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a>()
  38. /* expands to...
  39. template&lt;&gt; struct sample&lt;1&gt; { enum { value = 1 }; };
  40. template&lt;&gt; struct sample&lt;2&gt; { enum { value = 2 }; };
  41. template&lt;&gt; struct sample&lt;3&gt; { enum { value = 3 }; };
  42. template&lt;&gt; struct sample&lt;4&gt; { enum { value = 4 }; };
  43. template&lt;&gt; struct sample&lt;5&gt; { enum { value = 5 }; };
  44. */
  45. </pre></div>
  46. <hr size="1">
  47. <div style="margin-left: 0px;">
  48. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  49. </br><i>© Copyright Paul Mensonides 2002</i>
  50. </div>
  51. <div style="margin-left: 0px;">
  52. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  53. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  54. copy at <a href=
  55. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  56. </div>
  57. </body>
  58. </html>