Const iterators, what's next ?

Cyrille Berger cberger at cberger.net
Thu Oct 19 09:36:01 CEST 2006


On Thursday 19 October 2006 08:05, Boudewijn Rempt wrote:
> I would prefer distinguishing the factory methods for iterators iterators
> by name, not just by their intrinsic constness: much easier to read.
>
> As for the parameters of the filters: I tried ditching dst (since having a
> dst without a src doesn't make sense) but failed. I have forgotten why,
> though. Just one thought: wouldn't it make more sense to have an iterator
> as a parameter instead of a whole paint device? More c-plusplussy? Of
> course, that would mean that all iterators need to be constrained to a
> rect, not just the rect iterators. I'm not sure that this is a good idea,
> but there must be a reason stl doesn't pass the whole array & a range but
> iterators instead to its algorithms.
There is one reason: there algoritms are conceive to work for whatever 
iterators you can imagine, either those of the STL or anyother, our iterators 
are close to be usuable in the std::sort function, for instance.
In the other hand, most of our algorithms are designed to do a precise task on 
a paint device. To do this task, they select the iterator that's best suit 
their need. That's why we pass KisPaintDevice and not iterators.

-- 
--- Cyrille Berger ---


More information about the kimageshop mailing list