mirror of
https://github.com/boostorg/range.git
synced 2025-07-29 12:27:42 +02:00
Merged revisions 41161-41246 via svnmerge from
https://svn.boost.org/svn/boost/trunk ........ r41161 | bemandawes | 2007-11-16 15:21:47 -0800 (Fri, 16 Nov 2007) | 1 line Fix markup error ........ r41163 | bgubenko | 2007-11-16 17:28:10 -0800 (Fri, 16 Nov 2007) | 1 line mark some fusion library tests for acc toolset ........ r41164 | djowel | 2007-11-16 17:51:04 -0800 (Fri, 16 Nov 2007) | 1 line fix for trac ticket #1450 ........ r41165 | lbourdev | 2007-11-16 19:38:25 -0800 (Fri, 16 Nov 2007) | 10 lines Updated to version 2.1.2 Added support for more compilers. Added new flag GIL_NONWORD_POINTER_ALIGNMENT_SUPPORTED to indicate whether dereferencing on non-word boundary is supported. Enabling this flag improves performance. Fixed two bugs related to non-byte-aligned images. The image alignment parameter is now specified in bytes, and has a default of 0, which means "packed" alignment. In particular, for non-byte-aligned images alignment of 0 means there are no padding bits at the ends of rows. Added the allocator as an optional parameter to image constructors and image recreate methods. ........ r41167 | grafik | 2007-11-16 20:11:49 -0800 (Fri, 16 Nov 2007) | 1 line Add "--out-xml=xyz.xml" option that dumps the output of all actions, and the test.jam information, to the given file. Changes are mostly from Dave. ........ r41169 | johnmaddock | 2007-11-17 02:00:43 -0800 (Sat, 17 Nov 2007) | 1 line Ooops, check on wrong index, now fixed. ........ r41170 | johnmaddock | 2007-11-17 04:17:05 -0800 (Sat, 17 Nov 2007) | 1 line Fix WinCE issues. ........ r41172 | johnmaddock | 2007-11-17 10:41:29 -0800 (Sat, 17 Nov 2007) | 1 line Changed test to catch throw exceptions from thread creation. ........ r41173 | bemandawes | 2007-11-17 12:13:16 -0800 (Sat, 17 Nov 2007) | 1 line // Add or correct comment identifying Boost library this header is associated with. ........ r41174 | grafik | 2007-11-17 12:14:24 -0800 (Sat, 17 Nov 2007) | 1 line Add in Dave's comments, and expand information in XML output to include action names, sources, properties, bjam info, and platform info. This required one minor change to actions to keep track of the action object generating the targets. ........ r41175 | nesotto | 2007-11-17 12:22:05 -0800 (Sat, 17 Nov 2007) | 1 line minor update of comments ........ r41176 | nesotto | 2007-11-17 12:22:20 -0800 (Sat, 17 Nov 2007) | 1 line last updates ........ r41177 | nesotto | 2007-11-17 12:44:29 -0800 (Sat, 17 Nov 2007) | 1 line works after local test with vc8 ........ r41178 | nesotto | 2007-11-17 13:02:22 -0800 (Sat, 17 Nov 2007) | 1 line added missing header ........ r41180 | nesotto | 2007-11-17 13:19:13 -0800 (Sat, 17 Nov 2007) | 1 line iostream macro patch ........ r41181 | nesotto | 2007-11-17 13:21:53 -0800 (Sat, 17 Nov 2007) | 1 line removed some warnings ........ r41182 | grafik | 2007-11-17 13:22:40 -0800 (Sat, 17 Nov 2007) | 1 line Add working dir to build description, move jam version to an attribute. ........ r41183 | nesotto | 2007-11-17 13:24:16 -0800 (Sat, 17 Nov 2007) | 1 line macro patch ........ r41185 | nesotto | 2007-11-17 13:43:32 -0800 (Sat, 17 Nov 2007) | 1 line minor change to define the value type of the iterators better ........ r41186 | grafik | 2007-11-17 14:09:26 -0800 (Sat, 17 Nov 2007) | 1 line Change "actual" to the more natural "target", and change "target" to "path". Add bjam command and bb version to XML. ........ r41187 | bemandawes | 2007-11-17 14:48:06 -0800 (Sat, 17 Nov 2007) | 1 line Add or correct comment identifying Boost library this header is associated with. ........ r41188 | andreas_huber69 | 2007-11-17 16:08:46 -0800 (Sat, 17 Nov 2007) | 1 line Added markup for statechart failures on msvc-8.0~wm5~stlport5.1 ........ r41192 | grafik | 2007-11-17 22:42:14 -0800 (Sat, 17 Nov 2007) | 1 line Add to XML output the known targets and dependencies to allow creation of the full build dependency graph. Merge from Dave's Bitten branch. ........ r41193 | johnmaddock | 2007-11-18 02:07:14 -0800 (Sun, 18 Nov 2007) | 1 line Ooops: previous commit broke platforms/compilers with no long double support, added workaround as fix. ........ r41194 | igaztanaga | 2007-11-18 02:41:57 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41195 | igaztanaga | 2007-11-18 02:43:35 -0800 (Sun, 18 Nov 2007) | 1 line Added scapegoat trees and an option to store the hash value in the hook for unordered containers ........ r41196 | igaztanaga | 2007-11-18 02:44:56 -0800 (Sun, 18 Nov 2007) | 1 line Added scapegoat trees and an option to store the hash value in the hook for unordered containers ........ r41197 | igaztanaga | 2007-11-18 02:51:19 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41198 | igaztanaga | 2007-11-18 02:54:48 -0800 (Sun, 18 Nov 2007) | 1 line Interprocess changes to support systems with filesystem-based shared memory ........ r41199 | johnmaddock | 2007-11-18 04:23:37 -0800 (Sun, 18 Nov 2007) | 1 line Added missing template argument to specialisations. ........ r41200 | johnmaddock | 2007-11-18 04:24:42 -0800 (Sun, 18 Nov 2007) | 1 line Fix IMB xlc error limits, added workarounds where these were missed by the last commit. ........ r41201 | t_schwinger | 2007-11-18 06:06:47 -0800 (Sun, 18 Nov 2007) | 3 lines adds comment to fusion aCC failure markup ........ r41202 | danieljames | 2007-11-18 08:10:12 -0800 (Sun, 18 Nov 2007) | 2 lines Move the instructions for running regression tests to the new site. Fixes #1265. ........ r41210 | danieljames | 2007-11-18 12:18:04 -0800 (Sun, 18 Nov 2007) | 2 lines Move the 'implementation variations' page to the new site. Fixes #1355. ........ r41211 | eric_niebler | 2007-11-18 12:19:55 -0800 (Sun, 18 Nov 2007) | 1 line vc6 doesn't like BOOST_MPL_ASSERT_MSG ........ r41212 | grafik | 2007-11-18 12:24:25 -0800 (Sun, 18 Nov 2007) | 1 line Inspection report fixes. ........ r41213 | grafik | 2007-11-18 12:53:28 -0800 (Sun, 18 Nov 2007) | 1 line Cleanup tools/regression to remove obsolete runner scripts, move existing docs to doc subdir, and clean html docs into valid xhtml. ........ r41214 | grafik | 2007-11-18 13:02:51 -0800 (Sun, 18 Nov 2007) | 1 line Add missing <cstring> include, for std::strchr function. ........ r41215 | grafik | 2007-11-18 13:07:26 -0800 (Sun, 18 Nov 2007) | 1 line Add keyword tags. ........ r41216 | niels_dekker | 2007-11-18 14:11:57 -0800 (Sun, 18 Nov 2007) | 1 line Code refactoring: removed private base classes of value_initialized, as suggested by Fernando Cacciola. ........ r41217 | djowel | 2007-11-18 16:05:43 -0800 (Sun, 18 Nov 2007) | 1 line added link to docs ........ r41218 | johnmaddock | 2007-11-19 02:02:16 -0800 (Mon, 19 Nov 2007) | 1 line Oops: added missing template specialisation argument. ........ r41219 | johnmaddock | 2007-11-19 02:20:36 -0800 (Mon, 19 Nov 2007) | 1 line No user32.lib on WinCE ........ r41220 | joaquin | 2007-11-19 03:08:11 -0800 (Mon, 19 Nov 2007) | 1 line moved some ADL stuff out of a potentially name-hiding scope ........ r41221 | troyer | 2007-11-19 04:15:58 -0800 (Mon, 19 Nov 2007) | 1 line made complex seriaqlization more portable ........ r41222 | anthonyw | 2007-11-19 04:17:31 -0800 (Mon, 19 Nov 2007) | 1 line fixed TSS cleanup on 64-bit Windows ........ r41223 | anthonyw | 2007-11-19 04:29:14 -0800 (Mon, 19 Nov 2007) | 1 line fixed problems with TSS cleanup when using LoadLibrary and when threads finish after thread_specific_ptr instance has been destroyed ........ r41224 | garcia | 2007-11-19 05:28:00 -0800 (Mon, 19 Nov 2007) | 2 lines A bunch of review volunteers. ........ r41225 | garcia | 2007-11-19 06:01:34 -0800 (Mon, 19 Nov 2007) | 2 lines Added boost.range update ........ r41226 | anthonyw | 2007-11-19 06:29:22 -0800 (Mon, 19 Nov 2007) | 1 line added copyright ........ r41227 | aaron_windsor | 2007-11-19 07:28:26 -0800 (Mon, 19 Nov 2007) | 1 line Cleaning up #includes to avoid errors on gcc 4.1 and above. ........ r41234 | igaztanaga | 2007-11-19 08:55:23 -0800 (Mon, 19 Nov 2007) | 1 line Fixed errors detected by gcc-4.3 ........ r41235 | hljin | 2007-11-19 09:26:12 -0800 (Mon, 19 Nov 2007) | 1 line GIL: updated the design guide based on the new changes ........ r41236 | grafik | 2007-11-19 09:44:31 -0800 (Mon, 19 Nov 2007) | 1 line Make quietly actions really quiet by not printing the command output. The output for the quietly actions is still available through "__ACTION_RULE__". ........ r41237 | grafik | 2007-11-19 10:02:43 -0800 (Mon, 19 Nov 2007) | 1 line Add architecture and instruction-set values for HP/PA-RISC. ........ r41238 | igaztanaga | 2007-11-19 10:09:13 -0800 (Mon, 19 Nov 2007) | 1 line Corrected ifdef ........ r41240 | igaztanaga | 2007-11-19 10:32:12 -0800 (Mon, 19 Nov 2007) | 1 line Fixed 64 bit std::size_t specialization error ........ r41241 | hljin | 2007-11-19 10:34:59 -0800 (Mon, 19 Nov 2007) | 1 line GIL: broke the main test into small tests ........ r41242 | bgubenko | 2007-11-19 11:25:21 -0800 (Mon, 19 Nov 2007) | 1 line add OSPLAT=PARISC for HP-UX PA-RISC ........ [SVN r41247]
This commit is contained in:
@ -157,7 +157,7 @@ class=identifier>T</span><span class=special>& </span><span class=identifier
|
||||
//
|
||||
|
||||
</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><a href="#size"><span class=identifier>size</span></a><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 @@ class=identifier>T</span><span class=special>& </span><span class=identifier
|
||||
<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).
|
||||
|
@ -50,7 +50,7 @@
|
||||
>range_iterator</a></td>
|
||||
<td><a href="range.html#single_pass_range">Single Pass Range</a> </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><a href="range.html#forward_range">Forward Range</a> </td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td ><code ><boost/range/size_type.hpp></code></td>
|
||||
<td ><a href="boost_range.html#range_size" >range_size</a></td>
|
||||
<td><a href="range.html#forward_range">Forward Range</a> </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 ><a href="boost_range.html#empty" >empty</a></td>
|
||||
<td><a href="range.html#single_pass_range">Single Pass Range</a> </td>
|
||||
</tr>
|
||||
<tr >
|
||||
<tr >
|
||||
<td ><code ><boost/range/distance.hpp></code></td>
|
||||
<td ><a href="boost_range.html#distance" >distance</a></td>
|
||||
<td><a href="range.html#forward_range">Forward Range</a> </td>
|
||||
@ -121,7 +116,7 @@
|
||||
<td ><code ><boost/range/size.hpp></code></td>
|
||||
<td ><a href="boost_range.html#size" >size</a></td>
|
||||
<td><a href="range.html#random_access_range">Random Access Range</a>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td ><code ><boost/range/rbegin.hpp></code></td>
|
||||
@ -139,14 +134,14 @@
|
||||
</td>
|
||||
<td><a href="range.html#bidirectional_range">Bidirectional Range</a> </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>
|
||||
|
@ -79,9 +79,10 @@ corresponding <code>const_iterator</code> is. </p>
|
||||
</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 @@ corresponding <code>const_iterator</code> is. </p>
|
||||
</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><a href="#unspecified_bool"><span class=identifier>unspecified_bool_type</span></a><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><a href="#unspecified_bool"><span class=identifier>unspecified_bool_type</span></a><span class=special>() </span><span class=keyword>const</span><span class=special>;
|
||||
</span> <span class=keyword>bool</span> <span
|
||||
class=identifier><a href="#equal">equal</a></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 @@ class=keyword>const;</span>
|
||||
</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 @@ class=keyword>const;</span>
|
||||
</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 @@ class can propagate constness since it knows what a corresponding
|
||||
<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 @@ class can propagate constness since it knows what a corresponding
|
||||
<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 @@ store the result
|
||||
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>
|
||||
|
@ -41,6 +41,11 @@ namespace range_detail
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
|
||||
range_begin( C& c )
|
||||
{
|
||||
//
|
||||
// If you get a compile-error here, it is most likely because
|
||||
// you have not implemented range_begin() properly in
|
||||
// the namespace of C
|
||||
//
|
||||
return c.begin();
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,6 @@ namespace boost {
|
||||
T a;
|
||||
range_iterator i;
|
||||
range_const_iterator ci;
|
||||
bool b;
|
||||
};
|
||||
|
||||
//! Check if a type T models the ForwardRange range concept.
|
||||
|
@ -37,8 +37,7 @@
|
||||
#error "macro already defined!"
|
||||
#endif
|
||||
|
||||
//#if BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) || __MWERKS__ <= 0x3003
|
||||
#if _MSC_VER <= 1300 && !defined( __COMO__ ) && !defined( __GNUC__ ) && __MWERKS__ <= 0x3003
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) || BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
|
||||
#define BOOST_RANGE_NO_ARRAY_SUPPORT 1
|
||||
#endif
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
#ifndef BOOST_RANGE_DETAIL_MICROSOFT_HPP
|
||||
#define BOOST_RANGE_DETAIL_MICROSOFT_HPP
|
||||
|
||||
|
||||
|
||||
|
||||
// Boost.Range MFC/ATL Extension
|
||||
//
|
||||
// Copyright Shunsuke Sogame 2005-2006.
|
||||
@ -931,5 +928,4 @@ namespace boost { namespace range_detail_microsoft {
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -42,6 +42,11 @@ namespace range_detail
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
|
||||
range_end( C& c )
|
||||
{
|
||||
//
|
||||
// If you get a compile-error here, it is most likely because
|
||||
// you have not implemented range_begin() properly in
|
||||
// the namespace of C
|
||||
//
|
||||
return c.end();
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,13 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <iterator>
|
||||
#include <algorithm>
|
||||
#ifndef BOOST_OLD_IOSTREAMS
|
||||
# include <ostream>
|
||||
#else
|
||||
# include <ostream.h>
|
||||
#endif
|
||||
#ifndef _STLP_NO_IOSTREAMS
|
||||
# ifndef BOOST_OLD_IOSTREAMS
|
||||
# include <ostream>
|
||||
# else
|
||||
# include <ostream.h>
|
||||
# endif
|
||||
#endif // _STLP_NO_IOSTREAMS
|
||||
#include <cstddef>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || BOOST_WORKAROUND(BOOST_MSVC, == 1400)
|
||||
@ -396,7 +398,8 @@ namespace boost
|
||||
|
||||
// iterator range free-standing operators ---------------------------//
|
||||
|
||||
#ifndef BOOST_OLD_IOSTREAMS
|
||||
#ifndef _STLP_NO_IOSTREAMS
|
||||
# ifndef BOOST_OLD_IOSTREAMS
|
||||
|
||||
//! iterator_range output operator
|
||||
/*!
|
||||
@ -415,7 +418,7 @@ namespace boost
|
||||
return Os;
|
||||
}
|
||||
|
||||
#else
|
||||
# else
|
||||
|
||||
//! iterator_range output operator
|
||||
/*!
|
||||
@ -431,7 +434,8 @@ namespace boost
|
||||
return Os;
|
||||
}
|
||||
|
||||
#endif
|
||||
# endif
|
||||
#endif // _STLP_NO_IOSTREAMS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// comparison operators
|
||||
|
@ -65,17 +65,17 @@ void check_iterator_pair()
|
||||
BOOST_CHECK( begin( pair ) == pair.first );
|
||||
BOOST_CHECK( end( pair ) == pair.second );
|
||||
BOOST_CHECK( empty( pair ) == (pair.first == pair.second) );
|
||||
BOOST_CHECK( size( pair ) == std::size_t( std::distance( pair.first, pair.second ) ) );
|
||||
BOOST_CHECK( size( pair ) == std::distance( pair.first, pair.second ) );
|
||||
|
||||
BOOST_CHECK( begin( const_pair ) == const_pair.first );
|
||||
BOOST_CHECK( end( const_pair ) == const_pair.second );
|
||||
BOOST_CHECK( empty( const_pair ) == (const_pair.first == const_pair.second) );
|
||||
BOOST_CHECK( size( const_pair ) == std::size_t( std::distance( const_pair.first, const_pair.second ) ) );
|
||||
BOOST_CHECK( size( const_pair ) == std::distance( const_pair.first, const_pair.second ) );
|
||||
|
||||
BOOST_CHECK( begin( constness_pair ) == constness_pair.first );
|
||||
BOOST_CHECK( end( constness_pair ) == constness_pair.second );
|
||||
BOOST_CHECK( empty( constness_pair ) == (constness_pair.first == const_pair.second) );
|
||||
BOOST_CHECK( size( constness_pair ) == std::size_t( std::distance( constness_pair.first, constness_pair.second ) ) );
|
||||
BOOST_CHECK( size( constness_pair ) == std::distance( constness_pair.first, constness_pair.second ) );
|
||||
|
||||
}
|
||||
|
||||
|
@ -48,12 +48,12 @@ void check_std_container()
|
||||
BOOST_CHECK( begin( vec ) == vec.begin() );
|
||||
BOOST_CHECK( end( vec ) == vec.end() );
|
||||
BOOST_CHECK( empty( vec ) == vec.empty() );
|
||||
BOOST_CHECK( size( vec ) == vec.size() );
|
||||
BOOST_CHECK( (std::size_t)size( vec ) == vec.size() );
|
||||
|
||||
BOOST_CHECK( begin( cvec ) == cvec.begin() );
|
||||
BOOST_CHECK( end( cvec ) == cvec.end() );
|
||||
BOOST_CHECK( empty( cvec ) == cvec.empty() );
|
||||
BOOST_CHECK( size( cvec ) == cvec.size() );
|
||||
BOOST_CHECK( (std::size_t)size( cvec ) == cvec.size() );
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user