enum_shifted_params_z.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <html>
  2. <head>
  3. <title>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</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_ENUM_SHIFTED_PARAMS_Z</b> macro generates a comma-separated, shifted list of parameters.&nbsp;
  9. It reenters <b>BOOST_PP_REPEAT</b> with maximum efficiency.
  10. </div>
  11. <h4>Usage</h4>
  12. <div class="code">
  13. <b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b>(<i>z</i>, <i>count</i>, <i>param</i>)
  14. </div>
  15. <h4>Arguments</h4>
  16. <dl>
  17. <dt>z</dt>
  18. <dd>
  19. The next available <b>BOOST_PP_REPEAT</b> dimension.
  20. </dd>
  21. <dt>count</dt>
  22. <dd>
  23. The number of parameters to generate.&nbsp;
  24. Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
  25. </dd>
  26. <dt>param</dt>
  27. <dd>
  28. The text of the parameter.&nbsp;
  29. <b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b> concatenates numbers ranging from <i>1</i> to <i>count</i> - <i>1</i>
  30. to generate parameters.
  31. </dd>
  32. </dl>
  33. <h4>Remarks</h4>
  34. <div>
  35. This macro expands to the comma-separated sequence:
  36. <div>
  37. <i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
  38. </div>
  39. </div>
  40. <h4>See Also</h4>
  41. <ul>
  42. <li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
  43. <li><a href="enum_shifted_params.html">BOOST_PP_ENUM_SHIFTED_PARAMS</a></li>
  44. </ul>
  45. <h4>Requirements</h4>
  46. <div>
  47. <b>Header:</b> &nbsp;<a href="../headers/repetition/enum_shifted_params.html">&lt;boost/preprocessor/repetition/enum_shifted_params.hpp&gt;</a>
  48. </div>
  49. <h4>Sample Code</h4>
  50. <div><pre>
  51. #include &lt;<a href="../headers/repetition/enum_params.html">boost/preprocessor/repetition/enum_params.hpp</a>&gt;
  52. #include &lt;<a href="../headers/repetition/enum_shifted_params.html">boost/preprocessor/repetition/enum_shifted_params.hpp</a>&gt;
  53. #include &lt;<a href="../headers/repetition/repeat.html">boost/preprocessor/repetition/repeat.hpp</a>&gt;
  54. int add(void) {
  55. return 0;
  56. }
  57. #define ADD_F(z, n, _) \
  58. int add_f(<a href="enum_params_z.html">BOOST_PP_ENUM_PARAMS_Z</a>(z, <a href="inc.html">BOOST_PP_INC</a>(n), int p)) { \
  59. return p0 + add_f(<a href="enum_shifted_params_z.html">BOOST_PP_ENUM_SHIFTED_PARAMS_Z</a>(z, <a href="inc.html">BOOST_PP_INC</a>(n), p)); \
  60. } \
  61. /**/
  62. <a href="repeat.html">BOOST_PP_REPEAT</a>(5, ADD_F, nil)
  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>