local_limits.html 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LOCAL_LIMITS</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_LIMITS</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_LIMITS</b> (<i>start</i>, <i>finish</i>)
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>start</dt>
  17. <dd>
  18. The lower bound (inclusive) of a <i>local iteration</i>.&nbsp;
  19. Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
  20. </dd>
  21. <dt>finish</dt>
  22. <dd>
  23. The upper bound (inclusive) of a <i>local iteration</i>.&nbsp;
  24. Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
  25. </dd>
  26. </dl>
  27. <h4>Remarks</h4>
  28. <div>
  29. Note that there is a whitespace character after the macro identifier.
  30. </div>
  31. <div>
  32. This macro must expand to a <i>2</i>-element <i>tuple</i>.&nbsp;
  33. The elements of this <i>tuple</i> represent the lower and upper boundaries of a <i>local iteration</i>.&nbsp;
  34. Both <i>start</i> and <i>finish</i> are <i>evaluated parameters</i>.&nbsp;
  35. This implies that they can include simple arithmetic expressions (such as <i>1</i> + <i>3</i>), etc..
  36. </div>
  37. <div>
  38. This macro is automatically undefined for reuse by a call to <b>BOOST_PP_LOCAL_ITERATE</b>.
  39. </div>
  40. <h4>See Also</h4>
  41. <ul>
  42. <li><a href="limit_iteration.html">BOOST_PP_LIMIT_ITERATION</a></li>
  43. <li><a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a></li>
  44. </ul>
  45. <h4>Sample Code</h4>
  46. <div><pre>
  47. #include &lt;<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>&gt;
  48. template&lt;int&gt; struct sample;
  49. #define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \
  50. template&lt;&gt; struct sample&lt;n&gt; { \
  51. enum { value = n }; \
  52. }; \
  53. /**/
  54. #define <a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a> (1, 5)
  55. #include <a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a>()
  56. /* expands to...
  57. template&lt;&gt; struct sample&lt;1&gt; { enum { value = 1 }; };
  58. template&lt;&gt; struct sample&lt;2&gt; { enum { value = 2 }; };
  59. template&lt;&gt; struct sample&lt;3&gt; { enum { value = 3 }; };
  60. template&lt;&gt; struct sample&lt;4&gt; { enum { value = 4 }; };
  61. template&lt;&gt; struct sample&lt;5&gt; { enum { value = 5 }; };
  62. */
  63. </pre></div>
  64. <hr size="1">
  65. <div style="margin-left: 0px;">
  66. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  67. </br><i>© Copyright Paul Mensonides 2002</i>
  68. </div>
  69. <div style="margin-left: 0px;">
  70. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  71. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  72. copy at <a href=
  73. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  74. </div>
  75. </body>
  76. </html>