|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-03-19 17:46:51
A little while back I posted about what an improved set of iterator
concepts and traits would look like, specifically, to solve the problem of
iterator category and dereference return type semantics being tied into
the same hierarchy.
http://groups.yahoo.com/group/boost/message/7832?source=1
While working on the iterator adaptor library, it has become even more
apparent to me that the current state of affairs is not acceptable and we
need a solution sooner than later. For example, there are important
classes of iterators that you currently can not build with
iterator_adaptor, like random-access iterators that don't return true
reference types.
As a result, I've coded up a new iterator_traits class that replaces the
iterator_category with traversal_category and return_category.
An important characteristic of this new iterator_traits class is that it
is BACKWARD COMPATIBLE, meaning that any iterator for which there is a
valid std::iterator_traits defined, will also automatically have a valid
boost::iterator_traits defined.
I've checked the code and docs into CVS, development/iterator/.
It currently works with g++, KCC, and VC++, but not Borland.
A next step would be to provide alternate implementations of the standard
algorithms using the new iterator traits.
What do you all think, is this worth while? What your reaction to
the new iterator_traits class?
Cheers,
Jeremy
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk