File: arrays.html

package info (click to toggle)
boost 1.33.1-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 100,948 kB
  • ctags: 145,103
  • sloc: cpp: 573,492; xml: 49,055; python: 15,626; ansic: 13,588; sh: 2,099; yacc: 858; makefile: 660; perl: 427; lex: 111; csh: 6
file content (42 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
<head>
	<title>arrays.html</title>
	<link rel="stylesheet" type="text/css" href="../styles.css">
</head>
<body>
	<h4>Arrays</h4>
	<div>
		An <i>array</i> is a data structure consisting of a two-element <i>tuple</i>.&nbsp;
		The first element is the number of elements in the <i>array</i>.&nbsp;
		The second element is another <i>tuple</i> of the elements in the <i>array</i>.&nbsp;
		For example,
	</div>
	<div class="code">
		(<i>3</i>, (<i>a</i>, <i>b</i>, <i>c</i>))
	</div>
	<div>
		...is an <i>array</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
	</div>
	<div>
		The primary strength of <i>arrays</i> is that they store their own size.&nbsp;
		Because of this, access to elements does not require the size.&nbsp;
		It only requires that an element exists at a certain index.
	</div>
	<div>
		This allows macro parameters to be variable in size and allows data states to change
		size without the user explicitly keeping track of the size independently.
	</div>
	<div>
		Elements of an <i>array</i> can be extracted with <b>BOOST_PP_ARRAY_ELEM</b>,
		an <i>array's</i> size can be extracted with <b>BOOST_PP_ARRAY_SIZE</b>, and
		an <i>array</i> can be converted to the more primitive <i>tuple</i> data structure
		with <b>BOOST_PP_ARRAY_DATA</b>.
	</div>
	<h4>Primitives</h4>
		<ul>
			<li><a href="../ref/array_data.html">BOOST_PP_ARRAY_DATA</a></li>
			<li><a href="../ref/array_elem.html">BOOST_PP_ARRAY_ELEM</a></li>
			<li><a href="../ref/array_size.html">BOOST_PP_ARRAY_SIZE</a></li>
		</ul>
</body>
</html>