|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-06-13 00:17:58
> > The reason for this hack is that neither the library shipping with
> > gcc nor the library shipping with MSVC++ provide a usable version of
> > 'std::iterator'. Thus, this code defines a 'boost::iterator' which does
> > something suitable... Of course, the if/defs need to be extended to
> > cover more compilers (my preferred solution to *this* problem would be
> > the use of autoconf but I think we were through this and rejected
> > autoconf mainly because most people didn't like it, if I remember
> > correctly...).
Will this work right for VC6.3 using the next release of STLport? AFAIK, the
only way to get an iterator_category for a user-defined iterator without
partial specialization is through the old HP-style use of overloading, and
you need some kind of public derivation to go through. Thus, the next
STLport will include something like this:
template <class _Category, class _Value, class _Distance, class _Ptr, class
_Reference>
inline _Category __STL_CALL
__iterator_category(iterator<_Category,_Value,_Distance,_Ptr,_Reference>)
{ return _Category(); }
This makes public derivation from std::iterator essential for user-defined
iterator types. Just don't wreck that, and I'll be happy ;)
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk