Files
boost_mpl/doc/paper/html/index.html
T
2002-09-16 19:25:33 +00:00

182 lines
6.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<title>The Boost C++ Metaprogramming Library</title>
<link rel="stylesheet" href="article.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.50.0">
<meta name="keywords" content="template metaprogramming, generic programming, programming languages, C++, STL, type systems, polymorphism, compile-time">
<link rel="home" href="index.html" title="the boost c++ metaprogramming library">
<link rel="next" href="intro.html" title="1. introduction">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">The Boost C++ Metaprogramming Library</th>
</tr>
<tr>
<td width="20%" align="left">&nbsp;</td>
<th width="60%" align="center">&nbsp;</th>
<td width="20%" align="right">&nbsp;<a accesskey="n" href="intro.html">Next</a></td>
</tr>
</table>
<hr>
</div>
<div class="article">
<div class="titlepage">
<div>
<div class="articletitle">
<h1 class="title"><a name="id1124916"></a>The Boost C++ Metaprogramming Library</h1>
</div>
</div>
<div>
<div class="authorgroup">
<h4>Aleksey Gurtovoy<sup>i</sup> and David Abrahams<sup>ii</sup></h4>
<div class="affiliation"><sup>i</sup><span class="orgname">MetaCommunications,</span> <a href="mailto:agurtovoy@meta-comm.com">agurtovoy@meta-comm.com</a></div>
<div class="affiliation"><sup>ii</sup><span class="orgname">Boost Consulting,</span> <a href="mailto:david.abrahams@rcn.com">david.abrahams@rcn.com</a></div>
</div>
</div>
<div>
<div class="abstract">
<p class="title"><b>Abstract</b></p>
<p>This paper describes the <tt>Boost</tt> C++ template metaprogramming library (MPL), an extensible compile-time framework of algorithms, sequences and metafunction classes. The library brings together important abstractions from the generic and functional programming worlds to build a powerful and easy-to-use toolset which makes template metaprogramming practical enough for the real-world environments. The MPL is heavily influenced by its run-time equivalent - the Standard Template Library (STL), a part of the C++ standard library <span class="citation">[<a class="interlink" href="refs.html#ref.stl94" title="[stl94]">STL94</a>]</span>, <span class="citation">[<a class="interlink" href="refs.html#ref.iso98" title="[iso98]">ISO98</a>]</span>. Like the STL, it defines an open conceptual and implementation framework which can serve as a foundation for future contributions in the domain. The library's fundamental concepts and idioms enable the user to focus on solutions without navigating the universe of possible ad-hoc approaches to a given metaprogramming problem, even if no actual MPL code is used. The library also provides a compile-time lambda expression facility enabling arbitrary currying and composition of class templates, a feature whose runtime counterpart is often cited as missing from the STL. This paper explains the motivation, usage, design, and implementation of the MPL with examples of its real-life applications, and offers some lessons learned about C++ template metaprogramming.</p>
</div>
</div>
<div>
<div class="keywords">
<p><b>Keywords:</b> template metaprogramming, generic programming, programming languages, C++, STL, type systems, polymorphism, compile-time</p>
</div>
</div>
</div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl>
<dt>1. <a href="intro.html">Introduction</a></dt>
<dd>
<dl>
<dt>1.1. <a href="intro.html#intro.native">Native language metaprogramming</a></dt>
<dt>1.2. <a href="intro.html#intro.cxx">Metaprogramming in C++</a></dt>
<dd>
<dl>
<dt>1.2.1. <a href="intro.html#intro.cxx.numeric">Numeric computations</a></dt>
<dt>1.2.2. <a href="intro.html#intro.cxx.type">Type computations</a></dt>
<dt>1.2.3. <a href="intro.html#intro.cxx.seq">Type sequences</a></dt>
</dl>
</dd>
<dt>1.3. <a href="intro.html#intro.whymetaprog">Why metaprogramming?</a></dt>
<dt>1.4. <a href="intro.html#intro.whylibrary">Why a metaprogramming library?</a></dt>
</dl>
</dd>
<dt>2. <a href="usage.html">Basic usage</a></dt>
<dd>
<dl>
<dt>2.1. <a href="usage.html#typeselection">Conditional type selection</a></dt>
<dd>
<dl>
<dt>2.1.1. <a href="usage.html#delayedeval">Delayed evaluation</a></dt>
</dl>
</dd>
<dt>2.2. <a href="usage.html#metafunctions">Metafunctions</a></dt>
<dd>
<dl>
<dt>2.2.1. <a href="usage.html#metafunctions.simple">The simple form</a></dt>
<dt>2.2.2. <a href="usage.html#metafunctions.higherorder">Higher-order metafunctions</a></dt>
<dt>2.2.3. <a href="usage.html#metafunctions.classes">Metafunction classes</a></dt>
<dt>2.2.4. <a href="usage.html#metafunctions.onesize">One size fits all?</a></dt>
<dt>2.2.5. <a href="usage.html#metafunctions.lambda">From metafunction to metafunction class</a></dt>
</dl>
</dd>
<dt>2.3. <a href="usage.html#sequences">Sequences, algorithms, and iterators</a></dt>
<dd>
<dl>
<dt>2.3.1. <a href="usage.html#sequences.intro">Introduction</a></dt>
<dt>2.3.2. <a href="usage.html#sequences.algo">Algorithms and sequences</a></dt>
<dt>2.3.3. <a href="usage.html#sequences.concepts">Sequence concepts</a></dt>
<dt>2.3.4. <a href="usage.html#sequences.revisited">Ad hoc example revisited</a></dt>
<dt>2.3.5. <a href="usage.html#sequences.iterfold">iter_fold as the main iteration algorithm</a></dt>
<dt>2.3.6. <a href="usage.html#sequences.numbers">Sequences of numbers</a></dt>
<dt>2.3.7. <a href="usage.html#sequences.variety">A variety of sequences</a></dt>
<dt>2.3.8. <a href="usage.html#sequences.unrolling">Loop/recursion unrolling</a></dt>
</dl>
</dd>
</dl>
</dd>
<dt>3. <a href="lambda.html">Lambda facility</a></dt>
<dt>4. <a href="codegeneration.html">Code generation facilities</a></dt>
<dt>5. <a href="example.html">Example: a compile-time FSM generator</a></dt>
<dd>
<dl>
<dt>5.1. <a href="example.html#example.impl">Implementation</a></dt>
<dt>5.2. <a href="example.html#example.relatedwork">Related work</a></dt>
</dl>
</dd>
<dt>6. <a href="acknowl.html">Acknowledgements</a></dt>
<dt><a href="refs.html">References</a></dt>
</dl>
</div>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">&nbsp;</td>
<td width="20%" align="center">&nbsp;</td>
<td width="40%" align="right">&nbsp;<a accesskey="n" href="intro.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">&nbsp;</td>
<td width="20%" align="center">&nbsp;</td>
<td width="40%" align="right" valign="top">&nbsp;1. Introduction</td>
</tr>
</table>
</div>
</body>
</html>