Imported Upstream version 1.57.0
[platform/upstream/boost.git] / libs / preprocessor / doc / data / arrays.html
1 <html>
2   <head>
3     <title>arrays.html</title>
4     <link rel="stylesheet" type="text/css" href="../styles.css">
5   </head>
6   <body>
7     <h4>Arrays</h4>
8     <div> An <i>array</i> is a data structure consisting of a two-element <i>tuple</i>.&nbsp;
9       The first element is the number of elements in the <i>array</i>.&nbsp;
10       The second element is another <i>tuple</i> of the elements in the <i>array</i>.&nbsp;
11       For example, </div>
12     <div class="code"> (<i>3</i>, (<i>a</i>, <i>b</i>, <i>c</i>)) </div>
13     <div> ...is an <i>array</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and
14       <i>c</i>. </div>
15     <div> The primary strength of <i>arrays</i> is that they store their own
16       size.&nbsp; Because of this, access to elements does not require the
17       size.&nbsp; It only requires that an element exists at a certain index. </div>
18     <div> This allows macro parameters to be variable in size and allows data
19       states to change size without the user explicitly keeping track of the
20       size independently.</div>
21     <div>With variadic macro support a <i>tuple </i>has all of the
22       functionality as an <i>array</i>, knows its own size, and is easier
23       syntactically to use. Because of that an <i>array</i> should be used, as
24       opposed to a <i>tuple</i>, only if your compiler does not support
25       variadic macros.<br>
26       <br>
27       Elements of an <i>array</i> can be extracted with <b>BOOST_PP_ARRAY_ELEM</b>,
28       an <i>array's</i> size can be extracted with <b>BOOST_PP_ARRAY_SIZE</b>,
29       and an <i>array</i> can be converted to the more primitive <i>tuple</i>
30       data structure with <b>BOOST_PP_ARRAY_DATA</b>. </div>
31     <h4>Primitives</h4>
32     <ul>
33       <li><a href="../ref/array_data.html">BOOST_PP_ARRAY_DATA</a></li>
34       <li><a href="../ref/array_elem.html">BOOST_PP_ARRAY_ELEM</a></li>
35       <li><a href="../ref/array_size.html">BOOST_PP_ARRAY_SIZE</a></li>
36     </ul>
37     <hr size="1">
38     <div style="margin-left: 0px;"> <i>© Copyright <a href="http://www.housemarque.com"
39           target="_top">Housemarque Oy</a> 2002</i> <br>
40       <i>© Copyright Paul Mensonides 2002</i> </div>
41     <div style="margin-left: 0px;">
42       <p><small>Distributed under the Boost Software License, Version 1.0. (See
43           accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
44           or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
45     </div>
46   </body>
47 </html>