list_append.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <html>
  2. <head>
  3. <title>BOOST_PP_LIST_APPEND</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_APPEND</b> macro appends two <i>lists</i>.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. <b>BOOST_PP_LIST_APPEND</b>(<i>a</i>, <i>b</i>)
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>a</dt>
  17. <dd>
  18. The first <i>list</i>.
  19. </dd>
  20. <dt>b</dt>
  21. <dd>
  22. The second <i>list</i>.
  23. </dd>
  24. </dl>
  25. <h4>Remarks</h4>
  26. <div>
  27. This macro appends two lists.&nbsp;
  28. For example, if <i>a</i> is (<i>1</i>, (<i>2</i>, (<i>3</i>, <b>BOOST_PP_NIL</b>))) and <i>b</i> is (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)),
  29. this macro will expand to:
  30. <div>
  31. (<i>1</i>, (<i>2</i>, (<i>3</i>, (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)))))
  32. </div>
  33. </div>
  34. <div>
  35. Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.&nbsp;
  36. There is no longer any such restriction.&nbsp;
  37. It is more efficient, however, to use <b>BOOST_PP_LIST_APPEND_D</b> in such a situation.
  38. </div>
  39. <h4>See Also</h4>
  40. <ul>
  41. <li><a href="list_append_d.html">BOOST_PP_LIST_APPEND_D</a></li>
  42. </ul>
  43. <h4>Requirements</h4>
  44. <div>
  45. <b>Header:</b> &nbsp;<a href="../headers/list/append.html">&lt;boost/preprocessor/list/append.hpp&gt;</a>
  46. </div>
  47. <h4>Sample Code</h4>
  48. <div><pre>
  49. #include &lt;<a href="../headers/list/append.html">boost/preprocessor/list/append.hpp</a>&gt;
  50. #define L1 (a, (b, (c, <a href="nil.html">BOOST_PP_NIL</a>)))
  51. #define L2 (x, (y, (z, <a href="nil.html">BOOST_PP_NIL</a>)))
  52. <a href="list_append.html">BOOST_PP_LIST_APPEND</a>(L1, L2)
  53. // expands to (a, (b, (c, (x, (y, (z, <a href="nil.html">BOOST_PP_NIL</a>))))))
  54. </pre></div>
  55. <hr size="1">
  56. <div style="margin-left: 0px;">
  57. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  58. </br><i>© Copyright Paul Mensonides 2002</i>
  59. </div>
  60. <div style="margin-left: 0px;">
  61. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  62. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  63. copy at <a href=
  64. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  65. </div>
  66. </body>
  67. </html>