Abdelrazak Younes wrote:

>> Well it is supposed to be const_iterator semantics... You can get one
>> from a const container, but dereferencing it gives you a const element
>> reference.
> 
> I got that but the two iterators don't seem to iterate identically,
> might just be a bad 'tainted' impression ;-)

Must be... both should use DocIterator::forwardPar, no?

>> I agree. But note that the point here is that there may be some uses of a
>> real iterator (you can use generic algorithms). Dunno if this is really
>> used in the code though.
> 
> Stl algorithms do not work well with those IIRC.

Details? Incidentally, one of the first things I've done with the "new"
iterators was to use boost::regexp to make regexp searches in lyx documents
(A kind of predecessor of DocIterator was called PosIterator and ++
iterated over cursor positions)... it sort of worked (meaning that it
worked but wasn't ready for prime time due to limitations with selection &
co) :-) 

In any case, maybe it's ok to remove them if this feature is not used in the
code. Let's see the patch ;-) If needed later, maybe one could devise some
template solution that doesn't involve iterator copies. 

A/


Reply via email to