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) --> |
---|
7 | <head> |
---|
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 MPL Reference Manual: Algorithms</title> |
---|
11 | <link rel="stylesheet" href="../style.css" type="text/css" /> |
---|
12 | </head> |
---|
13 | <body class="docframe refmanual"> |
---|
14 | <table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./iterator-category.html" class="navigation-link">Prev</a> <a href="./algorithms-concepts.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./iterators.html" class="navigation-link">Back</a> <a href="./metafunctions.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="../refmanual.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
---|
15 | <td class="header-group page-location"><a href="../refmanual.html" class="navigation-link">Front Page</a> / <a href="./algorithms.html" class="navigation-link">Algorithms</a></td> |
---|
16 | </tr></table><div class="header-separator"></div> |
---|
17 | <div class="section" id="algorithms"> |
---|
18 | <h1><a class="toc-backref" href="../refmanual.html#id388" name="algorithms">Algorithms</a></h1> |
---|
19 | <a class="target" id="label-algorithms" name="label-algorithms"></a><p>The MPL provides a broad range of fundamental algorithms aimed to |
---|
20 | satisfy the majority of sequential compile-time data processing |
---|
21 | needs. The algorithms include compile-time counterparts |
---|
22 | of many of the STL algorithms, iteration algorithms borrowed from |
---|
23 | functional programming languages, and more.</p> |
---|
24 | <p>Unlike the algorithms in the C++ Standard Library, which operate on |
---|
25 | implict <em>iterator ranges</em>, the majority of MPL counterparts take |
---|
26 | and return <em>sequences</em>. This derivation is not dictated by the |
---|
27 | functional nature of C++ compile-time computations per se, but |
---|
28 | rather by a desire to improve general usability of the library, |
---|
29 | making programming with compile-time data structures as enjoyable |
---|
30 | as possible.</p> |
---|
31 | <!-- This can be seen as a further generalization and extension of |
---|
32 | the STL's conceptual framework. --> |
---|
33 | <p>In the spirit of the STL, MPL algorithms are <em>generic</em>, meaning |
---|
34 | that they are not tied to particular sequence class |
---|
35 | implementations, and can operate on a wide range of arguments as |
---|
36 | long as they satisfy the documented requirements. The requirements |
---|
37 | are formulated in terms of concepts. Under the hood, |
---|
38 | algorithms are decoupled from concrete sequence |
---|
39 | implementations by operating on <a class="reference" href="./iterators.html">Iterators</a>.</p> |
---|
40 | <p>All MPL algorithms can be sorted into three |
---|
41 | major categories: iteration algorithms, querying algorithms, and |
---|
42 | transformation algorithms. The transformation algorithms introduce |
---|
43 | an associated <a class="reference" href="./inserter.html">Inserter</a> concept, a rough equivalent for the notion of |
---|
44 | <a class="reference" href="http://www.sgi.com/tech/stl/OutputIterator.html" target="_top">Output Iterator</a> in the Standard Library. Moreover, every |
---|
45 | transformation algorithm provides a <tt class="literal"><span class="pre">reverse_</span></tt> counterpart, |
---|
46 | allowing for a wider range of efficient transformations — a |
---|
47 | common functionality documented by the <a class="reference" href="./reversible-algorithm.html">Reversible Algorithm</a> |
---|
48 | concept.</p> |
---|
49 | <!-- modtime: November 29, 2004 06:33:05 +0000 --> |
---|
50 | <ul class="toc simple" id="outline"> |
---|
51 | <li><a class="reference" href="./algorithms-concepts.html" id="id389" name="id389">Concepts</a></li> |
---|
52 | <li><a class="reference" href="./inserters.html" id="id392" name="id392">Inserters</a></li> |
---|
53 | <li><a class="reference" href="./iteration-algorithms.html" id="id396" name="id396">Iteration Algorithms</a></li> |
---|
54 | <li><a class="reference" href="./querying-algorithms.html" id="id402" name="id402">Querying Algorithms</a></li> |
---|
55 | <li><a class="reference" href="./transformation-algorithms.html" id="id413" name="id413">Transformation Algorithms</a></li> |
---|
56 | <li><a class="reference" href="./runtime-algorithms.html" id="id436" name="id436">Runtime Algorithms</a></li> |
---|
57 | </ul> |
---|
58 | </div> |
---|
59 | |
---|
60 | <div class="footer-separator"></div> |
---|
61 | <table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./iterator-category.html" class="navigation-link">Prev</a> <a href="./algorithms-concepts.html" class="navigation-link">Next</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./iterators.html" class="navigation-link">Back</a> <a href="./metafunctions.html" class="navigation-link">Along</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="../refmanual.html" class="navigation-link">Up</a> <a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator"> | </span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td> |
---|
62 | </tr></table></body> |
---|
63 | </html> |
---|