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>Introduction and motivation</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="../adaptors.html" title="Range Adaptors">
|
||||
<link rel="prev" href="../adaptors.html" title="Range Adaptors">
|
||||
@ -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="../adaptors.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adaptors.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="general_requirements.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="../adaptors.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adaptors.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="general_requirements.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
<div class="section" title="Introduction and motivation">
|
||||
<div class="section">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="range.reference.adaptors.introduction"></a><a class="link" href="introduction.html" title="Introduction and motivation"> Introduction
|
||||
and motivation</a>
|
||||
@ -122,7 +122,7 @@
|
||||
situations, you will really appreciate the succinctness of <code class="computeroutput"><span class="keyword">operator</span><span class="special">|()</span></code>.
|
||||
</p>
|
||||
<a name="range.reference.adaptors.introduction.composition_of_adaptors"></a><h6>
|
||||
<a name="id3065833"></a>
|
||||
<a name="id3044351"></a>
|
||||
<a class="link" href="introduction.html#range.reference.adaptors.introduction.composition_of_adaptors">Composition
|
||||
of Adaptors</a>
|
||||
</h6>
|
||||
@ -132,8 +132,14 @@
|
||||
to algorithms. For example, consider these Range algorithms:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span> <span class="identifier">rng</span><span class="special">,</span> <span class="identifier">out</span> <span class="special">)</span></code></li>
|
||||
<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span> <span class="identifier">rng</span><span class="special">,</span> <span class="identifier">pred</span> <span class="special">)</span></code></li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span> <span class="identifier">rng</span><span class="special">,</span> <span class="identifier">out</span> <span class="special">)</span></code>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span>
|
||||
<span class="identifier">rng</span><span class="special">,</span>
|
||||
<span class="identifier">pred</span> <span class="special">)</span></code>
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
What should we do if we only want to copy an element <code class="computeroutput"><span class="identifier">a</span></code>
|
||||
@ -142,13 +148,17 @@
|
||||
The naive answer would be to use these algorithms:
|
||||
</p>
|
||||
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
|
||||
<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy_if</span><span class="special">(</span>
|
||||
<span class="identifier">rng</span><span class="special">,</span>
|
||||
<span class="identifier">pred</span><span class="special">,</span>
|
||||
<span class="identifier">out</span> <span class="special">)</span></code></li>
|
||||
<li class="listitem"><code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">count_if</span><span class="special">(</span>
|
||||
<span class="identifier">rng</span><span class="special">,</span>
|
||||
<span class="identifier">pred</span> <span class="special">)</span></code></li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">copy_if</span><span class="special">(</span>
|
||||
<span class="identifier">rng</span><span class="special">,</span>
|
||||
<span class="identifier">pred</span><span class="special">,</span>
|
||||
<span class="identifier">out</span> <span class="special">)</span></code>
|
||||
</li>
|
||||
<li class="listitem">
|
||||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">count_if</span><span class="special">(</span>
|
||||
<span class="identifier">rng</span><span class="special">,</span>
|
||||
<span class="identifier">pred</span> <span class="special">)</span></code>
|
||||
</li>
|
||||
</ul></div>
|
||||
<p>
|
||||
These algorithms are only defined to maintain a one to one relationship
|
||||
@ -159,7 +169,7 @@
|
||||
is the design solution to this problem.
|
||||
</p>
|
||||
<a name="range.reference.adaptors.introduction.range_adaptor_alternative_to_copy_if_algorithm"></a><h6>
|
||||
<a name="id3066116"></a>
|
||||
<a name="id3044650"></a>
|
||||
<a class="link" href="introduction.html#range.reference.adaptors.introduction.range_adaptor_alternative_to_copy_if_algorithm">Range
|
||||
Adaptor alternative to copy_if algorithm</a>
|
||||
</h6>
|
||||
@ -176,7 +186,7 @@
|
||||
<p>
|
||||
</p>
|
||||
<a name="range.reference.adaptors.introduction.range_adaptor_alternative_to_count_if_algorithm"></a><h6>
|
||||
<a name="id3066285"></a>
|
||||
<a name="id3044820"></a>
|
||||
<a class="link" href="introduction.html#range.reference.adaptors.introduction.range_adaptor_alternative_to_count_if_algorithm">Range
|
||||
Adaptor alternative to count_if algorithm</a>
|
||||
</h6>
|
||||
@ -268,7 +278,7 @@
|
||||
</tr></table>
|
||||
<hr>
|
||||
<div class="spirit-nav">
|
||||
<a accesskey="p" href="../adaptors.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adaptors.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="general_requirements.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||
<a accesskey="p" href="../adaptors.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adaptors.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="general_requirements.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user