BZDEV: iterator_traits

From: Ali Rahimi (rahimi@media.mit.edu)
Date: Thu Feb 03 2000 - 05:22:01 EST


Hi.

I was wondering if you could define iterator_traits for the Array<>::iterator
class so the STL iterator algorithms could be used on array's.

I think all that needs to be done (by that I mean I get good mileage out
of this) is for ConstArrayIterator<> to define:

typedef int difference_type;
typedef T value_type;
typedef const T* pointer;
typedef const T& reference;
typedef forward_iterator_tag iterator_category;

and additionally, ArrayIterator<>:

typedef const T* pointer;
typedef const T& reference;
                

Have you considered deriving the slow iterators from std::iterator?

 Ali.

--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/blitz/lists.html



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:11 EST