HI,
I'm using the boost iterator_facade class to implement a random
access iterator for my class. When I try to assign the iterators to
one another, the compiler fails saying
'operator
=' function is unavailable".
Sample code from my implementation below:
class MyClass{
class Iterator : public boost::iterator_facade<Iterator,
T, boost::bidirectional_traversal_tag>{ protected:
void increment();
bool equal(const Iterator& rhs)const; //etc
//... Note - no method implemented to support assignment
}
}
I'd assumed that it'll be possible to assign iterators to each
other. Why is the assignment operator not supported by
iterator_facade. It implements other operations (like ++ and ==)by
making the derived version implement private methods (like increment
and equal). Am I missing something. The boost documentation doesn't
mention why this is not supported.
Thanks
AR