2004-11-28 03:35:12 +00:00
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" lang = "en" >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" />
2010-08-09 20:07:24 +00:00
< meta name = "generator" content = "Docutils 0.7: http://docutils.sourceforge.net/" />
2004-11-28 03:35:12 +00:00
< title > The MPL Reference Manual: Iteration Algorithms</ title >
< link rel = "stylesheet" href = "../style.css" type = "text/css" />
</ head >
< body class = "docframe refmanual" >
2009-08-17 11:30:52 +00:00
< table class = "header" >< tr class = "header" >< td class = "header-group navigation-bar" >< span class = "navigation-group" >< a href = "./inserter-class.html" class = "navigation-link" > Prev</ a > < a href = "./fold.html" class = "navigation-link" > Next</ a ></ span >< span class = "navigation-group-separator" > | </ span >< span class = "navigation-group" >< a href = "./inserters.html" class = "navigation-link" > Back</ a > < a href = "./querying-algorithms.html" class = "navigation-link" > Along</ a ></ span >< span class = "navigation-group-separator" > | </ span >< span class = "navigation-group" >< a href = "./algorithms.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 >
2004-11-28 03:35:12 +00:00
< 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 = "./iteration-algorithms.html" class = "navigation-link" > Iteration Algorithms</ a ></ td >
</ tr ></ table >< div class = "header-separator" ></ div >
< div class = "section" id = "iteration-algorithms" >
2010-08-09 20:07:24 +00:00
< h1 >< a class = "toc-backref" href = "./algorithms.html#id1468" > Iteration Algorithms</ a ></ h1 >
2009-08-17 11:30:52 +00:00
< p id = "label-algorithms-iteration-algorithms" > Iteration algorithms are the basic building blocks behind many of the
MPL's algorithms, and are usually the first place to look at when
starting to build a new one. Abstracting away the details of sequence
iteration and employing various optimizations such as recursion
unrolling, they provide significant advantages over a hand-coded
2004-11-28 03:35:12 +00:00
approach.</ p >
2009-08-17 11:30:52 +00:00
<!-- Of all of iteration algorithms, ``iter_fold_if`` is the
most complex and at the same time the most fundamental. The rest of
2004-11-28 03:35:12 +00:00
the algorithms from the category |- -| ``iter_fold``, ``reverse_iter_fold``,
2009-08-17 11:30:52 +00:00
``fold``, and ``reverse_fold`` |- -| simply provide a more high-level
(and more restricted) interface to the core ``iter_fold_if``
2004-11-28 03:35:12 +00:00
functionality [#performace]_.
.. [#performace] That's not to say that they are *implemented*
2009-08-17 11:30:52 +00:00
through ``iter_fold_if`` |- -| they are often not, in particular
because the restricted functionality allows for more
2004-11-28 03:35:12 +00:00
optimizations. -->
<!-- Algorithms/Iteration Algorithms//fold -->
< ul class = "toc simple" id = "outline" >
2010-08-09 20:07:24 +00:00
< li >< a class = "reference internal" href = "./fold.html" id = "id1469" > fold</ a ></ li >
< li >< a class = "reference internal" href = "./iter-fold.html" id = "id1470" > iter_fold</ a ></ li >
< li >< a class = "reference internal" href = "./reverse-fold.html" id = "id1471" > reverse_fold</ a ></ li >
< li >< a class = "reference internal" href = "./reverse-iter-fold.html" id = "id1472" > reverse_iter_fold</ a ></ li >
< li >< a class = "reference internal" href = "./accumulate.html" id = "id1473" > accumulate</ a ></ li >
2004-11-28 03:35:12 +00:00
</ ul >
</ div >
< div class = "footer-separator" ></ div >
2009-08-17 11:30:52 +00:00
< table class = "footer" >< tr class = "footer" >< td class = "header-group navigation-bar" >< span class = "navigation-group" >< a href = "./inserter-class.html" class = "navigation-link" > Prev</ a > < a href = "./fold.html" class = "navigation-link" > Next</ a ></ span >< span class = "navigation-group-separator" > | </ span >< span class = "navigation-group" >< a href = "./inserters.html" class = "navigation-link" > Back</ a > < a href = "./querying-algorithms.html" class = "navigation-link" > Along</ a ></ span >< span class = "navigation-group-separator" > | </ span >< span class = "navigation-group" >< a href = "./algorithms.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 >
< td >< div class = "copyright-footer" >< div class = "copyright" > Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams</ div >
Distributed under the Boost Software License, Version 1.0. (See accompanying
file 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 >
2004-11-28 03:35:12 +00:00
</ html >