small change to iterator_tag body

[SVN r20154]
This commit is contained in:
Jeremy Siek
2003-09-22 15:55:22 +00:00
parent 9ac583096c
commit 5efcabf3bd
2 changed files with 17 additions and 9 deletions

View File

@ -807,9 +807,9 @@ template <class Iterator> struct traversal_category;
enum iterator_access { readable_iterator = 1, writable_iterator = 2,
swappable_iterator = 4, lvalue_iterator = 8 };
template <iterator_access x, class TraversalTag>
template <unsigned int access_bits, class TraversalTag>
struct iterator_tag : /* appropriate old category or categories */ {
static const iterator_access access = x;
static const iterator_access access = (iterator_access)access_bits;
typedef TraversalTag traversal;
};
@ -860,8 +860,12 @@ inherit-category(access, traversal-tag) =
else
return null_category_tag;
</pre>
<p>If the argument for <tt class="literal"><span class="pre">TraversalTag</span></tt> is not convertible to
<tt class="literal"><span class="pre">incrementable_iterator_tag</span></tt> then the programm is ill-formed.</p>
<p>The access argument is declared to be <tt class="literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt> instead of the
enum <tt class="literal"><span class="pre">iterator_access</span></tt> for convenience of use. For example, the
expression <tt class="literal"><span class="pre">(readable_iterator</span> <span class="pre">|</span> <span class="pre">writable_iterator)</span></tt> produces an
unsigned int, not <tt class="literal"><span class="pre">iterator_access</span></tt>. If the argument for
<tt class="literal"><span class="pre">TraversalTag</span></tt> is not convertible to <tt class="literal"><span class="pre">incrementable_iterator_tag</span></tt>
then the programm is ill-formed.</p>
<p>The <tt class="literal"><span class="pre">is_readable</span></tt>, <tt class="literal"><span class="pre">is_writable</span></tt>, <tt class="literal"><span class="pre">is_swappable</span></tt>, and
<tt class="literal"><span class="pre">traversal_category</span></tt> class templates are traits classes. For
iterators whose <tt class="literal"><span class="pre">iterator_traits&lt;Iter&gt;::iterator_category</span></tt> type is

View File

@ -642,9 +642,9 @@ Addition to [lib.iterator.synopsis]
enum iterator_access { readable_iterator = 1, writable_iterator = 2,
swappable_iterator = 4, lvalue_iterator = 8 };
template <iterator_access x, class TraversalTag>
template <unsigned int access_bits, class TraversalTag>
struct iterator_tag : /* appropriate old category or categories */ {
static const iterator_access access = x;
static const iterator_access access = (iterator_access)access_bits;
typedef TraversalTag traversal;
};
@ -696,9 +696,13 @@ pseudo-code.
return output_iterator_tag;
else
return null_category_tag;
If the argument for ``TraversalTag`` is not convertible to
``incrementable_iterator_tag`` then the programm is ill-formed.
The access argument is declared to be ``unsigned int`` instead of the
enum ``iterator_access`` for convenience of use. For example, the
expression ``(readable_iterator | writable_iterator)`` produces an
unsigned int, not ``iterator_access``. If the argument for
``TraversalTag`` is not convertible to ``incrementable_iterator_tag``
then the programm is ill-formed.
The ``is_readable``, ``is_writable``, ``is_swappable``, and
``traversal_category`` class templates are traits classes. For