]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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>. | |
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>. | |
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>. | |
33 | The elements of this <i>tuple</i> represent the lower and upper boundaries of a <i>local iteration</i>. | |
34 | Both <i>start</i> and <i>finish</i> are <i>evaluated parameters</i>. | |
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 <<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>> | |
48 | ||
49 | template<int> struct sample; | |
50 | ||
51 | #define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \ | |
52 | template<> struct sample<n> { \ | |
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... | |
61 | template<> struct sample<1> { enum { value = 1 }; }; | |
62 | template<> struct sample<2> { enum { value = 2 }; }; | |
63 | template<> struct sample<3> { enum { value = 3 }; }; | |
64 | template<> struct sample<4> { enum { value = 4 }; }; | |
65 | template<> struct sample<5> { enum { value = 5 }; }; | |
66 | */ | |
67 | </pre></div> | |
68 | <hr size="1"> | |
69 | <div style="margin-left: 0px;"> | |
70 |