<dt><spanclass="section"><ahref="utilities/iterator_range.html"> Class <codeclass="computeroutput"><spanclass="identifier">iterator_range</span></code></a></span></dt>
<dt><spanclass="section"><ahref="utilities/sub_range.html"> Class <codeclass="computeroutput"><spanclass="identifier">sub_range</span></code></a></span></dt>
<dt><spanclass="section"><ahref="utilities/join.html"> Function join</a></span></dt>
</dl></div>
<p>
Having an abstraction that encapsulates a pair of iterators is very useful.
The standard library uses <codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">pair</span></code>
in some circumstances, but that class is cumbersome to use because we need
to specify two template arguments, and for all range algorithm purposes we
must enforce the two template arguments to be the same. Moreover, <codeclass="computeroutput"><spanclass="identifier">std</span><spanclass="special">::</span><spanclass="identifier">pair</span><spanclass="special"><</span><spanclass="identifier">iterator</span><spanclass="special">,</span><spanclass="identifier">iterator</span><spanclass="special">></span></code> is hardly self-documenting whereas more
domain specific class names are. Therefore these two classes are provided:
The <codeclass="computeroutput"><spanclass="identifier">iterator_range</span></code> class
is templated on an <ahref="../../../../../../libs/iterator/doc/new-iter-concepts.html#forward-traversal-iterators-lib-forward-traversal-iterators"target="_top">Forward
Traversal Iterator</a> and should be used whenever fairly general code
is needed. The <codeclass="computeroutput"><spanclass="identifier">sub_range</span></code>
class is templated on an <aclass="link"href="../concepts/forward_range.html"title="Forward Range">Forward
Range</a> and it is less general, but a bit easier to use since its template
argument is easier to specify. The biggest difference is, however, that a
<codeclass="computeroutput"><spanclass="identifier">sub_range</span></code> can propagate constness
because it knows what a corresponding <codeclass="computeroutput"><spanclass="identifier">const_iterator</span></code>
is.
</p>
<p>
Both classes can be used as ranges since they implement the <aclass="link"href="extending.html"title="Extending the library">minimal
interface</a> required for this to work automatically.