enum_shifted_params.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <html>
  2. <head>
  3. <title>BOOST_PP_ENUM_SHIFTED_PARAMS</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</b> macro generates a comma-separated, shifted list of parameters.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. <b>BOOST_PP_ENUM_SHIFTED_PARAMS</b>(<i>count</i>, <i>param</i>)
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>count</dt>
  17. <dd>
  18. The number of parameters to generate.&nbsp;
  19. Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
  20. </dd>
  21. <dt>param</dt>
  22. <dd>
  23. The text of the parameter.&nbsp;
  24. <b>BOOST_PP_ENUM_SHIFTED_PARAMS</b> concatenates numbers ranging from <i>1</i> to <i>count</i> - <i>1</i>
  25. to generate parameters.
  26. </dd>
  27. </dl>
  28. <h4>Remarks</h4>
  29. <div>
  30. This macro expands to the comma-separated sequence:
  31. <div>
  32. <i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
  33. </div>
  34. </div>
  35. <div>
  36. This macro facilitates a typical usage of the library.&nbsp;
  37. Shifted parameter lists are common in template metaprograms.
  38. </div>
  39. <div>
  40. To use the <i>z</i> parameter passed from other macros that use <b>BOOST_PP_REPEAT</b>, see <b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b>.
  41. </div>
  42. <div>
  43. Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.&nbsp;
  44. This limitation no longer exists, as the library can automatically detect the next available repetition depth.
  45. </div>
  46. <h4>See Also</h4>
  47. <ul>
  48. <li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
  49. <li><a href="enum_shifted_params_z.html">BOOST_PP_SHIFTED_ENUM_PARAMS_<i>z</i></a></li>
  50. </ul>
  51. <h4>Requirements</h4>
  52. <div>
  53. <b>Header:</b> &nbsp;<a href="../headers/repetition/enum_shifted_params.html">&lt;boost/preprocessor/repetition/enum_shifted_params.hpp&gt;</a>
  54. </div>
  55. <h4>Sample Code</h4>
  56. <div><pre>
  57. #include &lt;<a href="../headers/repetition/enum_shifted_params.html">boost/preprocessor/repetition/enum_shifted_params.hpp</a>&gt;
  58. <a href="enum_shifted_params.html">BOOST_PP_ENUM_SHIFTED_PARAMS</a>(3, class T) // expands to class T1, class T2
  59. </pre></div>
  60. <hr size="1">
  61. <div style="margin-left: 0px;">
  62. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  63. </br><i>© Copyright Paul Mensonides 2002</i>
  64. </div>
  65. <div style="margin-left: 0px;">
  66. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  67. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  68. copy at <a href=
  69. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  70. </div>
  71. </body>
  72. </html>