• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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<head>
5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6<meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
7<title>The MPL Reference Manual: Transformation Algorithms</title>
8<link rel="stylesheet" href="../style.css" type="text/css" />
9</head>
10<body class="docframe refmanual">
11<table class="header"><tr class="header"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./equal.html" class="navigation-link">Prev</a>&nbsp;<a href="./copy.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./querying-algorithms.html" class="navigation-link">Back</a>&nbsp;<a href="./runtime-algorithms.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./algorithms.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
12<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> / <a href="./transformation-algorithms.html" class="navigation-link">Transformation Algorithms</a></td>
13</tr></table><div class="header-separator"></div>
14<div class="section" id="transformation-algorithms">
15<h1><a class="toc-backref" href="./algorithms.html#id1485">Transformation Algorithms</a></h1>
16<p id="label-algorithms-transformation-algorithms">According to their name, MPL's <em>transformation</em>, or <em>sequence-building
17algorithms</em> provide the tools for building new sequences from the existing
18ones by performing some kind of transformation. A typical transformation
19alogrithm takes one or more input sequences and a transformation
20metafunction/predicate, and returns a new sequence built according to the
21algorithm's semantics through the means of its <a class="reference internal" href="./inserter.html">Inserter</a> argument, which
22plays a role similar to the role of run-time <a class="reference external" href="https://boost.org/sgi/stl/OutputIterator.html" target="_top">Output Iterator</a>.</p>
23<!-- Say something about optionality of Inserters/their default behavior -->
24<p>Every transformation algorithm is a <a class="reference internal" href="./reversible-algorithm.html">Reversible Algorithm</a>, providing
25an accordingly named <tt class="literal"><span class="pre">reverse_</span></tt> counterpart carrying the transformation
26in the reverse order. Thus, all sequence-building algorithms come in pairs,
27for instance <tt class="literal"><span class="pre"><a href="./replace.html" class="identifier">replace</a></span></tt> / <tt class="literal"><span class="pre"><a href="./reverse-replace.html" class="identifier">reverse_replace</a></span></tt>. In presence of variability of
28the output sequence's properties such as front or backward extensibility,
29the existence of the bidirectional algorithms allows for the most efficient
30way to perform the required transformation.</p>
31<!-- Algorithms/Transformation Algorithms//copy |10 -->
32<ul class="toc simple" id="outline">
33<li><a class="reference internal" href="./copy.html" id="id1486">copy</a></li>
34<li><a class="reference internal" href="./copy-if.html" id="id1487">copy_if</a></li>
35<li><a class="reference internal" href="./transform.html" id="id1488">transform</a></li>
36<li><a class="reference internal" href="./replace.html" id="id1489">replace</a></li>
37<li><a class="reference internal" href="./replace-if.html" id="id1490">replace_if</a></li>
38<li><a class="reference internal" href="./remove.html" id="id1491">remove</a></li>
39<li><a class="reference internal" href="./remove-if.html" id="id1492">remove_if</a></li>
40<li><a class="reference internal" href="./unique.html" id="id1493">unique</a></li>
41<li><a class="reference internal" href="./partition.html" id="id1494">partition</a></li>
42<li><a class="reference internal" href="./stable-partition.html" id="id1495">stable_partition</a></li>
43<li><a class="reference internal" href="./sort.html" id="id1496">sort</a></li>
44<li><a class="reference internal" href="./reverse.html" id="id1497">reverse</a></li>
45<li><a class="reference internal" href="./reverse-copy.html" id="id1498">reverse_copy</a></li>
46<li><a class="reference internal" href="./reverse-copy-if.html" id="id1499">reverse_copy_if</a></li>
47<li><a class="reference internal" href="./reverse-transform.html" id="id1500">reverse_transform</a></li>
48<li><a class="reference internal" href="./reverse-replace.html" id="id1501">reverse_replace</a></li>
49<li><a class="reference internal" href="./reverse-replace-if.html" id="id1502">reverse_replace_if</a></li>
50<li><a class="reference internal" href="./reverse-remove.html" id="id1503">reverse_remove</a></li>
51<li><a class="reference internal" href="./reverse-remove-if.html" id="id1504">reverse_remove_if</a></li>
52<li><a class="reference internal" href="./reverse-unique.html" id="id1505">reverse_unique</a></li>
53<li><a class="reference internal" href="./reverse-partition.html" id="id1506">reverse_partition</a></li>
54<li><a class="reference internal" href="./reverse-stable-partition.html" id="id1507">reverse_stable_partition</a></li>
55</ul>
56</div>
57
58<div class="footer-separator"></div>
59<table class="footer"><tr class="footer"><td class="header-group navigation-bar"><span class="navigation-group"><a href="./equal.html" class="navigation-link">Prev</a>&nbsp;<a href="./copy.html" class="navigation-link">Next</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./querying-algorithms.html" class="navigation-link">Back</a>&nbsp;<a href="./runtime-algorithms.html" class="navigation-link">Along</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./algorithms.html" class="navigation-link">Up</a>&nbsp;<a href="../refmanual.html" class="navigation-link">Home</a></span><span class="navigation-group-separator">&nbsp;|&nbsp;</span><span class="navigation-group"><a href="./refmanual_toc.html" class="navigation-link">Full TOC</a></span></td>
60<td><div class="copyright-footer"><div class="copyright">Copyright ©  2001-2009 Aleksey Gurtovoy and David Abrahams</div>
61Distributed under the Boost Software License, Version 1.0. (See accompanying
62file LICENSE_1_0.txt or copy at <a class="reference external" href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</div></td></tr></table></body>
63</html>
64