• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2  <head>
3    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
4    <title>BOOST_PP_TUPLE_REPLACE</title>
5    <link rel="stylesheet" type="text/css" href="../styles.css">
6  </head>
7  <body>
8    <div style="margin-left:  0px;"> The <b>BOOST_PP_TUPLE_REPLACE</b> macro
9      replaces an element in a <i>tuple</i>.</div>
10    <h4>Usage</h4>
11    <div class="code"> <b>BOOST_PP_TUPLE_REPLACE</b>(<i>tuple</i>, <i>i</i>, <i>elem</i>)
12      <a href="../topics/variadic_macros.html#VNotation"><sup>(v)</sup></a></div>
13    <h4>Arguments</h4>
14    <dl>
15      <dt>tuple</dt>
16      <dd> A <i>tuple</i> to replace an element in. </dd>
17      <dt>i</dt>
18      <dd> The zero-based position in <i>tuple</i> of the element to be
19        replaced.&nbsp; Valid values range from <i>0</i> to <b>BOOST_PP_TUPLE_SIZE</b>(<i>tuple</i>)
20        - <i>1</i>.</dd>
21      <dt>elem</dt>
22      <dd> The replacement element. </dd>
23    </dl>
24    <h4>Remarks</h4>
25    <div> This macro uses <b>BOOST_PP_WHILE</b> interally.&nbsp; Therefore, to
26      use the <i>d</i> parameter passed from other macros that use <b>BOOST_PP_WHILE</b>,
27      see <b>BOOST_PP_TUPLE_REPLACE_D</b>.</div>
28    <h4>See Also</h4>
29    <ul>
30      <li><a href="tuple_replace_d.html">BOOST_PP_TUPLE_REPLACE_D</a></li>
31    </ul>
32    <h4>Requirements</h4>
33    <div> <b>Header:</b> &nbsp;<a href="../headers/tuple/replace.html">&lt;boost/preprocessor/tuple/replace.hpp&gt;</a>
34    </div>
35    <h4>Sample Code</h4>
36    <div>
37      <pre>#include &lt;<a href="../headers/tuple/replace.html">boost/preprocessor/tuple/replace.hpp</a>&gt;
38
39#define TUPLE (a, x, c)
40
41<a href="tuple_replace.html">BOOST_PP_TUPLE_REPLACE</a>(TUPLE, 1, b) // expands to (a, b, c))
42</pre></div>
43    <hr size="1">
44    <div style="margin-left: 0px;"> <i>� Copyright Edward Diener 2013</i> </div>
45    <div style="margin-left: 0px;">
46      <p><small>Distributed under the Boost Software License, Version 1.0. (See
47          accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
48          or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
49    </div>
50  </body>
51</html>
52