Alfredo Braunstein wrote: > Angus Leeming wrote: > >> Of course, having a centralised dispatch should make it quite easy >> to keep your PosIteratorItem valid. Why not add something to the >> block that Andr� uses to keep Cursor valid and see whether that can >> be made to work? > > In which situations you think we need it to remain valid? > I don't understand very well how the centralized dispatch can help > in this respect. Hum, and which block exactly? > > In my opinion, there are not many advantages of PosIterator against > Cursor except perhaps for inmediate availability and speed. But > Andr� plans to switch to ParagraphList::iterator instead of offsets > if performance hurts IIUC, so this only leaves the former. > > So if operator++ and operator-- and a bit of other simpler goodies > get implemented soonish in Cursor (Andr�?), I think we can ditch > PosIterator and I can go back to fix s&r using Cursor. *Or* :-) I > cannot wait and fix it with PosIterator and then we can switch later > to Cursor (as the interface will be similar I imagine). > > Regards, Alfredo
IMO, we should separate the concept of 'iterator' from that of 'cursor'. I believe that this is Andr�'s view too. (Witness his occassional comments that the math cursor is a hack.) Implement the cursor using the position iterator, by all means, but enable search and replace to create its own position iterator as and when it needs it. -- Angus
