
"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
"David Abrahams" <dave@boost-consulting.com> wrote in message news:u3brjtxrc.fsf@boost-consulting.com... | Jonathan Wakely <cow@compsoc.man.ac.uk> writes:
| > But the container requirements require that X::iterator be convertible | > to X::const_iterator, and then all those operations work by using that | > conversion. | | That's incorrect. For example, if the operations are templated no | implicit conversion will take place.
would it be correct to implement the binary operators in my "wrapping" iterators as function templates.
It would be correct to use iterator_adaptor. Why aren't you doing that?
template< class VoidIter, class VoidIter2 > inline bool operator==( const iter<VoidIter>& l, const iter<VoidIter2>& r ) { return l.base() == r.base(); }
?
Sure, but you might want to use disable_if to prevent overeager matching. Of course the iterators library will take care of this for you. -- Dave Abrahams Boost Consulting www.boost-consulting.com