seq_replace.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <html>
  2. <head>
  3. <title>BOOST_PP_SEQ_REPLACE</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_SEQ_REPLACE</b> macro replaces an element in a <i>seq</i>.
  9. </div>
  10. <h4>
  11. Usage
  12. </h4>
  13. <div class="code">
  14. <b>BOOST_PP_SEQ_REPLACE</b>(<i>seq</i>, <i>i</i>, <i>elem</i>)
  15. </div>
  16. <h4>
  17. Arguments
  18. </h4>
  19. <dl>
  20. <dt>seq</dt>
  21. <dd>
  22. The <i>seq</i> in which an element is to be replaced.
  23. </dd>
  24. <dt>i</dt>
  25. <dd>
  26. The zero-based position in <i>seq</i> of the element to be replaced.&nbsp;
  27. Valid values range from <i>0</i> to <b>BOOST_PP_SEQ_SIZE</b>(<i>seq</i>) - <i>1</i>.
  28. </dd>
  29. <dt>elem</dt>
  30. <dd>
  31. The element to replace the element at index <i>i</i> within <i>seq</i>.
  32. </dd>
  33. </dl>
  34. <h4>
  35. Remarks
  36. </h4>
  37. <div>
  38. This macro returns <i>seq</i> after replacing the element at index <i>i</i> with
  39. <i>elem</i>.
  40. </div>
  41. <h4>
  42. Requirements
  43. </h4>
  44. <div>
  45. <b>Header:</b> &nbsp;<a href="../headers/seq/replace.html">&lt;boost/preprocessor/seq/replace.hpp&gt;</a>
  46. </div>
  47. <h4>
  48. Sample Code
  49. </h4>
  50. <div>
  51. <pre>
  52. #include &lt;<a href="../headers/seq/replace.html">boost/preprocessor/seq/replace.hpp</a>&gt;
  53. #define SEQ (a)(b)(x)(d)
  54. <a href="seq_replace.html">BOOST_PP_SEQ_REPLACE</a>(SEQ, 2, c) // expands to (a)(b)(c)(d)
  55. </pre>
  56. </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>