OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libstdc++-v3/] [doc/] [html/] [manual/] [bk01pt09pr02.html] - Diff between revs 816 and 826

Only display areas with differences | Details | Blame | View Log

Rev 816 Rev 826
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      library&#10;    , &#10;      algorithm&#10;    " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. 
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><meta name="keywords" content="&#10;      ISO C++&#10;    , &#10;      library&#10;    , &#10;      algorithm&#10;    " /><link rel="home" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX.  Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. 
  Algorithms
  Algorithms
 
 
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id638172"></a></h2></div></div></div><p>
</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface"><div class="titlepage"><div><div><h2 class="title"><a id="id638172"></a></h2></div></div></div><p>
  The neatest accomplishment of the algorithms chapter is that all the
  The neatest accomplishment of the algorithms chapter is that all the
  work is done via iterators, not containers directly.  This means two
  work is done via iterators, not containers directly.  This means two
  important things:
  important things:
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
          Anything that behaves like an iterator can be used in one of
          Anything that behaves like an iterator can be used in one of
          these algorithms.  Raw pointers make great candidates, thus
          these algorithms.  Raw pointers make great candidates, thus
          built-in arrays are fine containers, as well as your own iterators.
          built-in arrays are fine containers, as well as your own iterators.
        </p></li><li class="listitem"><p>
        </p></li><li class="listitem"><p>
          The algorithms do not (and cannot) affect the container as a
          The algorithms do not (and cannot) affect the container as a
          whole; only the things between the two iterator endpoints.  If
          whole; only the things between the two iterator endpoints.  If
          you pass a range of iterators only enclosing the middle third of
          you pass a range of iterators only enclosing the middle third of
          a container, then anything outside that range is inviolate.
          a container, then anything outside that range is inviolate.
        </p></li></ol></div><p>
        </p></li></ol></div><p>
     Even strings can be fed through the algorithms here, although the
     Even strings can be fed through the algorithms here, although the
     string class has specialized versions of many of these functions
     string class has specialized versions of many of these functions
     (for example, <code class="code">string::find()</code>).  Most of the examples
     (for example, <code class="code">string::find()</code>).  Most of the examples
     on this page will use simple arrays of integers as a playground
     on this page will use simple arrays of integers as a playground
     for algorithms, just to keep things simple.  The use of
     for algorithms, just to keep things simple.  The use of
     <span class="emphasis"><em>N</em></span> as a size in the examples is to keep
     <span class="emphasis"><em>N</em></span> as a size in the examples is to keep
     things easy to read but probably won't be valid code.  You can
     things easy to read but probably won't be valid code.  You can
     use wrappers such as those described in the <a class="link" href="containers.html" title="Part VII.  Containers">containers chapter</a> to
     use wrappers such as those described in the <a class="link" href="containers.html" title="Part VII.  Containers">containers chapter</a> to
     keep real code readable.
     keep real code readable.
   </p><p>
   </p><p>
     The single thing that trips people up the most is the definition
     The single thing that trips people up the most is the definition
     of <span class="emphasis"><em>range</em></span> used with iterators; the famous
     of <span class="emphasis"><em>range</em></span> used with iterators; the famous
     "past-the-end" rule that everybody loves to hate.  The
     "past-the-end" rule that everybody loves to hate.  The
     <a class="link" href="iterators.html" title="Part VIII.  Iterators">iterators
     <a class="link" href="iterators.html" title="Part VIII.  Iterators">iterators
     chapter</a> of this document has a complete explanation of
     chapter</a> of this document has a complete explanation of
     this simple rule that seems to cause so much confusion.  Once you
     this simple rule that seems to cause so much confusion.  Once you
     get <span class="emphasis"><em>range</em></span> into your head (it's not that
     get <span class="emphasis"><em>range</em></span> into your head (it's not that
     hard, honest!), then the algorithms are a cakewalk.
     hard, honest!), then the algorithms are a cakewalk.
   </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="algorithms.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part IX. 
   </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="algorithms.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part IX. 
  Algorithms
  Algorithms
 
 
 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 20. Mutating</td></tr></table></div></body></html>
 </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 20. Mutating</td></tr></table></div></body></html>
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.