enum_params_with_defaults.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <html>
  2. <head>
  3. <title>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</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_PARAMS_WITH_DEFAULTS</b> macro generates a comma-separated list of parameters with default arguments.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. <b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b>(<i>count</i>, <i>param</i>, <i>def</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_PARAMS_WITH_DEFAULTS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
  25. to generate parameters.
  26. </dd>
  27. <dt>def</dt>
  28. <dd>
  29. The default value that trails each parameter.
  30. <b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
  31. to generate default arguments.
  32. </dd>
  33. </dl>
  34. <h4>Remarks</h4>
  35. <div>
  36. This macro expands to the comma-separated sequence:
  37. <div>
  38. <i>param</i> ## <i>0</i> = <i>def</i> ## <i>0</i>, <i>param</i> ## <i>1</i> = <i>def</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i> = <i>def</i> ## <i>count</i> - <i>1</i>
  39. </div>
  40. </div>
  41. <div>
  42. Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.&nbsp;
  43. This limitation no longer exists, as the library can automatically detect the next available repetition depth.
  44. </div>
  45. <div>
  46. This macro is deprecated.&nbsp;
  47. It only exists for backward compatibility.&nbsp;
  48. Use <b>BOOST_PP_ENUM_BINARY_PARAMS</b> instead:
  49. <div>
  50. <b>BOOST_PP_ENUM_BINARY_PARAMS</b>(<i>count</i>, <i>param</i>, = <i>def</i>)
  51. </div>
  52. </div>
  53. <h4>See Also</h4>
  54. <ul>
  55. <li><a href="enum_binary_params.html">BOOST_PP_ENUM_BINARY_PARAMS</a></li>
  56. <li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
  57. </ul>
  58. <h4>Requirements</h4>
  59. <div>
  60. <b>Header:</b> &nbsp;<a href="../headers/repetition/epwd.html">&lt;boost/preprocessor/repetition/enum_params_with_defaults.hpp&gt;</a>
  61. </div>
  62. <h4>Sample Code</h4>
  63. <div><pre>
  64. #include &lt;<a href="../headers/repetition/epwd.html">boost/preprocessor/repetition/enum_params_with_defaults.hpp</a>&gt;
  65. <a href="enum_params_with_defaults.html">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(3, class T, U)
  66. // expands to class T0 = U0, class T1 = U1, class T2 = U2
  67. <a href="enum_binary_params.html">BOOST_PP_ENUM_BINARY_PARAMS</a>(3, class T, = U)
  68. // expands to class T0 = U0, class T1 = U1, class T2 = U2
  69. </pre></div>
  70. <hr size="1">
  71. <div style="margin-left: 0px;">
  72. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  73. </br><i>© Copyright Paul Mensonides 2002</i>
  74. </div>
  75. <div style="margin-left: 0px;">
  76. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  77. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  78. copy at <a href=
  79. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  80. </div>
  81. </body>
  82. </html>