Starting to use the new templates

[SVN r12718]
This commit is contained in:
Vesa Karvonen
2002-02-05 08:27:20 +00:00
parent 6248559797
commit 41d99b49e4
8 changed files with 239 additions and 172 deletions

View File

@ -1,36 +1,47 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Boost PREPROCESSOR library</TITLE>
<BODY bgcolor="#FFFFFF">
<a href="index.htm"><IMG height=86
alt="c++boost.gif (8819 bytes)"
src="../../../c++boost.gif"
width=277 align=center></a>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Tutorial</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<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>
<h2 align="center">Tutorial</h2>
</td>
</tr>
</table>
<hr>
<h1>Boost PREPROCESSOR library: Tutorial</h1>
<hr>
<h2>Contents</h2>
<ul>
<li><a href="#Motivation">Motivation</a></li>
<li><a href="#Techniques">Preprocessor Metaprogramming Techniques</a>
<ul>
<li><a href="#Local Macro">Use a Local Macro to avoid small scale repetition</a></li>
<li><a href="#UNUSED">Use BOOST_PP_EMPTY as an unused parameter in Local
Macro instantiations</a></li>
<li><a href="#CAT">Use BOOST_PP_CAT instead of ## when necessary</a></li>
<li><a href="#STRINGIZE">Use BOOST_PP_STRINGIZE instead of # whenever necessary</a></li>
<li><a href="#ENUM_PARAMS">Avoid O(N) repetition on lists in general</a></li>
<li><a href="#Conditional Define">Use a Conditional Define to enable user configuration of code repetition</a></li>
<li><a href="#Token Look-Up">Use Token Look-Up Function to eliminate categorical repetition</a></li>
<li><a href="#2ND_REPEAT">Use BOOST_PP_REPEAT_2ND to avoid O(N*N) repetition</a></li>
<li><a href="#IF">Use BOOST_PP_IF to implement special case for the first element</a>
<li><a href="#Arithmetic">Use arithmetic, logical and comparison operations when necessary</a>
</li>
</ul>
</li>
</ul>
<dl>
<dt><a href="#Motivation">Motivation</a></dt>
<dt><a href="#Techniques">Preprocessor Metaprogramming Techniques</a>
<dl>
<dt><a href="#Local Macro">Use a Local Macro to avoid small scale repetition</a></dt>
<dt><a href="#UNUSED">Use BOOST_PP_EMPTY as an unused parameter in Local
Macro instantiations</a></dt>
<dt><a href="#CAT">Use BOOST_PP_CAT instead of ## when necessary</a></dt>
<dt><a href="#STRINGIZE">Use BOOST_PP_STRINGIZE instead of # whenever necessary</a></dt>
<dt><a href="#ENUM_PARAMS">Avoid O(N) repetition on lists in general</a></dt>
<dt><a href="#Conditional Define">Use a Conditional Define to enable user configuration of code repetition</a></dt>
<dt><a href="#Token Look-Up">Use Token Look-Up Function to eliminate categorical repetition</a></dt>
<dt><a href="#2ND_REPEAT">Use BOOST_PP_REPEAT_2ND to avoid O(N*N) repetition</a></dt>
<dt><a href="#IF">Use BOOST_PP_IF to implement special case for the first element</a></dt>
<dt><a href="#Arithmetic">Use arithmetic, logical and comparison operations when necessary</a></dt>
</dl>
</dt>
</dl>
<hr>
<h2><a name="Motivation">Motivation</a></h2>
<p>The C++ function and template parameter lists are special syntactic constructs
and it is impossible to directly manipulate or generate them using C++ constructs.
This leads to unnecessary code repetition.</p>
@ -475,14 +486,15 @@ SPECIAL_NUMBERED_LIST(3,3,E,S)
</blockquote>
<hr>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<P></P>
<p><EFBFBD> Copyright Housemarque Oy 2001</p>
<p>Permission to copy, use, modify, sell and distribute this document is granted
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
for any purpose. </p>
<p>Updated: <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
</BODY></HTML>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
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
for any purpose.</i></p>
</body>
</html>