Brian Silverman | f27e085 | 2018-08-04 23:56:45 -0700 | [diff] [blame^] | 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 | <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> |