Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2640: counting_iterator::reference lifetime tied to iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-14 16:50:51
#2640: counting_iterator::reference lifetime tied to iterator
---------------------------+------------------------------------------------
Reporter: schoedl | Owner: dave
Type: Bugs | Status: new
Milestone: Boost 1.38.0 | Component: iterator
Version: Boost 1.37.0 | Severity: Problem
Resolution: | Keywords: counting_iterator reverse_iterator
---------------------------+------------------------------------------------
Comment (by dave):
The history of iterators that own the object they reference is somewhat
complicated. {{{counting_iterator}}} does own its referent. To be a
valid forward iterator, its reference type must be a true C++ reference.
Otherwise, it would be limited to input iterator. Trying to accomodate
forward iterators that store their referent caused innumerable contortions
in the design of this library.
However, recent re-readings of the C++03 standard make it clear to me that
such iterators are not allowed to be forward iterators anyway. In
particular, below table 74 it says:
> â If a and b are both dereferenceable, then a == b if and only if *a and
*b are the same object.
So IMO, the library design needs to be revisited in terms of this new
understanding. I don't want to address it piecemeal, because anything we
do will break someone's code, and I want to make those changes all at
once.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2640#comment:2> 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:50:05 UTC