<li><aclass="reference"href="#enable-if-convertible-unspecified-conflicts-with-requires"id="id5"name="id5">9.4 enable_if_convertible unspecified, conflicts with requires</a></li>
<li><aclass="reference"href="#iterator-adaptor-has-an-extraneous-bool-at-the-start-of-the-template-definition"id="id6"name="id6">9.5 iterator_adaptor has an extraneous 'bool' at the start of the template definition</a></li>
<li><aclass="reference"href="#name-of-private-member-shouldn-t-be-normative"id="id7"name="id7">9.6 Name of private member shouldn't be normative</a></li>
<li><aclass="reference"href="#iterator-adaptor-operations-specifications-are-a-bit-inconsistent"id="id8"name="id8">9.7 iterator_adaptor operations specifications are a bit inconsistent</a></li>
<li><aclass="reference"href="#specialized-adaptors-text-should-be-normative"id="id9"name="id9">9.8 Specialized adaptors text should be normative</a></li>
<li><aclass="reference"href="#reverse-iterator-text-is-too-informal"id="id10"name="id10">9.9 Reverse_iterator text is too informal</a></li>
<li><aclass="reference"href="#prior-is-undefined"id="id11"name="id11">9.10 'prior' is undefined</a></li>
<li><aclass="reference"href="#in-other-words-is-bad-wording"id="id12"name="id12">9.11 "In other words" is bad wording</a></li>
<li><aclass="reference"href="#are-is-readable-is-writable-and-is-swappable-useful"id="id19"name="id19">9.18 Are is_readable, is_writable, and is_swappable useful?</a></li>
<li><aclass="reference"href="#non-uniformity-of-the-lvalue-iterator-bit"id="id20"name="id20">9.19 Non-Uniformity of the "lvalue_iterator Bit"</a></li>
<li><aclass="reference"href="#traversal-concepts-and-tags"id="id21"name="id21">9.20 Traversal Concepts and Tags</a></li>
<li><aclass="reference"href="#return-type-of-iterator-difference-for-iterator-facade"id="id23"name="id23">9.22 return type of Iterator difference for iterator facade</a></li>
<li><aclass="reference"href="#iterator-facade-minor-wording-issue"id="id24"name="id24">9.23 Iterator_facade: minor wording Issue</a></li>
<li><aclass="reference"href="#use-of-undefined-name-in-iterator-facade-table"id="id25"name="id25">9.24 Use of undefined name in iterator_facade table</a></li>
<li><aclass="reference"href="#should-output-proxy-really-be-a-named-type"id="id33"name="id33">9.32 Should output_proxy really be a named type?</a></li>
<li><aclass="reference"href="#istreambuf-iterator-isn-t-a-readable-iterator"id="id34"name="id34">9.33 istreambuf_iterator isn't a Readable Iterator</a></li>
<li><aclass="reference"href="#iterator-facade-too-many-equals"id="id36"name="id36">9.35 iterator_facade: too many equals?</a></li>
<li><aclass="reference"href="#iterator-facade-function-requirements"id="id37"name="id37">9.36 iterator_facade function requirements</a></li>
</ul>
</li>
<li><aclass="reference"href="#more-issues-not-from-matt-s-list"id="id38"name="id38">More Issues (not from Matt's list)</a><ul>
<li><aclass="reference"href="#x-inheritance-in-iterator-adaptor-and-other-adaptors-is-an-overspecification"id="id39"name="id39">9.37x Inheritance in iterator_adaptor and other adaptors is an overspecification</a></li>
<li><aclass="reference"href="#x-problem-with-specification-of-a-m-in-readable-iterator"id="id40"name="id40">9.38x Problem with specification of a->m in Readable Iterator</a></li>
<li><aclass="reference"href="#x-problem-with-transform-iterator-requirements"id="id43"name="id43">9.41x Problem with transform_iterator requirements</a></li>
<li><aclass="reference"href="#x-transform-iterator-interoperability-too-restrictive"id="id45"name="id45">9.43x transform_iterator interoperability too restrictive</a></li>
<li><aclass="reference"href="#y-indirect-iterator-and-smart-pointers"id="id46"name="id46">9.44y <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> and smart pointers</a></li>
<li><aclass="reference"href="#y-n1530-typos-and-editorial-changes-in-proposal-text-not-standardese"id="id47"name="id47">9.45y N1530: Typos and editorial changes in proposal text (not standardese)</a></li>
<li><aclass="reference"href="#y-n1530-base-return-by-value-is-costly"id="id48"name="id48">9.46y N1530: <ttclass="literal"><spanclass="pre">base()</span></tt> return-by-value is costly</a></li>
<li><aclass="reference"href="#x-forgot-default-constructible-in-forward-traversal-iterator"id="id49"name="id49">9.47x Forgot default constructible in Forward Traversal Iterator</a></li>
<li><aclass="reference"href="#x-clarification-of-iterator-facade-requirements-and-type-members"id="id51"name="id51">9.49x Clarification of iterator_facade requirements and type members</a></li>
<p>In general, we've provided operational semantics for things like
operator++. That is, we've said that ++iter must work, without
requiring either a member function or a non-member function.
iterator_facade specifies most operators as member
functions. There's no inherent reason for these to be members, so
we should remove this requirement. Similarly, some operations are
specified as non-member functions but could be implemented as
members. Again, the standard doesn't make either of these choices,
and TR1 shouldn't, either. So: <ttclass="literal"><spanclass="pre">operator*()</span></tt>, <ttclass="literal"><spanclass="pre">operator++()</span></tt>,
<ttclass="literal"><spanclass="pre">operator-(iterator_facade</span><spanclass="pre">instance)</span></tt>, and <ttclass="literal"><spanclass="pre">operator+</span></tt> should
be specified with operational semantics and not explicitly required
<tr><td> </td><tdclass="field-body">Not a defect.</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body">The standard uses valid expressions such as <ttclass="literal"><spanclass="pre">++iter</span></tt>
in requirements tables, such as for input iterator. However, for
classes, such as <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt>, the standard uses function
prototypes, as we have done here for
<ttclass="literal"><spanclass="pre">iterator_facade</span></tt>. Further, the prototype specification does
not prevent the implementor from using members or non-members,
since nothing the user can do in a conforming program can detect
<tr><td> </td><tdclass="field-body"><pclass="first">Add normative text. Relax requirements in the
proposed way.</p>
<p>Change:</p>
<blockquote>
[<em>Note:</em> The <ttclass="literal"><spanclass="pre">enable_if_interoperable</span></tt> template used above is
for exposition purposes. The member operators should be only be
in an overload set provided the derived types <ttclass="literal"><spanclass="pre">Dr1</span></tt> and
<ttclass="literal"><spanclass="pre">Dr2</span></tt> are interoperable, by which we mean they are
convertible to each other. The <ttclass="literal"><spanclass="pre">enable_if_interoperable</span></tt>
approach uses SFINAE to take the operators out of the overload
set when the types are not interoperable.]</blockquote>
<p>To:</p>
<blockquoteclass="last">
<p>The <ttclass="literal"><spanclass="pre">enable_if_interoperable</span></tt> template used above is for
exposition purposes. The member operators should only be in an
overload set provided the derived types <ttclass="literal"><spanclass="pre">Dr1</span></tt> and <ttclass="literal"><spanclass="pre">Dr2</span></tt> are
interoperable, meaning that at least one of the types is
convertible to the other. The <ttclass="literal"><spanclass="pre">enable_if_interoperable</span></tt>
approach uses SFINAE to take the operators out of the overload
set when the types are not interoperable. The operators should
behave <em>as-if</em><ttclass="literal"><spanclass="pre">enable_if_interoperable</span></tt> were defined to be:</p>
<h2><aclass="toc-backref"href="#id6"name="iterator-adaptor-has-an-extraneous-bool-at-the-start-of-the-template-definition">9.5 iterator_adaptor has an extraneous 'bool' at the start of the template definition</a></h2>
<h2><aclass="toc-backref"href="#id8"name="iterator-adaptor-operations-specifications-are-a-bit-inconsistent">9.7 iterator_adaptor operations specifications are a bit inconsistent</a></h2>
<tr><td> </td><tdclass="field-body"><pclass="first">Change the specification to avoid using <ttclass="literal"><spanclass="pre">prior</span></tt> as follows.</p>
<li>Remove the <ttclass="literal"><spanclass="pre">is_writable</span></tt> and <ttclass="literal"><spanclass="pre">is_swappable</span></tt> traits, and
remove the requirements in the Writable Iterator and Swappable
Iterator concepts that require their models to support these
traits.</li>
<li>Change the <ttclass="literal"><spanclass="pre">is_readable</span></tt> specification. Remove the
requirement for support of the <ttclass="literal"><spanclass="pre">is_readable</span></tt> trait from the
Readable Iterator concept.</li>
<li>Remove the <ttclass="literal"><spanclass="pre">iterator_tag</span></tt> class and transplant the logic for
choosing an iterator category into <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>.</li>
<li>Change the specification of <ttclass="literal"><spanclass="pre">traversal_category</span></tt>.</li>
<li>Remove Access parameters from N1530</li>
</ol>
<p>In N1550:</p>
<p>Remove:</p>
<blockquote>
<p>Since the access concepts are not related via refinement, but
instead cover orthogonal issues, we do not use tags for the
access concepts, but instead use the equivalent of a bit field.</p>
<p>We provide an access mechanism for mapping iterator types to
the new traversal tags and access bit field. Our design reuses
<ttclass="literal"><spanclass="pre">iterator_traits<Iter>::iterator_category</span></tt> as the access
mechanism. To that end, the access and traversal information is
bundled into a single type using the following <cite>iterator_tag</cite>
<p>The <ttclass="literal"><spanclass="pre">access_bits</span></tt> argument is declared to be <ttclass="literal"><spanclass="pre">unsigned</span><spanclass="pre">int</span></tt>
instead of the enum <ttclass="literal"><spanclass="pre">iterator_access</span></tt> for convenience of
use. For example, the expression <ttclass="literal"><spanclass="pre">(readable_iterator</span><spanclass="pre">|</span>
<spanclass="pre">writable_iterator)</span></tt> produces an unsigned int, not an
<ttclass="literal"><spanclass="pre">iterator_access</span></tt>. The purpose of the <ttclass="literal"><spanclass="pre">lvalue_iterator</span></tt>
part of the <ttclass="literal"><spanclass="pre">iterator_access</span></tt> enum is to communicate to
<ttclass="literal"><spanclass="pre">iterator_tag</span></tt> whether the reference type is an lvalue so
that the appropriate old category can be chosen for the base
class. The <ttclass="literal"><spanclass="pre">lvalue_iterator</span></tt> bit is not recorded in the
<ttclass="literal"><spanclass="pre">iterator_tag::access</span></tt> data member.</p>
<p>The <ttclass="literal"><spanclass="pre">iterator_tag</span></tt> class template is derived from the
appropriate iterator tag or tags from the old requirements
based on the access bits and traversal tag passed as template
parameters. The algorithm for determining the old tag or tags
picks the least refined old concepts that include all of the
requirements of the access and traversal concepts (that is, the
closest fit), if any such category exists. For example, the
category tag for a Readable Single Pass Iterator will always be
derived from <ttclass="literal"><spanclass="pre">input_iterator_tag</span></tt>, while the category tag for
a Single Pass Iterator that is both Readable and Writable will
be derived from both <ttclass="literal"><spanclass="pre">input_iterator_tag</span></tt> and
<p>The <ttclass="literal"><spanclass="pre">iterator_tag</span></tt> class template is an iterator category tag
that encodes the access enum and traversal tag in addition to
being compatible with the original iterator tags. The
<ttclass="literal"><spanclass="pre">iterator_tag</span></tt> class inherits from one of the original
iterator tags according to the following pseudo-code.</p>
<preclass="literal-block">
inherit-category(access, traversal-tag) =
if ((access & readable_iterator) && (access & lvalue_iterator)) {
if (traversal-tag is convertible to random_access_traversal_tag)
return random_access_iterator_tag;
else if (traversal-tag is convertible to bidirectional_traversal_tag)
return bidirectional_iterator_tag;
else if (traversal-tag is convertible to forward_traversal_tag)
return forward_iterator_tag;
else if (traversal-tag is convertible to single_pass_traversal_tag)
if (access-tag is convertible to writable_iterator_tag)
return input_output_iterator_tag;
else
return input_iterator_tag;
else
return null_category_tag;
} else if ((access & readable_iterator) and (access & writable_iterator)
and traversal-tag is convertible to single_pass_iterator_tag)
return input_output_iterator_tag;
else if (access & readable_iterator
and traversal-tag is convertible to single_pass_iterator_tag)
return input_iterator_tag;
else if (access & writable_iterator
and traversal-tag is convertible to incrementable_iterator_tag)
return output_iterator_tag;
else
return null_category_tag;
</pre>
<p>If the argument for <ttclass="literal"><spanclass="pre">TraversalTag</span></tt> is not convertible to
<ttclass="literal"><spanclass="pre">incrementable_iterator_tag</span></tt> then the program is ill-formed.</p>
</blockquote>
<p>Change:</p>
<blockquote>
<p>The <ttclass="literal"><spanclass="pre">is_readable</span></tt>, <ttclass="literal"><spanclass="pre">is_writable</span></tt>, <ttclass="literal"><spanclass="pre">is_swappable</span></tt>, and
<ttclass="literal"><spanclass="pre">traversal_category</span></tt> class templates are traits classes. For
<p>The <ttclass="literal"><spanclass="pre">is_readable_iterator</span></tt> class template satisfies the
UnaryTypeTrait requirements.</p>
<p>Given an iterator type <ttclass="literal"><spanclass="pre">X</span></tt>,
<ttclass="literal"><spanclass="pre">is_readable_iterator<X>::value</span></tt> yields <ttclass="literal"><spanclass="pre">true</span></tt> if, for an
object <ttclass="literal"><spanclass="pre">a</span></tt> of type <ttclass="literal"><spanclass="pre">X</span></tt>, <ttclass="literal"><spanclass="pre">*a</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">iterator_traits<X>::value_type</span></tt>, and <ttclass="literal"><spanclass="pre">false</span></tt> otherwise.</p>
template <class Dr, class V, class TC, class R, class D>
Derived operator+ (typename Derived::difference_type n,
iterator_facade<Dr,V,TC,R,D> const&);
</pre>
<p>After the <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> synopsis, add:</p>
<p>The <ttclass="literal"><spanclass="pre">iterator_category</span></tt> member of <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> is</p>
<li>There are two reasons for removing <ttclass="literal"><spanclass="pre">is_writable</span></tt>
and <ttclass="literal"><spanclass="pre">is_swappable</span></tt>. The first is that we do not know of
a way to fix the specification so that it gives the correct
answer for all iterators. Second, there was only a weak
motivation for having <ttclass="literal"><spanclass="pre">is_writable</span></tt> and <ttclass="literal"><spanclass="pre">is_swappable</span></tt>
there in the first place. The main motivation was simply
uniformity: we have tags for the old iterator categories
so we should have tags for the new iterator categories.
While having tags and the capability to dispatch based
on the traversal categories is often used, we see
less of a need for dispatching based on writability
and swappability, since typically algorithms
that need these capabilities have no alternative if
they are not provided.</li>
<li>We discovered that the <ttclass="literal"><spanclass="pre">is_readable</span></tt> trait can be implemented
using only the iterator type itself and its <ttclass="literal"><spanclass="pre">value_type</span></tt>.
Therefore we remove the requirement for <ttclass="literal"><spanclass="pre">is_readable</span></tt> from the
Readable Iterator concept, and change the definition of
<ttclass="literal"><spanclass="pre">is_readable</span></tt> so that it works for any iterator type.</li>
<li>The purpose of the <ttclass="literal"><spanclass="pre">iterator_tag</span></tt> class was to bundle the
traversal and access category tags into the
<ttclass="literal"><spanclass="pre">iterator_category</span></tt> typedef. With <ttclass="literal"><spanclass="pre">is_writable</span></tt> and
<ttclass="literal"><spanclass="pre">is_swappable</span></tt> gone, and <ttclass="literal"><spanclass="pre">is_readable</span></tt> no longer in need of
special hints, there is no reason for iterators to provide
information about the access capabilities of an iterator. Thus
there is no need for the <ttclass="literal"><spanclass="pre">iterator_tag</span></tt>. The traversal tag can
be directly used for the <ttclass="literal"><spanclass="pre">iterator_category</span></tt>. If a new
iterator is intended to be backward compatible with old iterator
concepts, a tag type that is convertible to both one of the new
traversal tags and also to an old iterator tag can be created
and use for the <ttclass="literal"><spanclass="pre">iterator_category</span></tt>.</li>
<li>The changes to the specification of <ttclass="literal"><spanclass="pre">traversal_category</span></tt> are a
direct result of the removal of <ttclass="literal"><spanclass="pre">iterator_tag</span></tt>.</li>
<h2><aclass="toc-backref"href="#id19"name="are-is-readable-is-writable-and-is-swappable-useful">9.18 Are is_readable, is_writable, and is_swappable useful?</a></h2>
<h2><aclass="toc-backref"href="#id20"name="non-uniformity-of-the-lvalue-iterator-bit">9.19 Non-Uniformity of the "lvalue_iterator Bit"</a></h2>
<h2><aclass="toc-backref"href="#id23"name="return-type-of-iterator-difference-for-iterator-facade">9.22 return type of Iterator difference for iterator facade</a></h2>
<h2><aclass="toc-backref"href="#id25"name="use-of-undefined-name-in-iterator-facade-table">9.24 Use of undefined name in iterator_facade table</a></h2>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">If <ttclass="literal"><spanclass="pre">X::reference</span></tt> is a reference type, an object
of type <ttclass="literal"><spanclass="pre">X::pointer</span></tt> equal to:</p>
<p>Otherwise returns an object of unspecified type such that,
given an object <ttclass="literal"><spanclass="pre">a</span></tt> of type <ttclass="literal"><spanclass="pre">X</span></tt>, <ttclass="literal"><spanclass="pre">a->m</span></tt> is equivalent
to <ttclass="literal"><spanclass="pre">(w</span><spanclass="pre">=</span><spanclass="pre">*a,</span><spanclass="pre">w.m)</span></tt> for some temporary object <ttclass="literal"><spanclass="pre">w</span></tt> of type
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">If <ttclass="literal"><spanclass="pre">reference</span></tt> is a reference type, an object
of type <ttclass="literal"><spanclass="pre">pointer</span></tt> equal to:</p>
<pclass="last">Otherwise returns an object of unspecified type such that,
<ttclass="literal"><spanclass="pre">(*static_cast<Derived</span><spanclass="pre">const*>(this))->m</span></tt> is equivalent
to <ttclass="literal"><spanclass="pre">(w</span><spanclass="pre">=</span><spanclass="pre">**static_cast<Derived</span><spanclass="pre">const*>(this),</span><spanclass="pre">w.m)</span></tt> for
some temporary object <ttclass="literal"><spanclass="pre">w</span></tt> of type <ttclass="literal"><spanclass="pre">value_type</span></tt>.</p>
<p>The returns clause for <ttclass="literal"><spanclass="pre">operator[](difference_type</span><spanclass="pre">n)</span></tt> const
says:</p>
<blockquote>
Returns: an object convertible to X::reference and holding a copy
p of a+n such that, for a constant object v of type
X::value_type, X::reference(a[n] = v) is equivalent to p = v.
This needs to define 'a', but assuming it's supposed to be
<ttclass="literal"><spanclass="pre">*this</span></tt> (or maybe <ttclass="literal"><spanclass="pre">*(Derived*)this</span></tt>), it still isn't clear
what this says. Presumably, the idea is that you can index off of
an iterator and assign to the result. But why the requirement
that it hold a copy of a+n? Granted, that's probably how it's
implemented, but it seems over-constrained. And the last phrase
seems wrong. p is an iterator; there's no requirement that you
can assign a value_type object to it. Should that be <ttclass="literal"><spanclass="pre">*p</span><spanclass="pre">=</span><spanclass="pre">v</span></tt>?
But why the cast in reference(a[n] = v)?</blockquote>
Writable iterators built with <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> implement
the semantics required by the preferred resolution to <cite>issue
299</cite> and adopted by proposal <cite>n1477</cite>: the result of <ttclass="literal"><spanclass="pre">p[n]</span></tt>
is a proxy object containing a copy of <ttclass="literal"><spanclass="pre">p+n</span></tt>, and <ttclass="literal"><spanclass="pre">p[n]</span><spanclass="pre">=</span>
<spanclass="pre">x</span></tt> is equivalent to <ttclass="literal"><spanclass="pre">*(p</span><spanclass="pre">+</span><spanclass="pre">n)</span><spanclass="pre">=</span><spanclass="pre">x</span></tt>. This approach will
work properly for any random-access iterator regardless of
the other details of its implementation. A user who knows
more about the implementation of her iterator is free to
implement an <ttclass="literal"><spanclass="pre">operator[]</span></tt> which returns an lvalue in the
derived iterator class; it will hide the one supplied by
<ttclass="literal"><spanclass="pre">iterator_facade</span></tt> from clients of her iterator.</blockquote>
<p>to:</p>
<blockquote>
Writable iterators built with <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> implement
the semantics required by the preferred resolution to <cite>issue
299</cite> and adopted by proposal <cite>n1550</cite>: the result of <ttclass="literal"><spanclass="pre">p[n]</span></tt>
is an object convertible to the iterator's <ttclass="literal"><spanclass="pre">value_type</span></tt>,
and <ttclass="literal"><spanclass="pre">p[n]</span><spanclass="pre">=</span><spanclass="pre">x</span></tt> is equivalent to <ttclass="literal"><spanclass="pre">*(p</span><spanclass="pre">+</span><spanclass="pre">n)</span><spanclass="pre">=</span><spanclass="pre">x</span></tt> (Note:
This result object may be implemented as a proxy containing a
copy of <ttclass="literal"><spanclass="pre">p+n</span></tt>). This approach will work properly for any
random-access iterator regardless of the other details of its
implementation. A user who knows more about the
implementation of her iterator is free to implement an
<ttclass="literal"><spanclass="pre">operator[]</span></tt> that returns an lvalue in the derived iterator
class; it will hide the one supplied by <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>
from clients of her iterator.</blockquote>
</blockquote>
<p>In [lib.iterator.facade] operations:</p>
<blockquoteclass="last">
<p>Change:</p>
<blockquote>
<tableclass="field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">an object convertible to <ttclass="literal"><spanclass="pre">X::reference</span></tt> and
holding a copy <em>p</em> of <ttclass="literal"><spanclass="pre">a+n</span></tt> such that, for a constant
object <ttclass="literal"><spanclass="pre">v</span></tt> of type <ttclass="literal"><spanclass="pre">X::value_type</span></tt>, <ttclass="literal"><spanclass="pre">X::reference(a[n]</span>
<spanclass="pre">=</span><spanclass="pre">v)</span></tt> is equivalent to <ttclass="literal"><spanclass="pre">p</span><spanclass="pre">=</span><spanclass="pre">v</span></tt>.</td>
</tr>
</tbody>
</table>
</blockquote>
<p>to:</p>
<blockquote>
<tableclass="field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">an object convertible to <ttclass="literal"><spanclass="pre">value_type</span></tt>. For
constant objects <ttclass="literal"><spanclass="pre">v</span></tt> of type <ttclass="literal"><spanclass="pre">value_type</span></tt>, and <ttclass="literal"><spanclass="pre">n</span></tt> of
type <ttclass="literal"><spanclass="pre">difference_type</span></tt>, <ttclass="literal"><spanclass="pre">(*this)[n]</span><spanclass="pre">=</span><spanclass="pre">v</span></tt> is equivalent
to <ttclass="literal"><spanclass="pre">*(*this</span><spanclass="pre">+</span><spanclass="pre">n)</span><spanclass="pre">=</span><spanclass="pre">v</span></tt>, and <ttclass="literal"><spanclass="pre">static_cast<value_type</span>
<spanclass="pre">const&>((*this)[n])</span></tt> is equivalent to
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
a default constructed base object.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
a default-constructed <ttclass="literal"><spanclass="pre">m_iterator</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body">Inheritance from iterator_adaptor has been removed, so we instead
give the semantics in terms of the (exposition only) member
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> that is a copy of <ttclass="literal"><spanclass="pre">y</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> whose
<ttclass="literal"><spanclass="pre">m_iterator</span></tt> subobject is constructed from <ttclass="literal"><spanclass="pre">y.base()</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
</dl>
</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body">Inheritance from iterator_adaptor has been removed, so we
instead give the semantics in terms of the member <ttclass="literal"><spanclass="pre">m_iterator</span></tt>.</td>
<ttclass="literal"><spanclass="pre">function_output_iterator</span></tt> is a model of the Writable and
Incrementable Iterator concepts.</blockquote>
<dl>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">function_output_iterator</span></tt> with
<ttclass="literal"><spanclass="pre">f</span></tt> stored as a data member.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs an instance of <ttclass="literal"><spanclass="pre">function_output_iterator</span></tt>
with <ttclass="literal"><spanclass="pre">m_f</span></tt> constructed from <ttclass="literal"><spanclass="pre">f</span></tt>.</td>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">output_proxy</span></tt> constructed with
a copy of the unary function <ttclass="literal"><spanclass="pre">f</span></tt>.</td>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An object <ttclass="literal"><spanclass="pre">r</span></tt> of unspecified type such that <ttclass="literal"><spanclass="pre">r</span><spanclass="pre">=</span><spanclass="pre">t</span></tt>
is equivalent to <ttclass="literal"><spanclass="pre">m_f(t)</span></tt> for all <ttclass="literal"><spanclass="pre">t</span></tt>.</td>
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">output_proxy</span></tt> with <ttclass="literal"><spanclass="pre">f</span></tt> stored as
<td>Convertible to <ttclass="literal"><spanclass="pre">T</span></tt></td>
<td><dlclass="first last">
<dt>pre: <ttclass="literal"><spanclass="pre">a</span></tt> is dereferenceable. If <ttclass="literal"><spanclass="pre">a</span><spanclass="pre">==</span><spanclass="pre">b</span></tt> then <ttclass="literal"><spanclass="pre">*a</span></tt></dt>
<dd>is equivalent to <ttclass="literal"><spanclass="pre">*b</span></tt>.</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</blockquote>
<dl>
<dt>Change:</dt>
<dd>The <em>Lvalue Iterator</em> concept adds the requirement that the
<ttclass="literal"><spanclass="pre">reference</span></tt> type be a reference to the value type of the
iterator.</dd>
<dt>to:</dt>
<dd>The <em>Lvalue Iterator</em> concept adds the requirement that the
return type of <ttclass="literal"><spanclass="pre">operator*</span></tt> type be a reference to the value
pre: <ttclass="literal"><spanclass="pre">a</span></tt> is
dereferenceable. If <ttclass="literal"><spanclass="pre">a</span>
<spanclass="pre">==</span><spanclass="pre">b</span></tt> then <ttclass="literal"><spanclass="pre">*a</span></tt> is
equivalent to <ttclass="literal"><spanclass="pre">*b</span></tt>.</td>
</tr>
</tbody>
</table>
</blockquote>
<pclass="last">At the end of the section reverse_iterator models, add:
The type <ttclass="literal"><spanclass="pre">iterator_traits<Iterator>::reference</span></tt> must be the type of
<ttclass="literal"><spanclass="pre">*i</span></tt>, where <ttclass="literal"><spanclass="pre">i</span></tt> is an object of type <ttclass="literal"><spanclass="pre">Iterator</span></tt>.</p>
</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body"><pclass="first">Ideally there should be requirements on the reference
type, however, since Readable Iterator is suppose to correspond
to the current standard iterator requirements (which do not place
requirements on the reference type) we will leave them off for
now. There is a DR in process with respect to the reference type
in the stadard iterator requirements. Once that is resolved we
will revisit this issue for Readable Iterator and Lvalue
Iterator.</p>
<pclass="last">We added Assignable to the requirements for Readable
Iterator. This is needed to have Readable Iterator coincide with
The template functions <ttclass="literal"><spanclass="pre">operator==</span></tt>, <ttclass="literal"><spanclass="pre">operator!=</span></tt>,
<ttclass="literal"><spanclass="pre">operator<</span></tt>, <ttclass="literal"><spanclass="pre">operator<=</span></tt>, <ttclass="literal"><spanclass="pre">operator></span></tt>, <ttclass="literal"><spanclass="pre">operator>=</span></tt>, and
<ttclass="literal"><spanclass="pre">operator-</span></tt> that take two arguments that are specializations of
iterator_facade have no specification. The template function
operator+ that takes an argument that is a specialization of
iterator_facade and an argument of type difference_type has no
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<trclass="field"><thclass="field-name">Return Type:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<ttclass="literal"><spanclass="pre">difference</span></tt> shall be
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">if <ttclass="literal"><spanclass="pre">is_convertible<Dr2,Dr1>::value</span></tt>, then
<spanclass="pre"><=</span><spanclass="pre">z</span></tt>, <ttclass="literal"><spanclass="pre">c</span><spanclass="pre">></span><spanclass="pre">z</span></tt>, and <ttclass="literal"><spanclass="pre">c</span><spanclass="pre">>=</span><spanclass="pre">c</span></tt>.</td>
<h2><aclass="toc-backref"href="#id39"name="x-inheritance-in-iterator-adaptor-and-other-adaptors-is-an-overspecification">9.37x Inheritance in iterator_adaptor and other adaptors is an overspecification</a></h2>
<p>A class or built-in type <ttclass="literal"><spanclass="pre">X</span></tt> that models Single Pass Iterator
is <em>interoperable with</em> a class or built-in type <ttclass="literal"><spanclass="pre">Y</span></tt> that
also models Single Pass Iterator if the following expressions
are valid and respect the stated semantics. In the tables
below, <ttclass="literal"><spanclass="pre">x</span></tt> is an object of type <ttclass="literal"><spanclass="pre">X</span></tt>, <ttclass="literal"><spanclass="pre">y</span></tt> is an object of
type <ttclass="literal"><spanclass="pre">Y</span></tt>, <ttclass="literal"><spanclass="pre">Distance</span></tt> is
<ttclass="literal"><spanclass="pre">iterator_traits<Y>::difference_type</span></tt>, and <ttclass="literal"><spanclass="pre">n</span></tt> represents a
constant object of type <ttclass="literal"><spanclass="pre">Distance</span></tt>.</p>
<td>convertible to <ttclass="literal"><spanclass="pre">bool</span></tt></td>
<td><ttclass="literal"><spanclass="pre">bool(a==b)</span><spanclass="pre">!=</span><spanclass="pre">bool(a!=b)</span></tt> over its domain.</td>
</tr>
</tbody>
</table>
<p>If <ttclass="literal"><spanclass="pre">X</span></tt> and <ttclass="literal"><spanclass="pre">Y</span></tt> both model Random Access Traversal Iterator then
the following additional requirements must be met.</p>
<td>pre: there exists a value <ttclass="literal"><spanclass="pre">n</span></tt> of
<ttclass="literal"><spanclass="pre">Distance</span></tt> such that <ttclass="literal"><spanclass="pre">x</span><spanclass="pre">+</span><spanclass="pre">n</span><spanclass="pre">==</span><spanclass="pre">y</span></tt>.
<td>pre: there exists a value <ttclass="literal"><spanclass="pre">n</span></tt> of
<ttclass="literal"><spanclass="pre">Distance</span></tt> such that <ttclass="literal"><spanclass="pre">y</span><spanclass="pre">+</span><spanclass="pre">n</span><spanclass="pre">==</span><spanclass="pre">x</span></tt>.
<li>Lvalue Iterator if <ttclass="literal"><spanclass="pre">reference</span></tt> is a reference type.</li>
</ul>
</blockquote>
<p><ttclass="literal"><spanclass="pre">indirect_iterator<X,V1,C1,R1,D1></span></tt> is interoperable with
<ttclass="literal"><spanclass="pre">indirect_iterator<Y,V2,C2,R2,D2></span></tt> if and only if <ttclass="literal"><spanclass="pre">X</span></tt> is
interoperable with <ttclass="literal"><spanclass="pre">Y</span></tt>.</p>
In addition to the operations required by the concepts described
above, specializations of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> provide the
following operations.</blockquote>
<dl>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
the <ttclass="literal"><spanclass="pre">iterator_adaptor</span></tt> subobject copy constructed from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> with
<ttclass="literal"><spanclass="pre">m_iterator</span></tt> copy constructed from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
</dl>
<p>At the end of the indirect_iterator operations add:</p>
<dt>After the synopsis for <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt>, add:</dt>
<dd>If <ttclass="literal"><spanclass="pre">Iterator</span></tt> models Random Access Traversal Iterator and Readable
Lvalue Iterator, then <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">random_access_iterator_tag</span></tt>. Otherwise, if
<ttclass="literal"><spanclass="pre">Iterator</span></tt> models Bidirectional Traversal Iterator and Readable
Lvalue Iterator, then <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">bidirectional_iterator_tag</span></tt>. Otherwise, <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is
convertible to <ttclass="literal"><spanclass="pre">input_iterator_tag</span></tt>.</dd>
<p><ttclass="literal"><spanclass="pre">reverse_iterator<X></span></tt> is interoperable with
<ttclass="literal"><spanclass="pre">reverse_iterator<Y></span></tt> if and only if <ttclass="literal"><spanclass="pre">X</span></tt> is interoperable with
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> with a
default constructed base object.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs an instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> with <ttclass="literal"><spanclass="pre">m_iterator</span></tt>
default constructed.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs an instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> with a
base object copy constructed from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs an instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> with a
<ttclass="literal"><spanclass="pre">m_iterator</span></tt> constructed from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> that is a copy of <ttclass="literal"><spanclass="pre">r</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs instance of <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt> whose
<ttclass="literal"><spanclass="pre">m_iterator</span></tt> subobject is constructed from <ttclass="literal"><spanclass="pre">y.base()</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>At the end of the operations for <ttclass="literal"><spanclass="pre">reverse_iterator</span></tt>, add:</dt>
<dd>If <ttclass="literal"><spanclass="pre">Iterator</span></tt> models Readable Lvalue Iterator and if <ttclass="literal"><spanclass="pre">Iterator</span></tt>
models Random Access Traversal Iterator, then <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is
convertible to <ttclass="literal"><spanclass="pre">random_access_iterator_tag</span></tt>. Otherwise, if
<ttclass="literal"><spanclass="pre">Iterator</span></tt> models Bidirectional Traversal Iterator, then
<ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">bidirectional_iterator_tag</span></tt>. Otherwise <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is
convertible to <ttclass="literal"><spanclass="pre">forward_iterator_tag</span></tt>. If <ttclass="literal"><spanclass="pre">Iterator</span></tt> does not
model Readable Lvalue Iterator then <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is
convertible to <ttclass="literal"><spanclass="pre">input_iterator_tag</span></tt>.</dd>
<dt>In the requirements section, change:</dt>
<dd><pclass="first">The type <ttclass="literal"><spanclass="pre">Iterator</span></tt> must at least model Readable Iterator. The
resulting <ttclass="literal"><spanclass="pre">transform_iterator</span></tt> models the most refined of the
following that is also modeled by <ttclass="literal"><spanclass="pre">Iterator</span></tt>.</p>
<p>The <ttclass="literal"><spanclass="pre">transform_iterator</span></tt> models the most refined standard traversal
concept that is modeled by <ttclass="literal"><spanclass="pre">Iterator</span></tt>.</p>
<pclass="last">The <ttclass="literal"><spanclass="pre">reference</span></tt> type of <ttclass="literal"><spanclass="pre">transform_iterator</span></tt> is
The <ttclass="literal"><spanclass="pre">value_type</span></tt> is <ttclass="literal"><spanclass="pre">remove_cv<remove_reference<reference></span><spanclass="pre">>::type</span></tt>.</p>
</dd>
<dt>to:</dt>
<dd>The argument <ttclass="literal"><spanclass="pre">Iterator</span></tt> shall model Readable Iterator.</dd>
<p>If <ttclass="literal"><spanclass="pre">transform_iterator</span></tt> models Writable Lvalue Iterator then it is a
mutable iterator (as defined in the old iterator requirements).</p>
<p><ttclass="literal"><spanclass="pre">transform_iterator<F1,</span><spanclass="pre">X,</span><spanclass="pre">R1,</span><spanclass="pre">V1></span></tt> is interoperable with
<ttclass="literal"><spanclass="pre">transform_iterator<F2,</span><spanclass="pre">Y,</span><spanclass="pre">R2,</span><spanclass="pre">V2></span></tt> if and only if <ttclass="literal"><spanclass="pre">X</span></tt> is
interoperable with <ttclass="literal"><spanclass="pre">Y</span></tt>.</p>
</blockquote>
<p>Remove the private operations section heading and remove:</p>
while (this->base() != this->m_end && !this->m_predicate(*this->base()))
++(this->base_reference());
}
Predicate m_predicate;
Iterator m_end;
</pre>
<p>to:</p>
<preclass="literal-block">
Iterator const& base() const;
reference operator*() const;
filter_iterator& operator++();
private:
Predicate m_pred; // exposition only
Iterator m_iter; // exposition only
Iterator m_end; // exposition only
</pre>
<dl>
<dt>Change:</dt>
<dd>The base <ttclass="literal"><spanclass="pre">Iterator</span></tt> parameter must be a model of Readable
Iterator and Single Pass Iterator. The resulting
<ttclass="literal"><spanclass="pre">filter_iterator</span></tt> will be a model of Forward Traversal Iterator
if <ttclass="literal"><spanclass="pre">Iterator</span></tt> is, otherwise the <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> will be a
model of Single Pass Iterator. The access category of the
<ttclass="literal"><spanclass="pre">filter_iterator</span></tt> will be the same as the access category of
<p><ttclass="literal"><spanclass="pre">filter_iterator<P1,</span><spanclass="pre">X></span></tt> is interoperable with <ttclass="literal"><spanclass="pre">filter_iterator<P2,</span><spanclass="pre">Y></span></tt>
if and only if <ttclass="literal"><spanclass="pre">X</span></tt> is interoperable with <ttclass="literal"><spanclass="pre">Y</span></tt>.</p>
</blockquote>
<dl>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
predicate is a default constructed <ttclass="literal"><spanclass="pre">Predicate</span></tt> and
whose <ttclass="literal"><spanclass="pre">end</span></tt> is a default constructed <ttclass="literal"><spanclass="pre">Iterator</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs a <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> whose``m_pred``, <ttclass="literal"><spanclass="pre">m_iter</span></tt>, and <ttclass="literal"><spanclass="pre">m_end</span></tt>
members are a default constructed.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">A <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> at position <ttclass="literal"><spanclass="pre">x</span></tt> that filters according
to predicate <ttclass="literal"><spanclass="pre">f</span></tt> and that will not increment past <ttclass="literal"><spanclass="pre">end</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs a <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> where <ttclass="literal"><spanclass="pre">m_iter</span></tt> is either
the first position in the range <ttclass="literal"><spanclass="pre">[x,end)</span></tt> such that <ttclass="literal"><spanclass="pre">f(*m_iter)</span><spanclass="pre">==</span><spanclass="pre">true</span></tt>
or else``m_iter == end``. The member <ttclass="literal"><spanclass="pre">m_pred</span></tt> is constructed from
<ttclass="literal"><spanclass="pre">f</span></tt> and <ttclass="literal"><spanclass="pre">m_end</span></tt> from <ttclass="literal"><spanclass="pre">end</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">A <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> at position <ttclass="literal"><spanclass="pre">x</span></tt> that filters
according to a default constructed <ttclass="literal"><spanclass="pre">Predicate</span></tt>
and that will not increment past <ttclass="literal"><spanclass="pre">end</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs a <ttclass="literal"><spanclass="pre">filter_iterator</span></tt> where <ttclass="literal"><spanclass="pre">m_iter</span></tt> is either
the first position in the range <ttclass="literal"><spanclass="pre">[x,end)</span></tt> such that <ttclass="literal"><spanclass="pre">m_pred(*m_iter)</span><spanclass="pre">==</span><spanclass="pre">true</span></tt>
or else``m_iter == end``. The member <ttclass="literal"><spanclass="pre">m_pred</span></tt> is default constructed.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">A copy of iterator <ttclass="literal"><spanclass="pre">t</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Constructs a filter iterator whose members are copied from <ttclass="literal"><spanclass="pre">t</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">A copy of the predicate object used to construct <ttclass="literal"><spanclass="pre">*this</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">The object <ttclass="literal"><spanclass="pre">end</span></tt> used to construct <ttclass="literal"><spanclass="pre">*this</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Increments <ttclass="literal"><spanclass="pre">m_iter</span></tt> and then continues to
increment <ttclass="literal"><spanclass="pre">m_iter</span></tt> until either <ttclass="literal"><spanclass="pre">m_iter</span><spanclass="pre">==</span><spanclass="pre">m_end</span></tt>
or <ttclass="literal"><spanclass="pre">m_pred(*m_iter)</span><spanclass="pre">==</span><spanclass="pre">true</span></tt>.</td>
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
<dd><ttclass="literal"><spanclass="pre">distance_to</span></tt> and a <ttclass="literal"><spanclass="pre">difference_type</span></tt> that avoids overflows in
the cases when the <ttclass="literal"><spanclass="pre">Incrementable</span></tt> type is a numeric type.]</dd>
</dl>
</dd>
<dt>to:</dt>
<dd><dlclass="first last">
<dt>[<em>Note:</em> implementers are encouraged to provide an implementation of</dt>
<dd><ttclass="literal"><spanclass="pre">operator-</span></tt> and a <ttclass="literal"><spanclass="pre">difference_type</span></tt> that avoid overflows in
the cases where <ttclass="literal"><spanclass="pre">std::numeric_limits<Incrementable>::is_specialized</span></tt>
is true.]</dd>
</dl>
</dd>
<dt>Change:</dt>
<dd><pclass="first">The <ttclass="literal"><spanclass="pre">Incrementable</span></tt> type must be Default Constructible, Copy
Constructible, and Assignable. The default distance is
an implementation defined signed integegral type.</p>
<dd>The <ttclass="literal"><spanclass="pre">Incrementable</span></tt> argument shall be Copy Constructible and Assignable.</dd>
<dt>Change:</dt>
<dd>Furthermore, if you wish to create a counting iterator that is a Forward
Traversal Iterator, then the following expressions must be valid:</dd>
<dt>to:</dt>
<dd>If <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to <ttclass="literal"><spanclass="pre">forward_iterator_tag</span></tt>
or <ttclass="literal"><spanclass="pre">forward_traversal_tag</span></tt>, the following must be well-formed:</dd>
<dt>Change:</dt>
<dd>If you wish to create a counting iterator that is a
Bidirectional Traversal Iterator, then pre-decrement is also required:</dd>
<dt>to:</dt>
<dd>If <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">bidirectional_iterator_tag</span></tt> or <ttclass="literal"><spanclass="pre">bidirectional_traversal_tag</span></tt>,
the following expression must also be well-formed:</dd>
<dt>Change:</dt>
<dd>If you wish to create a counting iterator that is a Random Access
Traversal Iterator, then these additional expressions are also
required:</dd>
<dt>to:</dt>
<dd>If <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible to
<ttclass="literal"><spanclass="pre">random_access_iterator_tag</span></tt> or <ttclass="literal"><spanclass="pre">random_access_traversal_tag</span></tt>,
<p>Specializations of <ttclass="literal"><spanclass="pre">counting_iterator</span></tt> model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
iterator tags to which their <ttclass="literal"><spanclass="pre">iterator_category</span></tt> is convertible.
Also, if <ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt> is not <ttclass="literal"><spanclass="pre">use_default</span></tt> then
<ttclass="literal"><spanclass="pre">counting_iterator</span></tt> models the concept corresponding to the iterator
tag <ttclass="literal"><spanclass="pre">CategoryOrTraversal</span></tt>. Otherwise, if
<ttclass="literal"><spanclass="pre">numeric_limits<Incrementable>::is_specialized</span></tt>, then
<ttclass="literal"><spanclass="pre">counting_iterator</span></tt> models Random Access Traversal Iterator.
Otherwise, <ttclass="literal"><spanclass="pre">counting_iterator</span></tt> models the same iterator traversal
concepts modeled by <ttclass="literal"><spanclass="pre">Incrementable</span></tt>.</p>
<p><ttclass="literal"><spanclass="pre">counting_iterator<X,C1,D1></span></tt> is interoperable with
<ttclass="literal"><spanclass="pre">counting_iterator<Y,C2,D2></span></tt> if and only if <ttclass="literal"><spanclass="pre">X</span></tt> is
interoperable with <ttclass="literal"><spanclass="pre">Y</span></tt>.</p>
</blockquote>
<p>At the begining of the operations section, add:</p>
<blockquote>
In addition to the operations required by the concepts modeled by
<ttclass="literal"><spanclass="pre">counting_iterator</span></tt>, <ttclass="literal"><spanclass="pre">counting_iterator</span></tt> provides the following
operations.</blockquote>
<dl>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">A default constructed instance of <ttclass="literal"><spanclass="pre">counting_iterator</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Requires:</th><tdclass="field-body"><ttclass="literal"><spanclass="pre">Incrementable</span></tt> is Default Constructible.</td>
</tr>
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Default construct the member <ttclass="literal"><spanclass="pre">m_inc</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">counting_iterator</span></tt> that is a copy of <ttclass="literal"><spanclass="pre">rhs</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Construct member <ttclass="literal"><spanclass="pre">m_inc</span></tt> from <ttclass="literal"><spanclass="pre">rhs.m_inc</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>Change:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Returns:</th><tdclass="field-body">An instance of <ttclass="literal"><spanclass="pre">counting_iterator</span></tt> with its base
object copy constructed from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
</tr>
</tbody>
</table>
</dd>
<dt>to:</dt>
<dd><tableclass="first last field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Effects:</th><tdclass="field-body">Construct member <ttclass="literal"><spanclass="pre">m_inc</span></tt> from <ttclass="literal"><spanclass="pre">x</span></tt>.</td>
<h2><aclass="toc-backref"href="#id40"name="x-problem-with-specification-of-a-m-in-readable-iterator">9.38x Problem with specification of a->m in Readable Iterator</a></h2>
<td>pre: <ttclass="literal"><spanclass="pre">(*a).m</span></tt> is well-defined. Equivalent to <ttclass="literal"><spanclass="pre">(*a).m</span></tt></td>
</tr>
</tbody>
</table>
</blockquote>
<p>Do we mean to outlaw iterators with proxy references from meeting
the readable requirements?</p>
<p>Would it be better for the requirements to read <ttclass="literal"><spanclass="pre">static_cast<T>(*a).m</span></tt>
instead of <ttclass="literal"><spanclass="pre">(*a).m</span></tt> ?</p>
<p>counting_iterator takes an argument for its Traversal type, with a
default value of use_default. It is derived from an instance of
iterator_adaptor, where the argument passed for the Traversal type
is described as "<ttclass="literal"><spanclass="pre">/*</span><spanclass="pre">see</span><spanclass="pre">details</span><spanclass="pre">for</span><spanclass="pre">traversal</span><spanclass="pre">category</span>
<spanclass="pre">*/</span></tt>". The details for counting_iterator describe constraints on
the Incrementable type imposed by various traversal
categories. There is no description of what the argument to
<p>The <ttclass="literal"><spanclass="pre">value_type</span></tt> of the <ttclass="literal"><spanclass="pre">Iterator</span></tt> template parameter
should itself be dereferenceable. The return type of the
<ttclass="literal"><spanclass="pre">operator*</span></tt> for the <ttclass="literal"><spanclass="pre">value_type</span></tt> must be the same type as
the <ttclass="literal"><spanclass="pre">Reference</span></tt> template parameter. The <ttclass="literal"><spanclass="pre">Value</span></tt> template
parameter will be the <ttclass="literal"><spanclass="pre">value_type</span></tt> for the
<ttclass="literal"><spanclass="pre">indirect_iterator</span></tt>, unless <ttclass="literal"><spanclass="pre">Value</span></tt> is const. If <ttclass="literal"><spanclass="pre">Value</span></tt>
is <ttclass="literal"><spanclass="pre">const</span><spanclass="pre">X</span></tt>, then <ttclass="literal"><spanclass="pre">value_type</span></tt> will be <em>non-</em><ttclass="literal"><spanclass="pre">const</span><spanclass="pre">X</span></tt>.
The default for <ttclass="literal"><spanclass="pre">Value</span></tt> is:</p>
<p>If the default is used for <ttclass="literal"><spanclass="pre">Value</span></tt>, then there must be a
valid specialization of <ttclass="literal"><spanclass="pre">iterator_traits</span></tt> for the value type
of the base iterator.</p>
<p>The <ttclass="literal"><spanclass="pre">Reference</span></tt> parameter will be the <ttclass="literal"><spanclass="pre">reference</span></tt> type of the
<ttclass="literal"><spanclass="pre">indirect_iterator</span></tt>. The default is <ttclass="literal"><spanclass="pre">Value&</span></tt>.</p>
<p>The <ttclass="literal"><spanclass="pre">Access</span></tt> and <ttclass="literal"><spanclass="pre">Traversal</span></tt> parameters are passed
unchanged to the corresponding parameters of the
<ttclass="literal"><spanclass="pre">iterator_adaptor</span></tt> base class, and the <ttclass="literal"><spanclass="pre">Iterator</span></tt> parameter
is passed unchanged as the <ttclass="literal"><spanclass="pre">Base</span></tt> parameter to the
<ttclass="literal"><spanclass="pre">iterator_adaptor</span></tt> base class.</p>
</blockquote>
<p>to:</p>
<blockquoteclass="last">
<blockquote>
The expression <ttclass="literal"><spanclass="pre">*v</span></tt>, where <ttclass="literal"><spanclass="pre">v</span></tt> is an object of
<ttclass="literal"><spanclass="pre">iterator_traits<Iterator>::value_type</span></tt>, shall be valid
expression and convertible to <ttclass="literal"><spanclass="pre">reference</span></tt>. <ttclass="literal"><spanclass="pre">Iterator</span></tt>
shall model the traversal concept indicated by
<ttclass="literal"><spanclass="pre">iterator_category</span></tt>. <ttclass="literal"><spanclass="pre">Value</span></tt>, <ttclass="literal"><spanclass="pre">Reference</span></tt>, and
<ttclass="literal"><spanclass="pre">Difference</span></tt> shall be chosen so that <ttclass="literal"><spanclass="pre">value_type</span></tt>,
<ttclass="literal"><spanclass="pre">reference</span></tt>, and <ttclass="literal"><spanclass="pre">difference_type</span></tt> meet the requirements
indicated by <ttclass="literal"><spanclass="pre">iterator_category</span></tt>.</blockquote>
<p>[Note: there are further requirements on the
<ttclass="literal"><spanclass="pre">iterator_traits<Iterator>::value_type</span></tt> if the <ttclass="literal"><spanclass="pre">Value</span></tt>
parameter is not <ttclass="literal"><spanclass="pre">use_default</span></tt>, as implied by the algorithm
for deducing the default for the <ttclass="literal"><spanclass="pre">value_type</span></tt> member.]</p>
</blockquote>
</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body">Not included above is the specification of the
<ttclass="literal"><spanclass="pre">value_type</span></tt>, <ttclass="literal"><spanclass="pre">reference</span></tt>, etc., members, which is handled by
<p>If <ttclass="literal"><spanclass="pre">Reference</span></tt> is <ttclass="literal"><spanclass="pre">use_default</span></tt> then the <ttclass="literal"><spanclass="pre">reference</span></tt>
member of <ttclass="literal"><spanclass="pre">transform_iterator</span></tt> is <ttclass="literal"><spanclass="pre">result_of<</span>
<spanclass="pre">>::type</span></tt>. Otherwise, <ttclass="literal"><spanclass="pre">reference</span></tt> is <ttclass="literal"><spanclass="pre">Reference</span></tt>.</p>
<p>If <ttclass="literal"><spanclass="pre">Value</span></tt> is <ttclass="literal"><spanclass="pre">use_default</span></tt> then the <ttclass="literal"><spanclass="pre">value_type</span></tt>
member is <ttclass="literal"><spanclass="pre">remove_cv<remove_reference<reference></span><spanclass="pre">>::type</span></tt>.
Otherwise, <ttclass="literal"><spanclass="pre">value_type</span></tt> is <ttclass="literal"><spanclass="pre">Value</span></tt>.</p>
<h2><aclass="toc-backref"href="#id45"name="x-transform-iterator-interoperability-too-restrictive">9.43x transform_iterator interoperability too restrictive</a></h2>
<h2><aclass="toc-backref"href="#id46"name="y-indirect-iterator-and-smart-pointers">9.44y <ttclass="literal"><spanclass="pre">indirect_iterator</span></tt> and smart pointers</a></h2>
<tr><td> </td><tdclass="field-body"><pclass="first">Add <ttclass="literal"><spanclass="pre">pointee</span></tt> and <ttclass="literal"><spanclass="pre">indirect_reference</span></tt>
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<preclass="literal-block">
template <class Dereferenceable>
struct pointee
{
typedef /* see below */ type;
};
</pre>
<tableclass="field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Requires:</th><tdclass="field-body">For an object <ttclass="literal"><spanclass="pre">x</span></tt> of type <ttclass="literal"><spanclass="pre">Dereferenceable</span></tt>, <ttclass="literal"><spanclass="pre">*x</span></tt>
is well-formed. If <ttclass="literal"><spanclass="pre">++x</span></tt> is ill-formed it shall neither be
ambiguous nor shall it violate access control, and
<ttclass="literal"><spanclass="pre">Dereferenceable::element_type</span></tt> shall be an accessible type.
<!-- Copyright David Abrahams 2004. Use, modification and distribution is -->
<!-- subject to the Boost Software License, Version 1.0. (See accompanying -->
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
<preclass="literal-block">
template <class Dereferenceable>
struct indirect_reference
{
typedef /* see below */ type;
};
</pre>
<tableclass="field-list"frame="void"rules="none">
<colclass="field-name"/>
<colclass="field-body"/>
<tbodyvalign="top">
<trclass="field"><thclass="field-name">Requires:</th><tdclass="field-body">For an object <ttclass="literal"><spanclass="pre">x</span></tt> of type <ttclass="literal"><spanclass="pre">Dereferenceable</span></tt>, <ttclass="literal"><spanclass="pre">*x</span></tt>
is well-formed. If <ttclass="literal"><spanclass="pre">++x</span></tt> is ill-formed it shall neither be
ambiguous nor shall it violate access control, and
<ttclass="literal"><spanclass="pre">pointee<Dereferenceable>::type&</span></tt> shall be well-formed.
<h2><aclass="toc-backref"href="#id47"name="y-n1530-typos-and-editorial-changes-in-proposal-text-not-standardese">9.45y N1530: Typos and editorial changes in proposal text (not standardese)</a></h2>
<tr><td> </td><tdclass="field-body"><pclass="first">From n1530, in the <strong>Specialized Adaptors</strong> section, remove:</p>
<blockquoteclass="last">
<ttclass="literal"><spanclass="pre">projection_iterator</span></tt>, which is similar to <ttclass="literal"><spanclass="pre">transform_iterator</span></tt>
except that when dereferenced it returns a reference instead of
a value.</blockquote>
</td>
</tr>
<trclass="field"><thclass="field-name">Rationale:</th><tdclass="field-body">This iterator was in the original boost library, but the new
iterator concepts allowed this iterator to be
folded into <ttclass="literal"><spanclass="pre">transform_iterator</span></tt>.</td>
<dd>Iterator facade uses the Curiously Recurring Template Pattern (CRTP)
[Cop95] so that the user can specify the behavior of
<ttclass="literal"><spanclass="pre">iterator_facade</span></tt> in a derived class. Former designs used policy
objects to specify the behavior. <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> does not use policy
objects for several reasons:</dd>
<dt>to:</dt>
<dd>Iterator facade uses the Curiously Recurring Template
Pattern (CRTP) [Cop95] so that the user can specify the behavior
of <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> in a derived class. Former designs used
policy objects to specify the behavior, but that approach was
discarded for several reasons:</dd>
<dt>Change:</dt>
<dd>iterator's <ttclass="literal"><spanclass="pre">operator++</span></tt> returns the iterator type itself means
that all iterators generated by <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> would be
instantiations of <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>. Cumbersome type generator</dd>
<dt>to:</dt>
<dd>iterator's <ttclass="literal"><spanclass="pre">operator++</span></tt> returns the iterator type itself
would mean that all iterators built with the library would
have to be specializations of <ttclass="literal"><spanclass="pre">iterator_facade<...></span></tt>, rather
than something more descriptive like
<ttclass="literal"><spanclass="pre">indirect_iterator<T*></span></tt>. Cumbersome type generator</dd>
<dt>Change:</dt>
<dd>The return type for <ttclass="literal"><spanclass="pre">operator-></span></tt> and <ttclass="literal"><spanclass="pre">operator[]</span></tt> is not
explicitly specified. Instead it requires each <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>
instantiation to meet the requirements of its <ttclass="literal"><spanclass="pre">iterator_category</span></tt>.</dd>
<dt>To:</dt>
<dd>The return types for <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>'s <ttclass="literal"><spanclass="pre">operator-></span></tt> and
<ttclass="literal"><spanclass="pre">operator[]</span></tt> are not explicitly specified. Instead, those types
are described in terms of a set of requirements, which must be
satisfied by the <ttclass="literal"><spanclass="pre">iterator_facade</span></tt> implementation.</dd>
<h2><aclass="toc-backref"href="#id51"name="x-clarification-of-iterator-facade-requirements-and-type-members">9.49x Clarification of iterator_facade requirements and type members</a></h2>
<p>A general cleanup and simplification of the requirements and
description of type members for <ttclass="literal"><spanclass="pre">iterator_facade</span></tt>.</p>
<p>The user is only allowed to add <ttclass="literal"><spanclass="pre">const</span></tt> as a qualifier.</p>
<p>We use to have an unspecified type for <ttclass="literal"><spanclass="pre">pointer</span></tt>, to match the
return type of <ttclass="literal"><spanclass="pre">operator-></span></tt>, but there's no real reason to make them
match, so we just use the simpler <ttclass="literal"><spanclass="pre">Value*</span></tt> for <ttclass="literal"><spanclass="pre">pointer</span></tt>.</p>
<dd>The following table describes the other requirements on the
<ttclass="literal"><spanclass="pre">Derived</span></tt> parameter. Depending on the resulting iterator's
<ttclass="literal"><spanclass="pre">iterator_category</span></tt>, a subset of the expressions listed in the table
are required to be valid. The operations in the first column must be
accessible to member functions of class <ttclass="literal"><spanclass="pre">iterator_core_access</span></tt>.</dd>
<dt>to:</dt>
<dd>The following table describes the typical valid expressions on
<ttclass="literal"><spanclass="pre">iterator_facade</span></tt>'s <ttclass="literal"><spanclass="pre">Derived</span></tt> parameter, depending on the
iterator concept(s) it will model. The operations in the first
column must be made accessible to member functions of class
<ttclass="literal"><spanclass="pre">iterator_core_access</span></tt>. In addition,
<ttclass="literal"><spanclass="pre">static_cast<Derived*>(iterator_facade*)</span></tt> shall be well-formed.</dd>
<dt>Remove:</dt>
<dd><pclass="first">The nested <ttclass="literal"><spanclass="pre">::value_type</span></tt> type will be the same as
<ttclass="literal"><spanclass="pre">remove_cv<Value>::type</span></tt>, so the <ttclass="literal"><spanclass="pre">Value</span></tt> parameter must be
an (optionally <ttclass="literal"><spanclass="pre">const</span></tt>-qualified) non-reference type.</p>
<pclass="last">The nested <ttclass="literal"><spanclass="pre">::reference</span></tt> will be the same as the <ttclass="literal"><spanclass="pre">Reference</span></tt>
parameter; it must be a suitable reference type for the resulting
iterator. The default for the <ttclass="literal"><spanclass="pre">Reference</span></tt> parameter is
<p>In the table below, <ttclass="literal"><spanclass="pre">X</span></tt> is the derived iterator type, <ttclass="literal"><spanclass="pre">a</span></tt> is an
object of type <ttclass="literal"><spanclass="pre">X</span></tt>, <ttclass="literal"><spanclass="pre">b</span></tt> and <ttclass="literal"><spanclass="pre">c</span></tt> are objects of type <ttclass="literal"><spanclass="pre">const</span><spanclass="pre">X</span></tt>,
<ttclass="literal"><spanclass="pre">n</span></tt> is an object of <ttclass="literal"><spanclass="pre">X::difference_type</span></tt>, <ttclass="literal"><spanclass="pre">y</span></tt> is a constant
object of a single pass iterator type interoperable with X, and <ttclass="literal"><spanclass="pre">z</span></tt>
is a constant object of a random access traversal iterator type
interoperable with <ttclass="literal"><spanclass="pre">X</span></tt>.</p>
<spanclass="pre"><=</span><spanclass="pre">z</span></tt>, <ttclass="literal"><spanclass="pre">c</span><spanclass="pre">></span><spanclass="pre">z</span></tt>, and <ttclass="literal"><spanclass="pre">c</span><spanclass="pre">>=</span><spanclass="pre">c</span></tt>.</td>
<td>Random Access Traversal
Iterator</td>
</tr>
</tbody>
</table>
</blockquote>
<p>to:</p>
<blockquote>
<p>In the table below, <ttclass="literal"><spanclass="pre">F</span></tt> is <ttclass="literal"><spanclass="pre">iterator_facade<X,V,C,R,D></span></tt>, <ttclass="literal"><spanclass="pre">a</span></tt> is an
object of type <ttclass="literal"><spanclass="pre">X</span></tt>, <ttclass="literal"><spanclass="pre">b</span></tt> and <ttclass="literal"><spanclass="pre">c</span></tt> are objects of type <ttclass="literal"><spanclass="pre">const</span><spanclass="pre">X</span></tt>,
<ttclass="literal"><spanclass="pre">n</span></tt> is an object of <ttclass="literal"><spanclass="pre">F::difference_type</span></tt>, <ttclass="literal"><spanclass="pre">y</span></tt> is a constant
object of a single pass iterator type interoperable with <ttclass="literal"><spanclass="pre">X</span></tt>, and <ttclass="literal"><spanclass="pre">z</span></tt>
is a constant object of a random access traversal iterator type
interoperable with <ttclass="literal"><spanclass="pre">X</span></tt>.</p>
Generated by <aclass="reference"href="http://docutils.sourceforge.net/">Docutils</a> from <aclass="reference"href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.