[C++-sig] Re: bad iterator related warning - Solved

David Abrahams dave at boost-consulting.com
Sat Nov 1 07:17:56 CET 2003

Nikolay Mladenov <nickm at sitius.com> writes:

> I specified void as reference type of the std::iterator and it worked.
> I guess this kind of iterators shouldn't really use the default template
> params anyway. 

I have a strong suspicion that the resulting lack of a warning is a
fluke.  You shouldn't try to build your own iterators by hand; it's
too error prone.  Like every other hand-written iterator I've seen
posted to a NG or mailing list, your iterator doesn't conform (it's
missing operator->).  Consider using the boost iterator_facade
template instead.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list