Re: [Boost-bugs] [Boost C++ Libraries] #2669: Boost 1.37 breaks spirit iterator differencing

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2669: Boost 1.37 breaks spirit iterator differencing
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-01-21 15:31:09


#2669: Boost 1.37 breaks spirit iterator differencing
--------------------------------------------+-------------------------------
  Reporter: S Roderick <kiwi.net_at_[hidden]> | Owner: djowel
      Type: Bugs | Status: new
 Milestone: Boost 1.38.0 | Component: spirit
   Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------------+-------------------------------

Comment(by danieljames):

 `position_iterator` was always meant to be a forward iterator and only had
 a difference operator by mistake, which didn't work in many cases (I've
 just attached an example which gives an incorrect result with boost 1.35,
 operator- also gives incorrect results if the string contains windows
 newlines). There are two possible fixes: the safe, but slow way, is to use
 std::difference, or if you're sure that both iterators contain a valid
 iterator (they haven't been default constructed, and have been constructed
 with an iterator from the same container) then you can access the
 underlying iterator using the `base` method - `end.base() - begin.base()`.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2669#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC