blob: 330077bc2a2dd1e4cefcccd05a9bcf4cdda4621b [file] [log] [blame]
Brian Silvermanf27e0852018-08-04 23:56:45 -07001<html>
2<head>
3 <title>BOOST_PP_ARRAY_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_ARRAY_REPLACE</b> macro replaces an element in an <i>array</i>.
9 </div>
10 <h4>Usage</h4>
11 <div class="code">
12 <b>BOOST_PP_ARRAY_REPLACE</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 An <i>array</i> to replace an element in.
19 </dd>
20 <dt>i</dt>
21 <dd>
22 The zero-based position in <i>array</i> of the element to be replaced.&nbsp;
23 Valid values range from <i>0</i> to <b>BOOST_PP_ARRAY_SIZE</b>(<i>array</i>) - <i>1</i>.
24 </dd>
25 <dt>elem</dt>
26 <dd>
27 The replacement element.
28 </dd>
29 </dl>
30 <h4>Remarks</h4>
31 <div>
32 This macro uses <b>BOOST_PP_WHILE</b> interally.&nbsp;
33 Therefore, to use the <i>d</i> parameter passed from other macros that use <b>BOOST_PP_WHILE</b>,
34 see <b>BOOST_PP_ARRAY_REPLACE_D</b>.
35 </div>
36 <h4>See Also</h4>
37 <ul>
38 <li><a href="array_replace_d.html">BOOST_PP_ARRAY_REPLACE_D</a></li>
39 </ul>
40 <h4>Requirements</h4>
41 <div>
42 <b>Header:</b> &nbsp;<a href="../headers/array/replace.html">&lt;boost/preprocessor/array/replace.hpp&gt;</a>
43 </div>
44 <h4>Sample Code</h4>
45<div><pre>
46#include &lt;<a href="../headers/array/replace.html">boost/preprocessor/array/replace.hpp</a>&gt;
47
48#define ARRAY (3, (a, x, c))
49
50<a href="array_replace.html">BOOST_PP_ARRAY_REPLACE</a>(ARRAY, 1, b) // expands to (3, (a, b, c))
51</pre></div>
52 <hr size="1">
53 <div style="margin-left: 0px;">
54 <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
55 </br><i>© Copyright Paul Mensonides 2002</i>
56 </div>
57 <div style="margin-left: 0px;">
58 <p><small>Distributed under the Boost Software License, Version 1.0. (See
59 accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
60 copy at <a href=
61 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
62 </div>
63</body>
64</html>