1 <?xml version=
"1.0" encoding=
"utf-8" ?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
4 <!-- Copyright Aleksey Gurtovoy 2006. Distributed under the Boost -->
5 <!-- Software License, Version 1.0. (See accompanying -->
6 <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
8 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
9 <meta name=
"generator" content=
"Docutils 0.3.6: http://docutils.sourceforge.net/" />
10 <title>THE BOOST MPL LIBRARY: Tutorial: Metafunctions and Higher-Order Metaprogramming
</title>
11 <link rel=
"stylesheet" href=
"../style.css" type=
"text/css" />
13 <body class=
"docframe">
14 <table class=
"header"><tr class=
"header"><td class=
"header-group navigation-bar"><span class=
"navigation-group"><a href=
"../index.html" class=
"navigation-link">Prev
</a> <a href=
"./dimensional-analysis.html" class=
"navigation-link">Next
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group">Back
<a href=
"./reference-manual.html" class=
"navigation-link">Along
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group"><a href=
"../index.html" class=
"navigation-link">Up
</a> <a href=
"../index.html" class=
"navigation-link">Home
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group"><a href=
"./tutorial_toc.html" class=
"navigation-link">Full TOC
</a></span></td>
15 <td class=
"header-group page-location"><a href=
"../index.html" class=
"navigation-link">Front Page
</a> /
<a href=
"./tutorial-metafunctions.html" class=
"navigation-link">Tutorial: Metafunctions and Higher-Order Metaprogramming
</a></td>
16 </tr></table><div class=
"header-separator"></div>
17 <div class=
"section" id=
"tutorial-metafunctions">
18 <h1><a class=
"toc-backref" href=
"../index.html#id40" name=
"tutorial-metafunctions">Tutorial: Metafunctions and Higher-Order Metaprogramming
</a></h1>
19 <table class=
"field-list" frame=
"void" rules=
"none">
20 <col class=
"field-name" />
21 <col class=
"field-body" />
23 <tr class=
"field"><th class=
"field-name">Note:
</th><td class=
"field-body">The following material is an excerpt from Chapter
3 of
"<a class=
"reference" href=
"http://www.awprofessional.com/titles/0321227255" target=
"_top">C++ Template Metaprogramming
</a>",
24 by David Abrahams and Aleksey Gurtovoy, ISBN
0321227255,
<a class=
"reference" href=
"http://www.awprofessional.com/titles/0321227255" target=
"_top">http://www.awprofessional.com/titles/
0321227255</a>.
25 Copyright (c)
2005 by Pearson Education, Inc. Reprinted with permission.
</td>
29 <p>With the foundation laid so far, we're ready to explore one of the
30 most basic uses for template metaprogramming techniques: adding
31 static type checking to traditionally unchecked operations. We'll
32 look at a practical example from science and engineering that can
33 find applications in almost any numerical code.
34 Along the way you'll learn some important new concepts and
35 get a taste of metaprogramming at a high level using the MPL.
</p>
36 <ul class=
"toc simple" id=
"outline">
37 <li><a class=
"reference" href=
"./dimensional-analysis.html" id=
"id41" name=
"id41">Dimensional Analysis
</a></li>
38 <li><a class=
"reference" href=
"./higher-order.html" id=
"id47" name=
"id47">Higher-Order Metafunctions
</a></li>
39 <li><a class=
"reference" href=
"./handling-placeholders.html" id=
"id48" name=
"id48">Handling Placeholders
</a></li>
40 <li><a class=
"reference" href=
"./more-lambda-capabilities.html" id=
"id51" name=
"id51">More Lambda Capabilities
</a></li>
41 <li><a class=
"reference" href=
"./lambda-details.html" id=
"id54" name=
"id54">Lambda Details
</a></li>
42 <li><a class=
"reference" href=
"./details.html" id=
"id59" name=
"id59">Details
</a></li>
43 <li><a class=
"reference" href=
"./exercises.html" id=
"id60" name=
"id60">Exercises
</a></li>
47 <div class=
"footer-separator"></div>
48 <table class=
"footer"><tr class=
"footer"><td class=
"header-group navigation-bar"><span class=
"navigation-group"><a href=
"../index.html" class=
"navigation-link">Prev
</a> <a href=
"./dimensional-analysis.html" class=
"navigation-link">Next
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group">Back
<a href=
"./reference-manual.html" class=
"navigation-link">Along
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group"><a href=
"../index.html" class=
"navigation-link">Up
</a> <a href=
"../index.html" class=
"navigation-link">Home
</a></span><span class=
"navigation-group-separator"> |
</span><span class=
"navigation-group"><a href=
"./tutorial_toc.html" class=
"navigation-link">Full TOC
</a></span></td>