enum_params_with_a_default.html 3.1 KB

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