]>
Commit | Line | Data |
---|---|---|
1 | <html> | |
2 | <head> | |
3 | <meta content="text/html; charset=windows-1252" http-equiv="content-type"> | |
4 | <title>BOOST_PP_TUPLE_INSERT</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_INSERT</b> macro | |
9 | inserts an element into an <i>tuple</i>.</div> | |
10 | <h4>Usage</h4> | |
11 | <div class="code"> <b>BOOST_PP_TUPLE_INSERT</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> The <i>tuple</i> into which an element is to be inserted. </dd> | |
17 | <dt>i</dt> | |
18 | <dd> The zero-based position in <i>tuple</i> where an element is to be | |
19 | inserted. Valid values range from <i>0</i> to <b>BOOST_PP_TUPLE_SIZE</b>(<i>tuple</i>).</dd> | |
20 | <dt>elem</dt> | |
21 | <dd> The element to insert. </dd> | |
22 | </dl> | |
23 | <h4>Remarks</h4> | |
24 | <div> This macro inserts <i>elem</i> before the element at index <i>i</i>. | |
25 | </div> | |
26 | <div> If the operation attempts to create an <i>tuple</i> that is larger | |
27 | than <b>BOOST_PP_LIMIT_TUPLE</b>, the result is undefined.</div> | |
28 | <div> This macro uses <b>BOOST_PP_WHILE</b> interally. Therefore, to | |
29 | use the <i>d</i> parameter passed from other macros that use <b>BOOST_PP_WHILE</b>, | |
30 | see <b>BOOST_PP_TUPLE_INSERT_D</b>.</div> | |
31 | <h4>See Also</h4> | |
32 | <ul> | |
33 | <li><a href="tuple_insert_d.html">BOOST_PP_TUPLE_INSERT_D</a></li> | |
34 | </ul> | |
35 | <h4>Requirements</h4> | |
36 | <div> <b>Header:</b> <a href="../headers/tuple/insert.html"><boost/preprocessor/tuple/insert.hpp></a> | |
37 | </div> | |
38 | <h4>Sample Code</h4> | |
39 | <div> | |
40 | <pre>#include <<a href="../headers/tuple/insert.html">boost/preprocessor/tuple/insert.hpp</a>> | |
41 | ||
42 | #define TUPLE (a, b, d) | |
43 | ||
44 | <a href="tuple_insert.html">BOOST_PP_TUPLE_INSERT</a>(TUPLE, 2, c) // expands to (a, b, c, d) | |
45 | </pre></div> | |
46 | <hr size="1"> | |
47 |