blob: b0f00f059b2efb8192747416997326f0c9bc32da [file] [log] [blame]
Brian Silvermanf27e0852018-08-04 23:56:45 -07001<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 &lt;<a href="../headers/iteration/local.html">boost/preprocessor/iteration/local.hpp</a>&gt;
32
33template&lt;int&gt; struct sample;
34
35#define <a href="local_macro.html">BOOST_PP_LOCAL_MACRO</a>(n) \
36 template&lt;&gt; struct sample&lt;n&gt; { \
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...
45template&lt;&gt; struct sample&lt;1&gt; { enum { value = 1 }; };
46template&lt;&gt; struct sample&lt;2&gt; { enum { value = 2 }; };
47template&lt;&gt; struct sample&lt;3&gt; { enum { value = 3 }; };
48template&lt;&gt; struct sample&lt;4&gt; { enum { value = 4 }; };
49template&lt;&gt; struct sample&lt;5&gt; { enum { value = 5 }; };
50*/
51</pre></div>
52 <hr size="1">
53 <div style="margin-left: 0px;">
54 <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
55 </br><i>© Copyright Paul Mensonides 2002</i>
56 </div>
57 <div style="margin-left: 0px;">
58 <p><small>Distributed under the Boost Software License, Version 1.0. (See
59 accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
60 copy at <a href=
61 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
62 </div>
63</body>
64</html>