Re: [gtkmm] A const_iterator for TreeModel?



On Sun, 2004-02-29 at 13:49, Carl Nygard wrote:
> On Sun, 2004-02-29 at 09:39, Murray Cumming wrote:
> > So, for now I will leave TreeModel as crippled as stl::list and co - I
> > will just use iterator in the methods and never const_iterator. Maybe we
> > can change that later. The const_iterator would still be as useful for
> > TreeModel as it is for stl::list.
> >  
> 
> The principle of least surprise is a good principle to follow.  I'd be
> more concerned with how the TreeModel iterators interact with standard
> algorithms than with TreeModel function signatures, I think.  For
> example, could I pass to iterators to sort() and expect something
> reasonable to happen?  I'm guessing not,

Actually, I think that they would. I guess that sort() just does generic
comparisons and swaps, so it should work. We try to make gtkmm iterators
and containers work like the STL, so STL algorithms should work on them.

>  so I'll amend my previous
> statement to making sure the TreeModel iterators can't be used with
> algorithms that don't/can't work.

-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




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