Files
boost_preprocessor/doc/reference/repeat_from_to.htm
T

90 lines
3.2 KiB
HTML
Raw Normal View History

2002-04-04 08:23:26 +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-04-04 08:23:26 +00:00
<title>Boost.Preprocessor - Reference</title>
</head>
2002-05-16 22:17:39 +00:00
<body link="#0000ff" vlink="#800080">
2002-04-04 08:23:26 +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 &lt;<a href="../../../../boost/preprocessor/repeat_from_to.hpp">boost/preprocessor/repeat_from_to.hpp</a>&gt;</h2>
2002-04-04 08:23:26 +00:00
</td>
</tr>
</table>
<hr>
<a href="repeat_3rd.htm">Prev</a> <a href="repeat_from_to_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
2002-05-16 22:17:39 +00:00
<h3><a name="BOOST_PP_REPEAT_FROM_TO">#define BOOST_PP_REPEAT_FROM_TO</a>(FIRST,LAST,MACRO,DATA)</h3>
2002-04-15 06:49:49 +00:00
<p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [FIRST,LAST)</code>.</p>
2002-04-04 08:23:26 +00:00
<p>In other words, expands to the sequence:</p>
<pre>
2002-05-18 12:53:05 +00:00
MACRO(FIRST,DATA) MACRO(<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(FIRST),DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(LAST),DATA)
2002-04-04 08:23:26 +00:00
</pre>
<p>For example,</p>
<pre>
2002-05-18 12:53:05 +00:00
#define TEST(INDEX,DATA) DATA(INDEX);
<a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>(4,7,TEST,X)
2002-04-04 08:23:26 +00:00
</pre>
<p>expands to:</p>
<pre>
2002-05-18 12:53:05 +00:00
X(4); X(5); X(6);
2002-04-04 08:23:26 +00:00
</pre>
2002-06-07 13:04:18 +00:00
<h3>2D and 3D repetition</h3>
<p><a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>() implements automatic recursion. 2D and 3D repetition
are directly supported.</p>
<h3>See</h3>
2002-04-04 08:23:26 +00:00
<ul>
2002-06-07 13:04:18 +00:00
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</li>
<li><a href="limits.htm#BOOST_PP_LIMIT_DIM">BOOST_PP_LIMIT_DIM</a></li>
<li><a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a></li>
2002-04-04 08:23:26 +00:00
</ul>
<h3>Test</h3>
<ul>
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
2002-06-07 13:04:18 +00:00
<li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
2002-04-04 08:23:26 +00:00
</ul>
<hr>
2002-06-07 13:04:18 +00:00
<h3><a name="BOOST_PP_REPEAT_FROM_TO_2ND">#define BOOST_PP_REPEAT_FROM_TO_2ND</a></h3>
<p>Obsolete, just use <a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>().</p>
<hr>
<h3><a name="BOOST_PP_REPEAT_FROM_TO_3RD">#define BOOST_PP_REPEAT_FROM_TO_3RD</a></h3>
<p>Obsolete, just use <a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>().</p>
<hr>
2002-04-04 08:23:26 +00:00
<a href="repeat_3rd.htm">Prev</a> <a href="repeat_from_to_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; 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-04-04 08:23:26 +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-04-04 08:23:26 +00:00
</body></html>