|
Boost-Commit : |
From: nesotto_at_[hidden]
Date: 2007-11-17 15:22:21
Author: nesotto
Date: 2007-11-17 15:22:20 EST (Sat, 17 Nov 2007)
New Revision: 41176
URL: http://svn.boost.org/trac/boost/changeset/41176
Log:
last updates
Text files modified:
trunk/libs/range/doc/boost_range.html | 24 +++++++++++++++
trunk/libs/range/doc/headers.html | 23 ++++++---------
trunk/libs/range/doc/utility_class.html | 58 +++++++++++++++++++++------------------
3 files changed, 63 insertions(+), 42 deletions(-)
Modified: trunk/libs/range/doc/boost_range.html
==============================================================================
--- trunk/libs/range/doc/boost_range.html (original)
+++ trunk/libs/range/doc/boost_range.html 2007-11-17 15:22:20 EST (Sat, 17 Nov 2007)
@@ -157,7 +157,7 @@
//
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>T </span><span class=special>>
- </span><span class=keyword></span><span class=keyword>typename </span><span class=identifier>range_size</span><span class=special><</span><span class=identifier>T</span><span class=special>>::</span><span class=identifier>type
+ </span><span class=keyword></span><span class=keyword>typename </span><span class=identifier>range_difference</span><span class=special><</span><span class=identifier>T</span><span class=special>>::</span><span class=identifier>type
</span>size<span class=special>( </span><span class=keyword>const </span><span class=identifier>T</span><span class=special>& </span><span class=identifier>r </span><span class=special>);</span>
<span class=comment>//
@@ -471,12 +471,34 @@
<td>linear time for pointers to a string, constant time
otherwise</td>
</tr>
+ <tr>
+ <a name="as_array"></a>
+ <td><code>as_array(x)</code></td>
+ <td><code>iterator_range<X></code> </td>
+ <td>
+ <code>[boost::begin(x),boost::end(x))</code>
+
+
+
+
+ </td>
+ <td>constant time otherwise</td>
+ </tr>
+
</table>
</p>
<p>
The special <code>const_</code>-named functions are useful when you
want to document clearly that your code is read-only.
</p>
+ <p>
+ <code>as_literal()</code> can be used <i>internally</i> in string
+ algorithm librararies to such that arrays of characters are
+ handled correctly.
+ </p>
+ <p>
+ <code>as_array()</code> can be used with string algorithm libraries to make it clear that arrays of characters are handled like an array and not like a string.
+ </p>
<p>Notice that the above functions should always be called with
qualification (<code>boost::</code>) to prevent <i>unintended</i>
Argument Dependent Lookup (ADL).
Modified: trunk/libs/range/doc/headers.html
==============================================================================
--- trunk/libs/range/doc/headers.html (original)
+++ trunk/libs/range/doc/headers.html 2007-11-17 15:22:20 EST (Sat, 17 Nov 2007)
@@ -50,7 +50,7 @@
>range_iterator</a></td>
<td>Single Pass Range </td>
</tr>
- <tr >
+ <tr >
<td ><code ><boost/range/mutable_iterator.hpp></code></td>
<td ><a href="boost_range.html#range_mutable_iterator"
>range_mutable_iterator</a></td>
@@ -69,20 +69,15 @@
<td>Forward Range </td>
</tr>
<tr >
- <td ><code ><boost/range/size_type.hpp></code></td>
- <td >range_size</td>
- <td>Forward Range </td>
- </tr>
- <tr >
<td ><code ><boost/range/pointer.hpp></code></td>
<td ><a href="boost_range.html#range_pointer"
- >range_pointer</a></td>
+ >range_pointer</a></td>
<td>- </td>
</tr>
- <tr >
+ <tr >
<td ><code ><boost/range/category.hpp></code></td>
<td ><a href="boost_range.html#range_category"
- >range_category</a></td>
+ >range_category</a></td>
<td>- </td>
</tr>
@@ -112,7 +107,7 @@
<td >empty</td>
<td>Single Pass Range </td>
</tr>
- <tr >
+ <tr >
<td ><code ><boost/range/distance.hpp></code></td>
<td >distance</td>
<td>Forward Range </td>
@@ -121,7 +116,7 @@
<td ><code ><boost/range/size.hpp></code></td>
<td >size</td>
<td>Random Access Range
- </td>
+ </td>
</tr>
<tr >
<td ><code ><boost/range/rbegin.hpp></code></td>
@@ -139,14 +134,14 @@
</td>
<td>Bidirectional Range </td>
</tr>
- <tr >
+ <tr >
<td ><code ><boost/range/as_array.hpp></code></td>
<td >
<a href="boost_range.html#as_array" >as_array</a>
</td>
<td>-</td>
</tr>
- <tr >
+ <tr >
<td ><code ><boost/range/as_literal.hpp></code></td>
<td >
<a href="boost_range.html#as_literal" >as_literal</a>
@@ -178,7 +173,7 @@
<hr>
<p>
- (C) Copyright Thorsten Ottosen 2003-2004
+ (C) Copyright Thorsten Ottosen 2003-2007
</p>
<br>
Modified: trunk/libs/range/doc/utility_class.html
==============================================================================
--- trunk/libs/range/doc/utility_class.html (original)
+++ trunk/libs/range/doc/utility_class.html 2007-11-17 15:22:20 EST (Sat, 17 Nov 2007)
@@ -79,9 +79,10 @@
</span><span class=keyword>class </span><span class=identifier>iterator_range
</span><span class=special>{
</span><span class=keyword>public</span><span class=special>: </span><span class=comment>// Forward Range types
- </span><span class=keyword>typedef </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>iterator</span><span class=special>;
- </span><span class=keyword>typedef </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>const_iterator</span><span class=special>;
-
+ </span><span class=keyword>typedef </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>iterator</span><span class=special>;
+ </span><span class=keyword>typedef </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>const_iterator</span><span class=special>;</span>
+ <span class=keyword>typedef </span><span class=identifier>iterator_difference</span><span class=special><</span><span class=identifier>iterator</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>difference_type</span><span class=special>;</span>
+
</span><span class=keyword>public</span><span class=special>: </span><span class=comment>// construction, assignment
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>ForwardTraversalIterator2 </span><span class=special>>
</span><span class=identifier>iterator_range</span><span class=special>( </span><span class=identifier>ForwardTraversalIterator2 </span><span class=identifier>Begin</span><span class=special>, </span><span class=identifier>ForwardTraversalIterator2 </span><span class=identifier>End </span><span class=special>);
@@ -99,23 +100,24 @@
</span><span class=identifier>iterator_range</span><span class=special>& </span><span class=keyword>operator</span><span class=special>=( </span><span class=keyword>const </span><span class=identifier>ForwardRange</span><span class=special>& </span><span class=identifier>r </span><span class=special>);
</span><span class=keyword>public</span><span class=special>: </span><span class=comment>// Forward Range functions
- </span><span class=identifier>iterator </span><span class=identifier>begin</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
- </span><span class=identifier>iterator </span><span class=identifier>end</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
- </span><span class=identifier>size_type </span><span class=identifier>size</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
- </span><span class=keyword>bool </span><span class=identifier>empty</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
+ </span><span class=identifier>iterator </span><span class=identifier>begin</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
+ </span><span class=identifier>iterator </span><span class=identifier>end</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
+ </span><span class=identifier>difference_type </span><span class=identifier>size</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
+ </span><span class=keyword>bool </span><span class=identifier>empty</span><span class=special>() </span><span class=keyword>const</span><span class=special>;
</span><span class=keyword>public</span><span class=special>: </span><span class=comment>// convenience
- </span><span class=keyword>operator </span>unspecified_bool_type<span class=special>() </span><span class=keyword>const</span><span class=special>;
- </span> <span class=keyword>bool</span> <span
+ </span><span class=keyword>operator </span>unspecified_bool_type<span class=special>() </span><span class=keyword>const</span><span class=special>;
+ </span> <span class=keyword>bool</span> <span
class=identifier>equal</span><span
-class=special>( </span><span class=keyword>const <span
-class=identifier>iterator_range</span><span class=special>& ) </span><span
+class=special>( </span><span class=keyword>const</span> <span class=identifier>iterator_range</span><span class=special>& ) </span><span
class=keyword>const;</span>
- <span class=identifier>reference</span><span class=identifier>front</span><span class=special>() </span><span class=keyword>const</span><span class=special>;</span>
- <span class=identifier>reference </span><span class=identifier>back</span><span class=special>() </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>reference </span><span class=identifier>front</span><span class=special>() </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>reference </span><span class=identifier>back</span><span class=special>() </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>iterator_range</span><span class=special>&</span> <span class=identifier>advance_begin</span><span class=special>(</span> <span class=identifier>difference_type</span> <span class=identifier>n</span> <span class=special>);</span>
+ <span class=identifier>iterator_range</span><span class=special>&</span> <span class=identifier>advance_end</span><span class=special>(</span> <span class=identifier>difference_type</span> <span class=identifier>n</span> <span class=special>);</span>
<span class=comment>// for Random Access Range only: </span>
- <span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>size_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
- <span class=identifier>value_type</span>cial>& </span><span class=keyword>operator</span><span class=special>()( </span><span class=identifier>size_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>reference </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>difference_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>value_type</span> <span class=keyword>operator</span><span class=special>()( </span><span class=identifier>difference_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
</span><span class=special>};
</span><span class=comment>// stream output
@@ -168,11 +170,11 @@
</span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>End </span><span class=special>);
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>ForwardRange </span><span class=special>>
- </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
+ </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
</span><span class=identifier>make_iterator_range</span><span class=special>( </span><span class=identifier>ForwardRange</span><span class=special>& </span><span class=identifier>r </span><span class=special>);
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>ForwardRange </span><span class=special>>
- </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>const_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
+ </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=keyword>const </span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
</span><span class=identifier>make_iterator_range</span><span class=special>( </span><span class=keyword>const </span><span class=identifier>ForwardRange</span><span class=special>& </span><span class=identifier>r </span><span class=special>);
</span>
<span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>Range </span><span class=special>></span>
@@ -182,7 +184,7 @@
</span><span class=keyword>typename </span><span class=identifier>range_difference</span><span class=special><</span><span class=identifier>Range</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>advance_end </span><span class=special>);
</span>
<span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>Range </span><span class=special>></span>
- <span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_const_iterator</span><span class=special><</span><span class=identifier>Range</span><span class=special>>::</span><span class=identifier>type </span><span class=special>></span>
+ <span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=keyword>const </span><span class=identifier>Range</span><span class=special>>::</span><span class=identifier>type </span><span class=special>></span>
<span class=identifier>make_iterator_range</span><span class=special>( </span><span class=keyword>const </span><span class=identifier>Range</span><span class=special>& </span><span class=identifier>r</span><span class=special>,
</span><span class=keyword>typename </span><span class=identifier>range_difference</span><span class=special><</span><span class=identifier>Range</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>advance_begin</span><span class=special>,
</span><span class=keyword>typename </span><span class=identifier>range_difference</span><span class=special><</span><span class=identifier>Range</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>advance_end </span><span class=special>);</span>
@@ -286,12 +288,14 @@
<span class=keyword>namespace </span><span class=identifier>boost</span>
<span class=special>{
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>ForwardRange </span><span class=special>>
- </span><span class=keyword>class </span><span class=identifier>sub_range </span><span class=special>: </span><span class=keyword>public </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_result_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
+ </span><span class=keyword>class </span><span class=identifier>sub_range </span><span class=special>: </span><span class=keyword>public </span><span class=identifier>iterator_range</span><span class=special>< </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=special>>
</span><span class=special>{
</span><span class=keyword>public</span><span class=special>: </span>
- <span class=keyword>typedef </span><span class=keyword>typename </span><span class=identifier>range_result_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><spanclass=special>>::</span><span class=identifier>type </span><span class=identifier>iterator</span><span class=special>;</span>
- <span class=keyword>typedef </span><span class=keyword>typename </span><span class=identifier>range_const_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>const_iterator</span><span class=special>;</span>
+ <span class=keyword>typedef </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=identifier>ForwardRange</span><spanclass=special>>::</span><span class=identifier>type </span><span class=identifier>iterator</span><span class=special>;</span>
+ <span class=keyword>typedef </span><span class=keyword>typename </span><span class=identifier>range_iterator</span><span class=special><</span><span class=keyword>const </span><span class=identifier>ForwardRange</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>const_iterator</span><span class=special>;</span>
+ <span class=keyword>typedef </span><span class=keyword>typename </span><span class=identifier>iterator_difference</span><span class=special><</span><span class=identifier>iterator</span><span class=special>>::</span><span class=identifier>type </span><span class=identifier>difference_type</span><span class=special>;</span>
+
<span class=keyword>public</span><span class=special>: </span><span class=comment>// construction, assignment
</span><span class=keyword>template</span><span class=special>< </span><span class=keyword>class </span><span class=identifier>ForwardTraversalIterator </span><span class=special>>
</span><span class=identifier>sub_range</span><span class=special>( </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>Begin</span><span class=special>, </span><span class=identifier>ForwardTraversalIterator </span><span class=identifier>End </span><span class=special>);
@@ -320,8 +324,8 @@
<span class=identifier>value_type</span><span class=special>& </span><span class=identifier>back</span><span class=special>();</span>
<span class=keyword>const </span><span class=identifier>value_type</span><span class=special>& </span><span class=identifier>back</span><span class=special>() </span><span class=keyword>const</span><span class=special>;</span>
<span class=comment>// for Random Access Range only: </span>
- <span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>size_type </span><span class=identifier>at </span><span class=special>);</span>
- <span class=keyword>const </span><span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>size_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
+ <span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>difference_type </span><span class=identifier>at </span><span class=special>);</span>
+ <span class=keyword>const </span><span class=identifier>value_type</span><span class=special>& </span><span class=keyword>operator</span><span class=special>[]( </span><span class=identifier>difference_type </span><span class=identifier>at </span><span class=special>) </span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>public</span><span class=special>:
</span><span class=comment>// rest of interface inherited from <a href=#iter_range><code>iterator_range</code></a>
@@ -339,15 +343,15 @@
from this algorithm. Here is an example of how we can do it with and without
<code>sub_range</code>
<pre>
- <span class=identifier>std</span><span class=special>::</span><span class=identifier>string </span><span class=identifier>str</span><span class=special>(</span><span class=string>"hello"</span><span class=special>);
- </span><span class=identifier>iterator_range</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>::</span><span class=identifier>iterator</span><span class=special>> </span><span class=identifier>ir </span><span class=special>= </span><span class=identifier>find_first</span><span class=special>( </span><span class=identifier>str</span><span class=special>, </span><span class=string>"ll" </span><span class=special>);
- </span><span class=identifier>sub_range</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>> </span><span class=identifier>sub </span><span class=special>= </span><span class=identifier>find_first</span><span class=special>( </span><span class=identifier>str</span><span class=special>, </span><span class=string>"ll" </span><span class=special>);</span>
+ <span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span> <span class=identifier>str</span><span class=special>(</span><span class=string>"hello"</span><span class=special>);</span>
+ <span class=identifier>iterator_range</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>::</span><span class=identifier>iterator</span><span class=special>></span> <span class=identifier>ir</span> <span class=special>=</span> <span class=identifier>find_first</span><span class=special>(</span> <span class=identifier>str</span><span class=special>,</span> <span class=identifier>as_literal</span><span class=special>(</span><span class=string>"ll"</span><span class=special>)</span> <span class=special>);</span>
+ <span class=identifier>sub_range</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>></span> <span class=identifier>sub</span> <span class=special>=</span> <span class=identifier>find_first</span><span class=special>(</span> <span class=identifier>str</span><span class=special>,</span> <span class=identifier>as_literal</span><span class=special>(</span><span class=string>"ll"</span><span class=special>)</span> <span class=special>);</span>
</pre>
</p>
<hr>
<p>
- (C) Copyright Thorsten Ottosen 2003-2004
+ (C) Copyright Thorsten Ottosen 2003-2007
</p>
<br>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk