forked from boostorg/range
[range] disambiguate const / non-const overloads for Intel compilers and older GCC.
[SVN r63998]
This commit is contained in:
@ -2,8 +2,8 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||
<title>FAQ</title>
|
||||
<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">
|
||||
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||
<link rel="home" href="../index.html" title="Chapter 1. Range 2.0">
|
||||
<link rel="up" href="../index.html" title="Chapter 1. Range 2.0">
|
||||
<link rel="prev" href="portability.html" title="Portability">
|
||||
@ -13,16 +13,16 @@
|
||||
<table cellpadding="2" width="100%"><tr>
|
||||
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
|
||||
<td align="center"><a href="../../../../../index.html">Home</a></td>
|
||||
<td align="center"><a href="../../../../libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="portability.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="history_ack.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="portability.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="history_ack.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" title="FAQ">
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||||
<a name="range.faq"></a><a class="link" href="faq.html" title="FAQ">FAQ</a>
|
||||
</h2></div></div></div>
|
||||
@ -31,84 +31,47 @@
|
||||
and <code class="computeroutput"><span class="identifier">range_const_iterator</span><span class="special"><</span><span class="identifier">C</span><span class="special">>::</span><span class="identifier">type</span></code>
|
||||
for <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">iterator</span><span class="special">,</span> <span class="identifier">iterator</span><span class="special">></span></code>?</strong></span></em></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
In general it is not possible nor desirable to find a corresponding <code class="computeroutput"><span class="identifier">const_iterator</span></code>. When it is possible to
|
||||
come up with one, the client might choose to construct a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">const_iterator</span><span class="special">,</span><span class="identifier">const_iterator</span><span class="special">></span></code>
|
||||
object.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
Note that an <a class="link" href="reference/utilities/iterator_range.html" title="Class iterator_range"><code class="computeroutput"><span class="identifier">iterator_range</span></code></a> is somewhat more
|
||||
convenient than a <code class="computeroutput"><span class="identifier">pair</span></code>
|
||||
and that a <a class="link" href="reference/utilities/sub_range.html" title="Class sub_range"><code class="computeroutput"><span class="identifier">sub_range</span></code></a> does propagate const-ness.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
In general it is not possible nor desirable to find a corresponding <code class="computeroutput"><span class="identifier">const_iterator</span></code>. When it is possible to
|
||||
come up with one, the client might choose to construct a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">const_iterator</span><span class="special">,</span><span class="identifier">const_iterator</span><span class="special">></span></code> object.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
Note that an <a class="link" href="reference/utilities/iterator_range.html" title="Class iterator_range"><code class="computeroutput"><span class="identifier">iterator_range</span></code></a> is somewhat more
|
||||
convenient than a <code class="computeroutput"><span class="identifier">pair</span></code> and
|
||||
that a <a class="link" href="reference/utilities/sub_range.html" title="Class sub_range"><code class="computeroutput"><span class="identifier">sub_range</span></code></a> does propagate const-ness.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
2. <span class="emphasis"><em><span class="bold"><strong>Why is there not supplied more types or
|
||||
more functions?</strong></span></em></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
The library has been kept small because its current interface will serve
|
||||
most purposes. If and when a genuine need arises for more functionality,
|
||||
it can be implemented.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
The library has been kept small because its current interface will serve
|
||||
most purposes. If and when a genuine need arises for more functionality,
|
||||
it can be implemented.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
3. <span class="emphasis"><em><span class="bold"><strong>How should I implement generic algorithms
|
||||
for ranges?</strong></span></em></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
One should always start with a generic algorithm that takes two iterators
|
||||
(or more) as input. Then use Boost.Range to build handier versions on top
|
||||
of the iterator based algorithm. Please notice that once the range version
|
||||
of the algorithm is done, it makes sense not to expose the iterator version
|
||||
in the public interface.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
One should always start with a generic algorithm that takes two iterators
|
||||
(or more) as input. Then use Boost.Range to build handier versions on top
|
||||
of the iterator based algorithm. Please notice that once the range version
|
||||
of the algorithm is done, it makes sense not to expose the iterator version
|
||||
in the public interface.
|
||||
</p></blockquote></div>
|
||||
<p>
|
||||
4. <span class="emphasis"><em><span class="bold"><strong>Why is there no Incrementable Range concept?</strong></span></em></span>
|
||||
</p>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
Even though we speak of incrementable iterators, it would not make much
|
||||
sense for ranges; for example, we cannot determine the size and emptiness
|
||||
of a range since we cannot even compare its iterators.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote">
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
Note also that incrementable iterators are derived from output iterators
|
||||
and so there exist no output range.
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
</blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
Even though we speak of incrementable iterators, it would not make much sense
|
||||
for ranges; for example, we cannot determine the size and emptiness of a
|
||||
range since we cannot even compare its iterators.
|
||||
</p></blockquote></div>
|
||||
<div class="blockquote"><blockquote class="blockquote"><p>
|
||||
Note also that incrementable iterators are derived from output iterators
|
||||
and so there exist no output range.
|
||||
</p></blockquote></div>
|
||||
</div>
|
||||
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||
<td align="left"></td>
|
||||
@ -120,7 +83,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="portability.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="history_ack.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="portability.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="history_ack.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user