Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/preprocessor/doc/data/arrays.html @ 12

Last change on this file since 12 was 12, checked in by landauf, 17 years ago

added boost

File size: 1.5 KB
Line 
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>
9                An <i>array</i> is a data structure consisting of a two-element <i>tuple</i>.&nbsp;
10                The first element is the number of elements in the <i>array</i>.&nbsp;
11                The second element is another <i>tuple</i> of the elements in the <i>array</i>.&nbsp;
12                For example,
13        </div>
14        <div class="code">
15                (<i>3</i>, (<i>a</i>, <i>b</i>, <i>c</i>))
16        </div>
17        <div>
18                ...is an <i>array</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
19        </div>
20        <div>
21                The primary strength of <i>arrays</i> is that they store their own size.&nbsp;
22                Because of this, access to elements does not require the size.&nbsp;
23                It only requires that an element exists at a certain index.
24        </div>
25        <div>
26                This allows macro parameters to be variable in size and allows data states to change
27                size without the user explicitly keeping track of the size independently.
28        </div>
29        <div>
30                Elements of an <i>array</i> can be extracted with <b>BOOST_PP_ARRAY_ELEM</b>,
31                an <i>array's</i> size can be extracted with <b>BOOST_PP_ARRAY_SIZE</b>, and
32                an <i>array</i> can be converted to the more primitive <i>tuple</i> data structure
33                with <b>BOOST_PP_ARRAY_DATA</b>.
34        </div>
35        <h4>Primitives</h4>
36                <ul>
37                        <li><a href="../ref/array_data.html">BOOST_PP_ARRAY_DATA</a></li>
38                        <li><a href="../ref/array_elem.html">BOOST_PP_ARRAY_ELEM</a></li>
39                        <li><a href="../ref/array_size.html">BOOST_PP_ARRAY_SIZE</a></li>
40                </ul>
41</body>
42</html>
Note: See TracBrowser for help on using the repository browser.