Re: [gtkmm] A const_iterator for TreeModel?



> Take a look at Item 26 in Scott Meyer's Effective STL.  He says that
> there is an implicit conversion from iterator to const_iterator
> --- but not the other way around!.

Interesting. I had tried that with std::list_iterator and const_iterator,
without success. Could someone else try as well please.

>  You have to use the base() method on
> the reverse iterators to get to iterators.

Thanks. I didn't know that. Is that something that people are used to
using, or is it an obscure part of the implementation?

> So, you should be able to write a definitive const_iterator method,
> and then have the other three call the const_iterator method
> with the appropriate implicit or explicit conversion.

If there is _an_ implicit conversion then we should not need the other
method overloads.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]