Andre Poenitz <[EMAIL PROTECTED]> writes: | On Wed, Aug 14, 2002 at 05:45:17PM +0200, Lars Gullik Bjønnes wrote: | > I'll continue to feed parts of this into CVS proper. | | Looks good. | | A question: | | if (!locked) { | - Paragraph * p = &*(paragraphs.begin()); | - while (p->next()) | - p = p->next(); | + Paragraph * p = &*(boost::prior(paragraphs.end()));
and this is buggy now so it has to change. (where did you find it?) | lt->setCursor(bv, p, p->size()); | } | | | Coulnd't that be solved by having a back() method on ParagraphsList? Actually I like it solved by either: Paragraph * p = &*boost::prior(paragraphs.end()); (the ParagraphList::iterator for end is too dumb for this) or Paragraph * p = ¶graphs.back(); (easy to add, but will be O(n) until we move to a real STL container) depending on whether p should be changed to a iterator or a reference later. -- Lgb