Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-03-20 15:35:15


On Tue, 20 Mar 2001, Steven Kirk wrote:
steven> > A next step would be to provide alternate implementations of the standard
steven> > algorithms using the new iterator traits.
steven> >
steven> This sounds a little ambitious :-/ Why is this necessary?

Currently many of the std algorithms put stronger requirements than
necessary on the iterators. For example, std::sort() requires that the
iterators be random access iterators, which means that the iterator's
reference type must be a true reference. However, in the implementations
I've used this requirement is not necessary. Using my proposed iterator
concepts, you could get a closer fit to the real requirements, and thereby
make std::sort() usable in more situations.

Hmm... I'm thinking we also need a Swappable concept.

For the most part the algorithms would stay the same. The main change
would be to use boost::iterator_traits<Iter>::traversal_category instead
of std::iterator_traits<Iter>::iterator_category to do the dispatching.

Also, not all algorithms would need to be changed... and of course we
don't have to do it all at once.

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