Angus Leeming a écrit :
Ah... This is because I didn't go to the full monty... I forgot to erase those three lines:
-               advance(first, first_pit);
-               ParagraphList::const_iterator last = plist.begin();
-               advance(last, last_pit + 1);

It is better now, isn't it?

I think so, but if last_pit is a ParagraphList::iterator which won't necessarily
model a Random Access Iterator in the future, you should probably use
    undo.pars = ParagraphList(plist, first_pit, boost::next(last_pit));

In this case, first_pit and last_pit are positions in the ParagraphList plist. But I can also provide a ParagraphList constructor that will accept iterators "a la STL".

One thing I'm less keen on in your code is your use of multiple typedefs
in the ParagraphList to mean the same thing
If I knew I would have had that kind of comments I would have cleaned up the patch before sending it This was just proof of concept but this is not a reason, I know...

<splutter>But you asked me to review your code</splutter>

I am not quite sure of the meaning of "splutter" but I was kidding (did I forgot the smiley). Your comments are of course very welcome.

Thanks,
Abdel.

Keep up the good work.

Angus





Reply via email to