stl_iterator.h: class iterator ?

Jens Maurer
Wed Jan 20 13:18:00 GMT 1999


while implementing my own iterators, I noticed the
following code in stl_iterator.h (included from <iterator>)
(libstdc++ from egcs-1.1.1 release)

template <class Category, class T, class Distance = ptrdiff_t,
          class Pointer = T*, class Reference = T&>
struct iterator {
  typedef Category  iterator_category;
  typedef T         value_type;
  typedef Distance  difference_type;
  typedef Pointer   pointer;
  typedef Reference reference;
#endif /* __STL_USE_NAMESPACES */

I think the #ifdef / #endif around this class definition
is bogus and should be removed. I did that locally and
no evident damage has emerged so far.

Jens Maurer.

More information about the Gcc-bugs mailing list