list_enum_r.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LIST_ENUM_R</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_LIST_ENUM_R</b> macro converts a <i>list</i> to a comma-separated list.&nbsp;
  9. It reenters <b>BOOST_PP_FOR</b> with maximum efficiency.
  10. </div>
  11. <h4>Usage</h4>
  12. <div class="code">
  13. <b>BOOST_PP_LIST_ENUM_R</b>(<i>r</i>, <i>list</i>)
  14. </div>
  15. <h4>Arguments</h4>
  16. <dl>
  17. <dt>r</dt>
  18. <dd>
  19. The next available <b>BOOST_PP_FOR</b> repetition.
  20. </dd>
  21. <dt>list</dt>
  22. <dd>
  23. The <i>list</i> to be converted.
  24. </dd>
  25. </dl>
  26. <h4>Remarks</h4>
  27. <div>
  28. If <i>list</i> is, for example, (<i>a</i>, (<i>b</i>, (<i>c</i>, <b>BOOST_PP_NIL</b>))),
  29. this macro will produce:
  30. <div>
  31. <i>a</i>, <i>b</i>, <i>c</i>
  32. </div>
  33. </div>
  34. <h4>See Also</h4>
  35. <ul>
  36. <li><a href="list_enum.html">BOOST_PP_LIST_ENUM</a></li>
  37. </ul>
  38. <h4>Requirements</h4>
  39. <div>
  40. <b>Header:</b> &nbsp;<a href="../headers/list/enum.html">&lt;boost/preprocessor/list/enum.hpp&gt;</a>
  41. </div>
  42. <h4>Sample Code</h4>
  43. <div><pre>
  44. #include &lt;<a href="../headers/list/adt.html">boost/preprocessor/list/adt.hpp</a>&gt;
  45. #include &lt;<a href="../headers/repetition/for.html">boost/preprocessor/repetition/for.hpp</a>&gt;
  46. #include &lt;<a href="../headers/list/enum.html">boost/preprocessor/list/enum.hpp</a>&gt;
  47. #define LIST (x, (y, (z, <a href="nil.html">BOOST_PP_NIL</a>)))
  48. #define PRED(r, state) <a href="list_is_cons.html">BOOST_PP_LIST_IS_CONS</a>(state)
  49. #define OP(r, state) <a href="list_rest.html">BOOST_PP_LIST_REST</a>(state)
  50. #define MACRO(r, state) [ <a href="list_enum_r.html">BOOST_PP_LIST_ENUM_R</a>(r, state) ]
  51. <a href="for.html">BOOST_PP_FOR</a>(LIST, PRED, OP, MACRO)
  52. // expands to [x, y, z] [y, z] [z]
  53. </pre></div>
  54. <hr size="1">
  55. <div style="margin-left: 0px;">
  56. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  57. </br><i>© Copyright Paul Mensonides 2002</i>
  58. </div>
  59. <div style="margin-left: 0px;">
  60. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  61. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  62. copy at <a href=
  63. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  64. </div>
  65. </body>
  66. </html>