Subject: [Boost-bugs] [Boost C++ Libraries] #2640: counting_iterator::reference lifetime tied to iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-01-05 20:54:53
#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
Keywords: counting_iterator reverse_iterator |
------------------------------------------------+---------------------------
Currently, counting_iterator<T>::reference is Incrementable const&. This
makes reverse_iterator< counting_iterator<T> >::dereference return a
reference to a temporary variable:
typename super_t::reference dereference() const { return
*boost::prior(this->base()); }
The problem is that iterator::reference is expected to stay valid even if
the iterator it was obtained from is dead.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2640> 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