list_rest_n_d.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LIST_REST_N_D</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_REST_N_D</b> macro expands to a <i>list</i> of all but the first <i>count</i> elements of a <i>list</i>.&nbsp;
  9. It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
  10. </div>
  11. <h4>Usage</h4>
  12. <div class="code">
  13. <b>BOOST_PP_LIST_REST_N_D</b>(<i>d</i>, <i>count</i>, <i>list</i>)
  14. </div>
  15. <h4>Arguments</h4>
  16. <dl>
  17. <dt>d</dt>
  18. <dd>
  19. The next available <b>BOOST_PP_WHILE</b> iteration.
  20. </dd>
  21. <dt>count</dt>
  22. <dd>
  23. The number of elements to remove from the beginning of <i>list</i>.
  24. </dd>
  25. <dt>list</dt>
  26. <dd>
  27. The <i>list</i> from which the elements are extracted.
  28. </dd>
  29. </dl>
  30. <h4>Remarks</h4>
  31. <div>
  32. This macro removes <i>count</i> elements from the beginning of <i>list</i> and returns the remainder as a <i>list</i>
  33. </div>
  34. <h4>See Also</h4>
  35. <ul>
  36. <li><a href="list_rest_n.html">BOOST_PP_LIST_REST_N</a></li>
  37. </ul>
  38. <h4>Requirements</h4>
  39. <div>
  40. <b>Header:</b> &nbsp;<a href="../headers/list/rest_n.html">&lt;boost/preprocessor/list/rest_n.hpp&gt;</a>
  41. </div>
  42. <h4>Sample Code</h4>
  43. <div><pre>
  44. #include &lt;<a href="../headers/list/fold_right.html">boost/preprocessor/list/fold_right.hpp</a>&gt;
  45. #include &lt;<a href="../headers/list/rest_n.html">boost/preprocessor/list/rest_n.hpp</a>&gt;
  46. #define L1 (a, (b, (c, (d, <a href="nil.html">BOOST_PP_NIL</a>))))
  47. #define L2 (L1, (L1, (L1, <a href="nil.html">BOOST_PP_NIL</a>)))
  48. #define OP(d, state, x) (<a href="list_rest_n_d.html">BOOST_PP_LIST_REST_N_D</a>(d, 2, x), state)
  49. <a href="list_fold_right.html">BOOST_PP_LIST_FOLD_RIGHT</a>(OP, <a href="nil.html">BOOST_PP_NIL</a>, L2)
  50. /*
  51. expands to...
  52. ((c, (d, <a href="nil.html">BOOST_PP_NIL</a>)), ((c, (d, <a href="nil.html">BOOST_PP_NIL</a>)),
  53. ((c, (d, <a href="nil.html">BOOST_PP_NIL</a>)), <a href="nil.html">BOOST_PP_NIL</a>)))
  54. */
  55. </pre></div>
  56. <hr size="1">
  57. <div style="margin-left: 0px;">
  58. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  59. </br><i>© Copyright Paul Mensonides 2002</i>
  60. </div>
  61. <div style="margin-left: 0px;">
  62. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  63. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  64. copy at <a href=
  65. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  66. </div>
  67. </body>
  68. </html>