2002-02-04 14:57:59 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
2002-05-16 22:17:39 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../../../../boost.css">
|
2002-02-05 12:16:25 +00:00
|
|
|
<title>Boost.Preprocessor - Reference</title>
|
2002-02-04 14:57:59 +00:00
|
|
|
</head>
|
2002-05-16 22:17:39 +00:00
|
|
|
<body link="#0000ff" vlink="#800080">
|
2002-02-04 14:57:59 +00:00
|
|
|
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
|
|
|
|
"header">
|
|
|
|
<tr>
|
|
|
|
<td valign="top" width="300">
|
|
|
|
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
|
|
|
|
</td>
|
|
|
|
<td valign="top">
|
|
|
|
<h1 align="center">Boost.Preprocessor</h1>
|
2002-05-17 21:24:59 +00:00
|
|
|
<h2 align="center">Header <<a href="../../../../boost/preprocessor/repeat.hpp">boost/preprocessor/repeat.hpp</a>></h2>
|
2002-02-04 14:57:59 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<hr>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<a href="min.htm">Prev</a> <a href="repeat_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
2002-05-16 22:17:39 +00:00
|
|
|
<h3><a name="BOOST_PP_REPEAT">#define BOOST_PP_REPEAT</a>(COUNT,MACRO,DATA)</h3>
|
2002-04-15 06:49:49 +00:00
|
|
|
<p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [0,COUNT)</code>.</p>
|
2002-02-04 14:57:59 +00:00
|
|
|
|
|
|
|
<p>In other words, expands to the sequence:</p>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<pre>
|
2002-05-18 12:53:05 +00:00
|
|
|
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
2002-02-04 14:57:59 +00:00
|
|
|
</pre>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-03-10 12:31:37 +00:00
|
|
|
<p>For example,</p>
|
|
|
|
|
|
|
|
<pre>
|
2002-05-18 12:53:05 +00:00
|
|
|
#define TEST(INDEX,DATA) DATA(INDEX);
|
|
|
|
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(3,TEST,X)
|
2002-03-10 12:31:37 +00:00
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>expands to:</p>
|
|
|
|
|
|
|
|
<pre>
|
2002-05-18 12:53:05 +00:00
|
|
|
X(0); X(1); X(2);
|
2002-03-10 12:31:37 +00:00
|
|
|
</pre>
|
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<h3>2D and 3D repetition</h3>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-06-07 13:04:18 +00:00
|
|
|
<p><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>() implements automatic recursion. 2D and 3D repetition
|
|
|
|
are directly supported.</p>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<h3>Example</h3>
|
|
|
|
<ul>
|
2002-02-27 05:54:07 +00:00
|
|
|
<li><a href="../../example/duffs_device.c">duffs_device.c</a></li>
|
2002-02-04 14:57:59 +00:00
|
|
|
<li><a href="../../example/repeat_2d.c">repeat_2d.c</a></li>
|
|
|
|
</ul>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<h3>See</h3>
|
|
|
|
<ul>
|
|
|
|
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</li>
|
2002-06-07 13:04:18 +00:00
|
|
|
<li><a href="limits.htm#BOOST_PP_LIMIT_DIM">BOOST_PP_LIMIT_DIM</a></li>
|
2002-02-04 14:57:59 +00:00
|
|
|
<li><a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a></li>
|
|
|
|
</ul>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-06-07 13:04:18 +00:00
|
|
|
<h3>Test</h3>
|
|
|
|
<ul>
|
|
|
|
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
|
|
|
<li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<h3><a name="BOOST_PP_REPEAT_2ND">#define BOOST_PP_REPEAT_2ND</a></h3>
|
|
|
|
<p>Obsolete, just use <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>().</p>
|
|
|
|
<hr>
|
|
|
|
|
|
|
|
<h3><a name="BOOST_PP_REPEAT_3RD">#define BOOST_PP_REPEAT_3RD</a></h3>
|
|
|
|
<p>Obsolete, just use <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>().</p>
|
2002-02-04 14:57:59 +00:00
|
|
|
<hr>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<a href="min.htm">Prev</a> <a href="repeat_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
2002-01-31 15:36:01 +00:00
|
|
|
<hr>
|
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
<p><i>© Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
|
|
|
|
|
2002-05-16 22:17:39 +00:00
|
|
|
<p>Permission to copy, use, modify, sell and distribute this document is granted
|
2002-01-31 15:36:01 +00:00
|
|
|
provided this copyright notice appears in all copies. This document is provided
|
|
|
|
"as is" without express or implied warranty, and with no claim as to its suitability
|
2002-05-16 22:17:39 +00:00
|
|
|
for any purpose.</p>
|
2002-01-31 15:36:01 +00:00
|
|
|
|
2002-02-04 14:57:59 +00:00
|
|
|
</body></html>
|