Jean-Marc Lasgouttes a écrit :
What I had in mind was to apply it to trunk as soon as Lars accepts it
and then, if nothing bad appears, apply it for 1.4.2.
Fine with me.
Neverthless, I am still not convinced that the inner list container is
useful. Since you have a vector<Paragraph*> already holding the data,
why bother having a second data structure?
I think a vector of pointers solution would indeed solve a lot of the same problems but I don't think you would gain anything in terms of code size and simplicity. I would even say the contrary.

Beside, here is some advantages of having a list compared to a vector of pointer solution. 1) A list is ordered: one paragraph after the other. And we inherit list::iterator properties.
2) Multiple paragraphs insertion and deletion can be optimized
3) You don't have to do any memory management (no new, no delete)

The only advantage I can think of for the vector of pointers solution is that

 vector.insert(pos, new Paragraph(par))

should be a bit faster than:

 list.insert(par)

Abdel.

Reply via email to