8sa1-gcc/libstdc++-v3/docs/html/25_algorithms/howto.html
Phil Edwards 5d5e5e4e42 configopts.html: HTML to XHTML change.
2001-09-17  Phil Edwards  <pme@gcc.gnu.org>

	* docs/html/configopts.html:  HTML to XHTML change.  Lowercase tags.
	* docs/html/documentation.html:  Likewise.
	* docs/html/explanations.html:  Likewise.
	* docs/html/install.html:  Likewise.
	* docs/html/17_intro/howto.html:  Likewise.
	* docs/html/18_support/howto.html:  Likewise.
	* docs/html/19_diagnostics/howto.html:  Likewise.
	* docs/html/20_util/howto.html:  Likewise.
	* docs/html/21_strings/howto.html:  Likewise.
	* docs/html/22_locale/codecvt.html:  Likewise.
	* docs/html/22_locale/ctype.html:  Likewise.
	* docs/html/22_locale/howto.html:  Likewise.
	* docs/html/22_locale/locale.html:  Likewise.
	* docs/html/22_locale/messages.html:  Likewise.
	* docs/html/23_containers/howto.html:  Likewise.
	* docs/html/24_iterators/howto.html:  Likewise.
	* docs/html/25_algorithms/howto.html:  Likewise.
	* docs/html/26_numerics/howto.html:  Likewise.
	* docs/html/27_io/howto.html:  Likewise.
	* docs/html/ext/howto.html:  Likewise.
	* docs/html/faq/index.html:  Likewise.
	* docs/html/faq/index.txt:  Regenerated.

From-SVN: r45668
2001-09-17 23:24:40 +00:00

96 lines
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta HcodeP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<meta NAME="AUTHOR" CONTENT="pme@gcc.gnu.org (Phil Edwards)">
<meta NAME="KEYWORDS" CONTENT="HOWTO, libstdc++, GCC, g++, libg++, STL">
<meta NAME="DESCRIPTION" CONTENT="HOWTO for the libstdc++ chapter 25.">
<meta NAME="GENERATOR" CONTENT="vi and eight fingers">
<title>libstdc++-v3 HOWTO: Chapter 25</title>
<link REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.4 2001/09/15 00:41:11 pme Exp $ -->
</head>
<body>
<h1 CLASS="centered"><a name="top">Chapter 25: Algorithms</a></h1>
<p>Chapter 25 deals with the generalized subroutines for automatically
transforming lemmings into gold.
</p>
<!-- ####################################################### -->
<hr>
<h1>Contents</h1>
<ul>
<li><a href="#1">Prerequisites</a>
<li><a href="#2">Topic</a>
</ul>
<hr>
<!-- ####################################################### -->
<h2><a name="1">Prerequisites</a></h2>
<p>The neatest accomplishment of the algorithms chapter is that all the
work is done via iterators, not containers directly. This means two
important things:
<ol>
<li>Anything that behaves like an iterator can be used in one of
these algorithms. Raw pointers make great candidates, thus
built-in arrays are fine containers, as well as your own iterators.
<li>The algorithms do not (and cannot) affect the container as a
whole; only the things between the two iterator endpoints. If
you pass a range of iterators only enclosing the middle third of
a container, then anything outside that range is inviolate.
</ol>
</p>
<p>Even strings can be fed through the algorithms here, although the
string class has specialized versions of many of these functions (for
example, <code>string::find()</code>). Most of the examples on this
page will use simple arrays of integers as a playground for
algorithms, just to keep things simple.
<a name="Nsize">The use of <B>N</B></a> as a size in the examples is
to keep things easy to read but probably won't be legal code. You can
use wrappers such as those described in the
<a href="../23_containers/howto.html">containers chapter</a> to keep
real code readable.
</p>
<p>The single thing that trips people up the most is the definition of
<em>range</em> used with iterators; the famous
&quot;past-the-end&quot; rule that everybody loves to hate. The
<a href="../24_iterators/howto.html#2">iterators chapter</a> of this
document has a complete explanation of this simple rule that seems to
cause so much confusion. Once you get <em>range</em> into your head
(it's not that hard, honest!), then the algorithms are a cakewalk.
</p>
<p>
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
</p>
<hr>
<h2><a name="2">Topic</a></h2>
<p>Blah.
</p>
<p>Return <a href="#top">to top of page</a> or
<a href="../faq/index.html">to the FAQ</a>.
</p>
<!-- ####################################################### -->
<hr>
<P CLASS="fineprint"><em>
Comments and suggestions are welcome, and may be sent to
<a href="mailto:libstdc++@gcc.gnu.org">the mailing list</a>.
<br> $Id: howto.html,v 1.4 2001/09/15 00:41:11 pme Exp $
</em></p>
</body>
</html>