]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <title>BOOST_PP_LOCAL_MACRO</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_MACRO</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_MACRO</b>(<i>n</i>) ... | |
13 | </div> | |
14 | <h4>Arguments</h4> | |
15 | <dl> | |
16 | <dt>n</dt> | |
17 | <dd> | |
18 | The current iteration value received from the <i>local-iteration</i> mechanism. | |
19 | </dd> | |
20 | </dl> | |
21 | <h4>Remarks</h4> | |
22 | <div> | |
23 | This macro is automatically undefined for reuse by a call to <b>BOOST_PP_LOCAL_ITERATE</b>. | |
24 | </div> | |
25 | <h4>See Also</h4> | |
26 | <ul> | |
27 | <li><a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a></li> | |
28 | </ul> | |
29 | <h4>Sample Code</h4> | |
30 | <div><pre> | |
31 | #include <<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>> | |
32 | ||
33 | template<int> struct sample; | |
34 | ||
35 | #define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \ | |
36 | template<> struct sample<n> { \ | |
37 | enum { value = n }; \ | |
38 | }; \ | |
39 | /**/ | |
40 | ||
41 | #define <a href="local_limits.html">BOOST_PP_LOCAL_LIMITS</a> (1, 5) | |
42 | ||
43 | #include <a href="local_iterate.html">BOOST_PP_LOCAL_ITERATE</a>() | |
44 | /* expands to... | |
45 | template<> struct sample<1> { enum { value = 1 }; }; | |
46 | template<> struct sample<2> { enum { value = 2 }; }; | |
47 | template<> struct sample<3> { enum { value = 3 }; }; | |
48 | template<> struct sample<4> { enum { value = 4 }; }; | |
49 | template<> struct sample<5> { enum { value = 5 }; }; | |
50 | */ | |
51 | </pre></div> | |
52 | <hr size="1"> | |
53 | <div style="margin-left: 0px;"> | |
54 |