Fixed is-writable computation. Traits protocol still needs fixing.

[SVN r20398]
This commit is contained in:
Dave Abrahams
2003-10-16 13:57:35 +00:00
parent 1c39976ccd
commit 17026cc30d

View File

@ -6,9 +6,10 @@
:Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@acm.org :Contact: dave@boost-consulting.com, jsiek@osl.iu.edu, witt@acm.org
:organization: `Boost Consulting`_, Indiana University `Open Systems Lab`_, University of Hanover `Institute for Transport Railway Operation and Construction`_ :organization: `Boost Consulting`_, Indiana University `Open Systems Lab`_, University of Hanover `Institute for Transport Railway Operation and Construction`_
:date: $Date$ :date: $Date$
:Number: N1531=03-0114 :Number: revised from `N1531=03-0114`__
:copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved :copyright: Copyright David Abrahams, Jeremy Siek, and Thomas Witt 2003. All rights reserved
.. __: n1531_
.. _`Boost Consulting`: http://www.boost-consulting.com .. _`Boost Consulting`: http://www.boost-consulting.com
.. _`Open Systems Lab`: http://www.osl.iu.edu .. _`Open Systems Lab`: http://www.osl.iu.edu
.. _`Institute for Transport Railway Operation and Construction`: http://www.ive.uni-hannover.de .. _`Institute for Transport Railway Operation and Construction`: http://www.ive.uni-hannover.de
@ -18,12 +19,13 @@
concepts to more closely match the requirements concepts to more closely match the requirements
of algorithms and provides better categorizations of algorithms and provides better categorizations
of iterators that are used in practice. This proposal of iterators that are used in practice. This proposal
is a revision of paper n1297_ and n1477_. is a revision of paper n1297_, n1477_, and n1531_.
.. contents:: Table of Contents .. contents:: Table of Contents
.. _n1297: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1297.html .. _n1297: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1297.html
.. _n1477: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1477.html .. _n1477: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1477.html
.. _n1531: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1531.html
============ ============
Motivation Motivation
@ -739,8 +741,12 @@ deduced. The following pseudo-code describes the algorithm.
cat = iterator_traits<Iterator>::iterator_category; cat = iterator_traits<Iterator>::iterator_category;
if (cat == iterator_tag<Access,Traversal>) if (cat == iterator_tag<Access,Traversal>)
return Access & writable_iterator; return Access & writable_iterator;
else if (cat is convertible to forward_iterator_tag else if (cat is convertible to output_iterator_tag)
or output_iterator_tag) return true;
else if (
cat is convertible to forward_iterator_tag
and iterator_traits<Iterator>::reference is a
mutable reference)
return true; return true;
else else
return false; return false;