mirror of
https://github.com/boostorg/iterator.git
synced 2025-07-29 12:27:33 +02:00
Documentation updates, added GNUMakefile for building
[SVN r20931]
This commit is contained in:
@ -9,7 +9,198 @@
|
||||
<meta name="organization" content="Boost Consulting, Indiana University Open Systems Lab, University of Hanover Institute for Transport Railway Operation and Construction" />
|
||||
<meta name="date" content="2003-09-14" />
|
||||
<meta name="copyright" content="Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved" />
|
||||
<link rel="stylesheet" href="../../../rst.css" type="text/css" />
|
||||
<style type="text/css"><!--
|
||||
|
||||
/*
|
||||
:Author: David Goodger
|
||||
:Contact: goodger@users.sourceforge.net
|
||||
:date: $Date$
|
||||
:version: $Revision$
|
||||
:copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
*/
|
||||
|
||||
.first {
|
||||
margin-top: 0 }
|
||||
|
||||
.last {
|
||||
margin-bottom: 0 }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.attention, div.caution, div.danger, div.error, div.hint,
|
||||
div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.hint p.admonition-title, div.important p.admonition-title,
|
||||
div.note p.admonition-title, div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
font-size: smaller }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr {
|
||||
width: 75% }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font-family: serif ;
|
||||
font-size: 100% }
|
||||
|
||||
pre.line-block {
|
||||
font-family: serif ;
|
||||
font-size: 100% }
|
||||
|
||||
pre.literal-block, pre.doctest-block {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em ;
|
||||
background-color: #eeeeee }
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option-argument {
|
||||
font-style: italic }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
table {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.citation {
|
||||
border-left: solid thin gray ;
|
||||
padding-left: 0.5ex }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid thin black ;
|
||||
padding-left: 0.5ex }
|
||||
|
||||
td, th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
th.docinfo-name, th.field-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap }
|
||||
|
||||
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
|
||||
font-size: 100% }
|
||||
|
||||
tt {
|
||||
background-color: #eeeeee }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
--></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="iterator-adaptor">
|
||||
@ -40,8 +231,12 @@ Railway Operation and Construction</a></td></tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The <tt class="literal"><span class="pre">iterator_adaptor</span></tt> is a base class template derived from an
|
||||
instantiation of <tt class="literal"><span class="pre">iterator_facade</span></tt>. The core interface functions
|
||||
<!-- Version 1.1 of this ReStructuredText document corresponds to
|
||||
n1530_, the paper accepted by the LWG. -->
|
||||
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
||||
rights reserved -->
|
||||
<p>Each specialization of the <tt class="literal"><span class="pre">iterator_adaptor</span></tt> class template is derived from
|
||||
a specialization of <tt class="literal"><span class="pre">iterator_facade</span></tt>. The core interface functions
|
||||
expected by <tt class="literal"><span class="pre">iterator_facade</span></tt> are implemented in terms of the
|
||||
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>'s <tt class="literal"><span class="pre">Base</span></tt> template parameter. A class derived
|
||||
from <tt class="literal"><span class="pre">iterator_adaptor</span></tt> typically redefines some of the core
|
||||
@ -55,16 +250,21 @@ core interface functions of <tt class="literal"><span class="pre">iterator_facad
|
||||
<ul class="simple">
|
||||
<li><a class="reference" href="#introduction" id="id3" name="id3">Introduction</a></li>
|
||||
<li><a class="reference" href="#reference" id="id4" name="id4">Reference</a><ul>
|
||||
<li><a class="reference" href="#iterator-adaptor-requirements" id="id5" name="id5"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-public-operations" id="id6" name="id6"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-protected-member-functions" id="id7" name="id7"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-private-member-functions" id="id8" name="id8"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-base-class-parameters" id="id5" name="id5"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-usage" id="id6" name="id6"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> usage</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-public-operations" id="id7" name="id7"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-protected-member-functions" id="id8" name="id8"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></li>
|
||||
<li><a class="reference" href="#iterator-adaptor-private-member-functions" id="id9" name="id9"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="introduction">
|
||||
<h1><a class="toc-backref" href="#id3" name="introduction">Introduction</a></h1>
|
||||
<!-- Version 1.2 of this ReStructuredText document corresponds to
|
||||
n1530_, the paper accepted by the LWG for TR1. -->
|
||||
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
||||
rights reserved -->
|
||||
<p>The <tt class="literal"><span class="pre">iterator_adaptor</span></tt> class template adapts some <tt class="literal"><span class="pre">Base</span></tt> <a class="footnote-reference" href="#base" id="id1" name="id1"><sup>1</sup></a>
|
||||
type to create a new iterator. Instantiations of <tt class="literal"><span class="pre">iterator_adaptor</span></tt>
|
||||
are derived from a corresponding instantiation of <tt class="literal"><span class="pre">iterator_facade</span></tt>
|
||||
@ -87,31 +287,36 @@ above. The <tt class="literal"><span class="pre">Base</span></tt> type need not
|
||||
iterator. It need only support the operations used by the core
|
||||
interface functions of <tt class="literal"><span class="pre">iterator_adaptor</span></tt> that have not been
|
||||
redefined in the user's derived class.</p>
|
||||
<p>Several of the template parameters of <tt class="literal"><span class="pre">iterator_adaptor</span></tt> default to
|
||||
<tt class="literal"><span class="pre">use_default</span></tt>. This allows the user to make use of a default
|
||||
parameter even when the user wants to specify a parameter later in the
|
||||
parameter list. Also, the defaults for the corresponding associated
|
||||
types are fairly complicated, so metaprogramming is required to
|
||||
compute them, and <tt class="literal"><span class="pre">use_default</span></tt> can help to simplify the
|
||||
implementation. Finally, <tt class="literal"><span class="pre">use_default</span></tt> is not left unspecified
|
||||
<p>Several of the template parameters of <tt class="literal"><span class="pre">iterator_adaptor</span></tt> default
|
||||
to <tt class="literal"><span class="pre">use_default</span></tt>. This allows the
|
||||
user to make use of a default parameter even when she wants to
|
||||
specify a parameter later in the parameter list. Also, the
|
||||
defaults for the corresponding associated types are somewhat
|
||||
complicated, so metaprogramming is required to compute them, and
|
||||
<tt class="literal"><span class="pre">use_default</span></tt> can help to simplify the implementation. Finally,
|
||||
the identity of the <tt class="literal"><span class="pre">use_default</span></tt> type is not left unspecified
|
||||
because specification helps to highlight that the <tt class="literal"><span class="pre">Reference</span></tt>
|
||||
template parameter may not always be identical to the iterator's
|
||||
<tt class="literal"><span class="pre">reference</span></tt> type, and will keep users making mistakes based on that
|
||||
assumption.</p>
|
||||
<tt class="literal"><span class="pre">reference</span></tt> type, and will keep users from making mistakes based on
|
||||
that assumption.</p>
|
||||
</div>
|
||||
<div class="section" id="reference">
|
||||
<h1><a class="toc-backref" href="#id4" name="reference">Reference</a></h1>
|
||||
<!-- Version 1.4 of this ReStructuredText document corresponds to
|
||||
n1530_, the paper accepted by the LWG for TR1. -->
|
||||
<!-- Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All
|
||||
rights reserved. -->
|
||||
<pre class="literal-block">
|
||||
template <
|
||||
class Derived
|
||||
, class Base
|
||||
, class Value = use_default
|
||||
, class Category = use_default
|
||||
, class Value = use_default
|
||||
, class CategoryOrTraversal = use_default
|
||||
, class Reference = use_default
|
||||
, class Difference = use_default
|
||||
>
|
||||
class iterator_adaptor
|
||||
: public iterator_facade<Derived, /* see <a class="reference" href=":">details</a> ...*/>
|
||||
: public iterator_facade<Derived, <em>V</em>, <em>C</em>, <em>R</em>, <em>D</em>> // see <a class="reference" href=":">details</a>
|
||||
{
|
||||
friend class iterator_core_access;
|
||||
public:
|
||||
@ -140,68 +345,53 @@ class iterator_adaptor
|
||||
iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const;
|
||||
|
||||
private:
|
||||
Base m_iterator;
|
||||
Base m_iterator; // exposition only
|
||||
};
|
||||
</pre>
|
||||
<div class="section" id="iterator-adaptor-requirements">
|
||||
<h2><a class="toc-backref" href="#id5" name="iterator-adaptor-requirements"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> requirements</a></h2>
|
||||
<p>The <tt class="literal"><span class="pre">Derived</span></tt> template parameter must be a derived class of
|
||||
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>. The <tt class="literal"><span class="pre">Base</span></tt> type must implement the
|
||||
expressions involving <tt class="literal"><span class="pre">m_iterator</span></tt> in the specifications of those
|
||||
private member functions of <tt class="literal"><span class="pre">iterator_adaptor</span></tt> that are not
|
||||
redefined by the <tt class="literal"><span class="pre">Derived</span></tt> class and that are needed to model the
|
||||
concept corresponding to the <tt class="literal"><span class="pre">iterator_adaptor</span></tt>'s <tt class="literal"><span class="pre">category</span></tt>
|
||||
typedef according to the requirements of <tt class="literal"><span class="pre">iterator_facade</span></tt>. The
|
||||
rest of the template parameters specify the types for the member
|
||||
typedefs in <tt class="literal"><span class="pre">iterator_facade</span></tt>. The following pseudo-code
|
||||
specifies the traits types for <tt class="literal"><span class="pre">iterator_adaptor</span></tt>.</p>
|
||||
<div class="section" id="iterator-adaptor-base-class-parameters">
|
||||
<h2><a class="toc-backref" href="#id5" name="iterator-adaptor-base-class-parameters"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> base class parameters</a></h2>
|
||||
<p>The <em>V</em>, <em>C</em>, <em>R</em>, and <em>D</em> parameters of the <tt class="literal"><span class="pre">iterator_facade</span></tt>
|
||||
used as a base class in the summary of <tt class="literal"><span class="pre">iterator_adaptor</span></tt>
|
||||
above are defined as follows:</p>
|
||||
<pre class="literal-block">
|
||||
if (Value == use_default)
|
||||
value_type = iterator_traits<Base>::value_type;
|
||||
else
|
||||
value_type = remove_cv<Value>::type;
|
||||
<em>V</em> = if (Value is use_default)
|
||||
return iterator_traits<Base>::value_type
|
||||
else
|
||||
return Value
|
||||
|
||||
if (Reference == use_default) {
|
||||
if (Value == use_default)
|
||||
reference = iterator_traits<Base>::reference;
|
||||
else
|
||||
reference = Value&;
|
||||
} else
|
||||
reference = Reference;
|
||||
<em>C</em> = if (CategoryOrTraversal is use_default)
|
||||
return iterator_traversal<Base>::type
|
||||
else
|
||||
return CategoryOrTraversal
|
||||
|
||||
if (Distance == use_default)
|
||||
difference_type = iterator_traits<Base>::difference_type;
|
||||
else
|
||||
difference_type = Distance;
|
||||
<em>R</em> = if (Reference is use_default)
|
||||
if (Value is use_default)
|
||||
return iterator_traits<Base>::reference
|
||||
else
|
||||
return Value&
|
||||
else
|
||||
return Reference
|
||||
|
||||
if (Category == use_default)
|
||||
iterator_category = iterator_tag<
|
||||
access_category< Base >,
|
||||
traversal_category< Base >
|
||||
>
|
||||
else if (Category is an access tag)
|
||||
iterator_category = iterator_tag<
|
||||
Category
|
||||
...
|
||||
|
||||
else if (Category is a traversal tag)
|
||||
...
|
||||
else
|
||||
iterator_category = Category;
|
||||
// Actually the above is wrong. See the use of
|
||||
// access_category_tag and
|
||||
// new_category_to_access/iter_category_to_access.
|
||||
<em>D</em> = if (Difference is use_default)
|
||||
return iterator_traits<Base>::difference_type
|
||||
else
|
||||
return Difference
|
||||
</pre>
|
||||
<!-- Replaced with new semantics - -thw
|
||||
if (Category == use_default)
|
||||
iterator_category = iterator_traits<Base>::iterator_category;
|
||||
else
|
||||
iterator_category = Category;
|
||||
|
||||
Fix this up!! -->
|
||||
</div>
|
||||
<div class="section" id="iterator-adaptor-usage">
|
||||
<h2><a class="toc-backref" href="#id6" name="iterator-adaptor-usage"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> usage</a></h2>
|
||||
<p>The <tt class="literal"><span class="pre">Derived</span></tt> template parameter must be a publicly derived from
|
||||
<tt class="literal"><span class="pre">iterator_adaptor</span></tt>. In order for <tt class="literal"><span class="pre">Derived</span></tt> to model the
|
||||
iterator concepts corresponding to
|
||||
<tt class="literal"><span class="pre">iterator_traits<Derived>::iterator_category</span></tt>, the expressions
|
||||
involving <tt class="literal"><span class="pre">m_iterator</span></tt> in the specifications of those private
|
||||
member functions of <tt class="literal"><span class="pre">iterator_adaptor</span></tt> that may be called by
|
||||
<tt class="literal"><span class="pre">iterator_facade<Derived,</span> <span class="pre">``\</span> <span class="pre">*V*\</span></tt>, <tt class="literal"><span class="pre">\</span> <span class="pre">*C*\</span></tt>, <tt class="literal"><span class="pre">\</span> <span class="pre">*R*\</span></tt>, <tt class="literal"><span class="pre">\</span>
|
||||
<span class="pre">*D*\</span></tt>>`` in evaluating any valid expression involving <tt class="literal"><span class="pre">Derived</span></tt>
|
||||
in those concepts' requirements.</p>
|
||||
</div>
|
||||
<div class="section" id="iterator-adaptor-public-operations">
|
||||
<h2><a class="toc-backref" href="#id6" name="iterator-adaptor-public-operations"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></h2>
|
||||
<h2><a class="toc-backref" href="#id7" name="iterator-adaptor-public-operations"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> public operations</a></h2>
|
||||
<p><tt class="literal"><span class="pre">iterator_adaptor();</span></tt></p>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -235,7 +425,7 @@ Fix this up!! -->
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="iterator-adaptor-protected-member-functions">
|
||||
<h2><a class="toc-backref" href="#id7" name="iterator-adaptor-protected-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></h2>
|
||||
<h2><a class="toc-backref" href="#id8" name="iterator-adaptor-protected-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> protected member functions</a></h2>
|
||||
<p><tt class="literal"><span class="pre">Base</span> <span class="pre">const&</span> <span class="pre">base_reference()</span> <span class="pre">const;</span></tt></p>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -256,7 +446,7 @@ Fix this up!! -->
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="iterator-adaptor-private-member-functions">
|
||||
<h2><a class="toc-backref" href="#id8" name="iterator-adaptor-private-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></h2>
|
||||
<h2><a class="toc-backref" href="#id9" name="iterator-adaptor-private-member-functions"><tt class="literal"><span class="pre">iterator_adaptor</span></tt> private member functions</a></h2>
|
||||
<p><tt class="literal"><span class="pre">typename</span> <span class="pre">iterator_adaptor::reference</span> <span class="pre">dereference()</span> <span class="pre">const;</span></tt></p>
|
||||
<table class="field-list" frame="void" rules="none">
|
||||
<col class="field-name" />
|
||||
@ -328,7 +518,7 @@ typename iterator_adaptor::difference_type distance_to(
|
||||
<hr class="footer" />
|
||||
<div class="footer">
|
||||
<a class="reference" href="iterator_adaptor.rst">View document source</a>.
|
||||
Generated on: 2003-09-21 09:34 UTC.
|
||||
Generated on: 2003-11-24 05:00 UTC.
|
||||
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
||||
</div>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user