*** empty log message ***

[SVN r24176]
This commit is contained in:
Thorsten Jørgen Ottosen
2004-07-30 02:56:01 +00:00
parent 65f5d654f7
commit b86b99190b
5 changed files with 162 additions and 21 deletions

View File

@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title> Collection Traits </title><meta http-equiv="Content-Type"content="text/html; charset=iso-8859-1"></head> <body><table ><tr ><td ><img src="cboost.gif" width="100%" border="0"></td><td ><h1 ><br> Collection Traits </h1></td></tr></table><ul ><li ><a href="#Introduction" >Introduction</a></li><li ><a href="#Reference" >Reference</a></li><ul ><li ><a href="#Synopsis" >Synopsis</a></li><li ><a href="#Library headers" >Library headers</a></li><li ><a href="#Semantics" >Semantics</a></li></ul><li ><a href="#Examples" >Examples</a></li><li ><a href="#Portability" >Portability</a></li><li ><a href="#FAQ" >FAQ</a></li><li ><a href="#History" >History</a></li></ul><hr size="1" ><h2 >Introduction</h2><a name="Introduction" ></a><p >This library makes it possible to treat different types as if they have
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title> Boost.Range External Range Implementation </title><meta http-equiv="Content-Type"content="text/html; charset=iso-8859-1"></head> <body><table ><tr ><td ><img src="cboost.gif" width="100%" border="0"></td><td ><h1 ><br>Boost.Range External Range Implementation </h1></td></tr></table><ul ><li ><a href="#Introduction" >Introduction</a></li><li ><a href="#Reference" >Reference</a></li><ul ><li ><a href="#Synopsis" >Synopsis</a></li><li ><a href="#Library headers" >Library headers</a></li><li ><a href="#Semantics" >Semantics</a></li></ul><li ><a href="#Examples" >Examples</a></li><li ><a href="#Portability" >Portability</a></li><li ><a href="#FAQ" >FAQ</a></li><li ><a href="#History" >History</a></li></ul><hr size="1" ><h2 >Introduction</h2><a name="Introduction" ></a><p >This library makes it possible to treat different types as if they have
implemented a subset of the container requirements
(see &sect;23.1of the C++ standard). Formally, that subset is defined by
the <a href="Collection.htm" target="_self" >CollectionConcept.</a>

View File

@ -20,6 +20,7 @@
<IMG SRC="/Images/stat.gif" ALT="" BORDER=0 WIDTH = "6" HEIGHT = "6" >
<BR Clear>
<a name=range>
<H1>Range</H1>
<h3>Description</h3>
@ -439,8 +440,10 @@ An algorithm that iterates through the range <tt>[a.begin(), a.end())</tt>
<hr>
<br>
<a name=reversible_range>
<h1>ReversibleRange</h1>
<h3>Description</h3>
This concept provides access to iterators that traverse in both
directions (forward and reverse). The iterator type must meet all of

146
doc/style.html Executable file
View File

@ -0,0 +1,146 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Range Terminology and Style Guidelines </title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<table border="0" >
<tr>
<td ><img src="cboost.gif" border="0" ></td>
<td >
<h1 align="center">Boost.Range terminology and style guidelines</h1>
</td>
</tr>
</table>
<p>
The use of a consistent terminologi is as important for
iterator <a href="range.html#range">Range</a>s and
<a href="range.html#external_range">ExternalRange</a>-based algorithms
as it is for iterators and iterator-based algorithms.
If a conventional set of names are adopted, we can avoid misunderstandings
and write generic function prototypes that are <i>self-documenting</i>.
</p>
<p>
Since iterator ranges are characterized by a specific underlying
iterator type, we get a type of iterator range for each type of
iterator. Hence we can speak of the following types of iterator
ranges:
<ul>
<li> Range
<li> ReversibleRange
<li> <i>Value access</i> category:
<ul>
<li> ReadableRange
<li> WriteableRange
<li> SwappableRange
<li> LvalueRange
</ul>
<li> <i>Traversal</i> category:
<ul>
<li> IncrementableRange
<li> SinglePassRange
<li> ForwardRange
<li> BidirectionalRange
<li> RandomAccessRange
</ul>
</ul>
Notice how we have used the categories from the
<a href=../../iterator/doc/new-iter-concepts.html>new style iterators</a>.
Similarly, for <a href="range.html#external_range">ExternalRange</a>
we have
<ul>
<li> XRange
<li> XReversibleRange
<li> <i>Value access</i> category:
<ul>
<li> XReadableRange
<li> XWriteableRange
<li> XSwappableRange
<li> XLvalueRange
</ul>
<li> <i>Traversal</i> category:
<ul>
<li> XIncrementableRange
<li> XSinglePassRange
<li> XForwardRange
<li> XBidirectionalRange
<li> XRandomAccessRange
</ul>
</ul>
The convention of using an <code>X</code> to mean "External" save us from
rediculously long parameter names and is easy to associate with an
<a href=external_concepts.html>external concept</a>.
<p>
Notice that an interator (and therefore an iterator range) has
one <i>traversal</i> property and one or more properties from the
<i>value access</i> category. So in reality we will mostly talk about
mixtures such as <ul> <li>RandomAccessReadableWriteableRange
<li>XForwardLvalueRange
</ul>
By convention, we should always specify the <i>travelsal</i> property first
as done above. This seems resonable since there will only be one
<i>traversal</i> property, but perhaps many <i>value acccess</i> properties.
</p>
<p>
As an example, consider how we specify the interface of
<code>std::sort()</code>. The iterator-based version looks like
this:
<pre>
template< class RandomAccessTraversalReadableWritableIterator >
void sort( RandomAccessTraversalReadableWritableIterator first,
RandomAccessTraversalReadableWritableIterator last );
</pre>
For external iterator ranges the interface becomes
<pre>
template< class XRandomAccessReadableWritableRange >
void sort( XRandomAccessReadableWritableRange& r );
</pre>
Had the function been specified like
<pre>
template< class RandomAccessReadableWritableRange >
void sort( RandomAccessReadableWritableRange& r );
</pre>
we should expect the underlying code to call <code>r.begin()</code>
and <code>r.end()</code> to extract the iterators instead of
<code>begin( r )</code> and <code>end( r )</code>. In general
it is much more flexible to rely on external iterator ranges
than iterator ranges.
</p>
</p>
<hr>
<p>
(C) Copyright Thorsten Ottosen 2003-2004
</p>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>

View File

@ -17,7 +17,6 @@
</tr>
</table>
<h1></h1>
<p> Having an abstraction that encapsulates a pair of iterators is very
useful. The standard library uses <code>std::pair</code> in some
@ -29,8 +28,8 @@ whereas more domain specific class names are. Therefore these two
classes are provided:
<ul>
<li> <a href=#iter_range><code>iterator_range</code></a>
<li> <a href=#sub_range><code>sub_range</code></a> </ul>
<li>Class <a href=#iter_range><code>iterator_range</code></a>
<li>Class <a href=#sub_range><code>sub_range</code></a> </ul>
</ul>
The <code>iterator_range</code> class is templated on an iterator and should be
@ -40,7 +39,7 @@ and it is less general, but a bit easier to use since its template argument
is easier to specify.
</p>
<hr> <a name=iter_range></a> <h1><code>iterator_range</code></h1>
<hr> <a name=iter_range></a> <h1>Class <code>iterator_range</code></h1>
The intention of the
<code>iterator_range</code> class is to encapsulate
@ -137,7 +136,7 @@ client must ensure that the two iterators delimit a valid closed-open range
</p>
<hr> <a name=sub_range></a>
<h1><code>sub_range</code></h1>
<h1>Class <code>sub_range</code></h1>
The <code>sub_range</code> class inherits all its functionality
from the <a href="#iter_range"><code>iterator_range</code></a> class.

View File

@ -38,33 +38,26 @@
<li> Concepts:
<ul>
<li> Range
<li> ReversibleRange
<li> <a href="doc/range.htm#range">Range</a>
<li> <a href="doc/range.htm#reversible_range">ReversibleRange</a>
<li> ExternalRange
<li> ExternalReversibleRange
</ul>
<li> Implementation of ExternalReversibleRange for
<ul>
<li> <a href=doc/boost_range.html>Implementation</a> of ExternalReversibleRange for
<ul>
<li> arrays
<li> Ranges
<li> strings
<li> pairs of iterators
</ul>
<li> <a href=doc/utility_class.html> Utility classses:</a>
<li> <a href=doc/utility_class.html> Utilities:</a>
<ul>
<li> <a href=doc/utility_class.html#iter_range><code>iterator_range</code></a>
<li> <a href=doc/utility_class.html#sub_range><code>sub_range</code></a> </ul>
<li> Class <a href="doc/utility_class.html#iter_range"><code>iterator_range</code></a>
<li> Class <a href="doc/utility_class.html#sub_range"><code>sub_range</code></a> </ul>
<li>
Utility functions:
<ul>
<li> make_iterator_range()
<li> copy_range()
<li> transform_range()
</ul>
<li> Style and terminology guidelines
<li> <a href=doc/style.html>Terminology and style guidelines </a>
<li><a href="#headers">Headers</a> </li>
</ul>