• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3	<title>BOOST_PP_LOCAL_LIMITS</title>
4	<link rel="stylesheet" type="text/css" href="../styles.css">
5</head>
6<body>
7	<div style="margin-left:  0px;">
8		The <b>BOOST_PP_LOCAL_LIMITS</b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_LOCAL_ITERATE</b>.
9	</div>
10	<h4>Usage</h4>
11		<div class="code">
12			#define <b>BOOST_PP_LOCAL_LIMITS</b> (<i>start</i>, <i>finish</i>)
13		</div>
14	<h4>Arguments</h4>
15		<dl>
16			<dt>start</dt>
17			<dd>
18				The lower bound (inclusive) of a <i>local iteration</i>.&nbsp;
19				Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
20			</dd>
21			<dt>finish</dt>
22			<dd>
23				The upper bound (inclusive) of a <i>local iteration</i>.&nbsp;
24				Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
25			</dd>
26		</dl>
27	<h4>Remarks</h4>
28		<div>
29			Note that there is a whitespace character after the macro identifier.
30		</div>
31		<div>
32			This macro must expand to a <i>2</i>-element <i>tuple</i>.&nbsp;
33			The elements of this <i>tuple</i> represent the lower and upper boundaries of a <i>local iteration</i>.&nbsp;
34			Both <i>start</i> and <i>finish</i> are <i>evaluated parameters</i>.&nbsp;
35			This implies that they can include simple arithmetic expressions (such as <i>1</i> + <i>3</i>), etc..
36		</div>
37		<div>
38			This macro is automatically undefined for reuse by a call to <b>BOOST_PP_LOCAL_ITERATE</b>.
39		</div>
40	<h4>See Also</h4>
41		<ul>
42			<li><a href="limit_iteration.html">BOOST_PP_LIMIT_ITERATION</a></li>
43			<li><a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a></li>
44		</ul>
45	<h4>Sample Code</h4>
46<div><pre>
47#include &lt;<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>&gt;
48
49template&lt;int&gt; struct sample;
50
51#define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \
52   template&lt;&gt; struct sample&lt;n&gt; { \
53      enum { value = n }; \
54   }; \
55   /**/
56
57#define <a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a> (1, 5)
58
59#include <a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a>()
60/* expands to...
61template&lt;&gt; struct sample&lt;1&gt; { enum { value = 1 }; };
62template&lt;&gt; struct sample&lt;2&gt; { enum { value = 2 }; };
63template&lt;&gt; struct sample&lt;3&gt; { enum { value = 3 }; };
64template&lt;&gt; struct sample&lt;4&gt; { enum { value = 4 }; };
65template&lt;&gt; struct sample&lt;5&gt; { enum { value = 5 }; };
66*/
67</pre></div>
68	<hr size="1">
69	<div style="margin-left: 0px;">
70		<i>� Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
71		</br><i>� Copyright Paul Mensonides 2002</i>
72	</div>
73	<div style="margin-left: 0px;">
74		<p><small>Distributed under the Boost Software License, Version 1.0. (See
75		accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
76		copy at <a href=
77		"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
78	</div>
79</body>
80</html>
81