array_insert.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <html>
  2. <head>
  3. <title>BOOST_PP_ARRAY_INSERT</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_ARRAY_INSERT</b> macro inserts an element into an <i>array</i>.
  9. </div>
  10. <h4>Usage</h4>
  11. <div class="code">
  12. <b>BOOST_PP_ARRAY_INSERT</b>(<i>array</i>, <i>i</i>, <i>elem</i>)
  13. </div>
  14. <h4>Arguments</h4>
  15. <dl>
  16. <dt>array</dt>
  17. <dd>
  18. The <i>array</i> into which an element is to be inserted.
  19. </dd>
  20. <dt>i</dt>
  21. <dd>
  22. The zero-based position in <i>array</i> where an element is to be inserted.&nbsp;
  23. Valid values range from <i>0</i> to <b>BOOST_PP_ARRAY_SIZE</b>(<i>array</i>).
  24. </dd>
  25. <dt>elem</dt>
  26. <dd>
  27. The element to insert.
  28. </dd>
  29. </dl>
  30. <h4>Remarks</h4>
  31. <div>
  32. This macro inserts <i>elem</i> before the element at index <i>i</i>.
  33. </div>
  34. <div>
  35. If the operation attempts to create an <i>array</i> that is larger than <b>BOOST_PP_LIMIT_TUPLE</b>,
  36. the result is undefined.
  37. </div>
  38. <div>
  39. This macro uses <b>BOOST_PP_WHILE</b> interally.&nbsp;
  40. Therefore, to use the <i>d</i> parameter passed from other macros that use <b>BOOST_PP_WHILE</b>,
  41. see <b>BOOST_PP_ARRAY_INSERT_D</b>.
  42. </div>
  43. <h4>See Also</h4>
  44. <ul>
  45. <li><a href="array_insert_d.html">BOOST_PP_ARRAY_INSERT_D</a></li>
  46. </ul>
  47. <h4>Requirements</h4>
  48. <div>
  49. <b>Header:</b> &nbsp;<a href="../headers/array/insert.html">&lt;boost/preprocessor/array/insert.hpp&gt;</a>
  50. </div>
  51. <h4>Sample Code</h4>
  52. <div><pre>
  53. #include &lt;<a href="../headers/array/insert.html">boost/preprocessor/array/insert.hpp</a>&gt;
  54. #define ARRAY (3, (a, b, d))
  55. <a href="array_insert.html">BOOST_PP_ARRAY_INSERT</a>(ARRAY, 2, c) // expands to (4, (a, b, c, d))
  56. </pre></div>
  57. <hr size="1">
  58. <div style="margin-left: 0px;">
  59. <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
  60. </br><i>© Copyright Paul Mensonides 2002</i>
  61. </div>
  62. <div style="margin-left: 0px;">
  63. <p><small>Distributed under the Boost Software License, Version 1.0. (See
  64. accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
  65. copy at <a href=
  66. "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
  67. </div>
  68. </body>
  69. </html>