Re: ParIterator::operator==

2020-11-08 Thread Yuriy Skalko
I'm happy to have someone commit a new version. Mostly, I was just surprised by the comment. It seemed like there must be some way to compare these as DocIterators without doing a copy. So it turns out there are many! Riki I've committed it. Also commented out it, as was suggested by Jean-Marc.

Re: ParIterator::operator==

2020-11-08 Thread Richard Kimberly Heck
On 11/8/20 3:57 AM, Yuriy Skalko wrote: >> Isn't there a way with a xxx_cast too ? (maybe reinterpret_cast<> ?) >> >> JMarc > > Yes, here is another one with casting: > > bool operator==(ParConstIterator const & iter1, ParConstIterator const > & iter2) > { > return static_cast(iter1) == > stati

Re: ParIterator::operator==

2020-11-08 Thread Yuriy Skalko
Isn't there a way with a xxx_cast too ? (maybe reinterpret_cast<> ?) JMarc Yes, here is another one with casting: bool operator==(ParConstIterator const & iter1, ParConstIterator const & iter2) { return static_cast(iter1) == static_cast(iter2); } Yuriy -- lyx-devel mailing list lyx-devel

Re: ParIterator::operator==

2020-11-07 Thread Jean-Marc Lasgouttes
Le 07/11/2020 à 15:55, Yuriy Skalko a écrit : I'm not a C++ guru, but seems like nothing wrong with this code assuming Dociterator's operator== is right. It can be further simplified to this: bool operator==(ParConstIterator const & iter1, ParConstIterator const & iter2) { DocIterator c

Re: ParIterator::operator==

2020-11-07 Thread Yuriy Skalko
This method is commented out ostensibly because the current implementation bool operator==(ParConstIterator const & iter1, ParConstIterator const & iter2) { // FIXME: this makes two full copies! return DocIterator(iter1) == DocIterator(iter2); } made two copies, so was expensive. But w

Re: ParIterator::operator==

2020-11-06 Thread Richard Kimberly Heck
On 11/6/20 7:37 PM, Jean-Marc Lasgouttes wrote: > Le 06/11/2020 à 17:29, Richard Kimberly Heck a écrit : >> This method is commented out ostensibly because the current >> implementation >> >> bool operator==(ParConstIterator const & iter1, ParConstIterator >> const & iter2) >> { >> // FIXME: t

Re: ParIterator::operator==

2020-11-06 Thread Richard Kimberly Heck
On 11/6/20 7:37 PM, Jean-Marc Lasgouttes wrote: > Le 06/11/2020 à 17:29, Richard Kimberly Heck a écrit : >> This method is commented out ostensibly because the current >> implementation >> >> bool operator==(ParConstIterator const & iter1, ParConstIterator >> const & iter2) >> { >> // FIXME: t

Re: ParIterator::operator==

2020-11-06 Thread Jean-Marc Lasgouttes
Le 06/11/2020 à 17:29, Richard Kimberly Heck a écrit : This method is commented out ostensibly because the current implementation bool operator==(ParConstIterator const & iter1, ParConstIterator const & iter2) {     // FIXME: this makes two full copies!     return DocIterator(iter1) == DocIt

Re: ParIterator::operator*()

2003-06-11 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes: | ... should yield a Paragraph &, not a ParagraphList::iterator. | | Patch attached. | | Lars? Yea... ok. -- Lgb