[Boost-bugs] [Boost C++ Libraries] #3583: iterator in fusion::detail::segmented_range not adjusted after copying

Subject: [Boost-bugs] [Boost C++ Libraries] #3583: iterator in fusion::detail::segmented_range not adjusted after copying
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-10-31 18:44:55


#3583: iterator in fusion::detail::segmented_range not adjusted after copying
-------------------------------------+--------------------------------------
 Reporter: cschmidt | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: proto
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 Consider the following code:

 {{{
 boost::fusion::begin(boost::proto::flatten(a_ >> b_))
 }}}
 with a_ and b_ being two proto terminals.

 Internally this will yield to a local instantiation of
 fusion::detail::segmented_range<boost::fusion::single_view<boost::proto::exprns_::expr<...>
> >. This segmented range view is copied in a fusion::cons, and this cons
 is returned to the caller
 [https://svn.boost.org/trac/boost/browser/trunk/boost/fusion/view/ext_/segmented_iterator.hpp#L272
 segmented_iterator.hpp#L272]

 The iterator (segmented_range::where_) on the single view
 (segmented_range::sequence) is not adjusted when being copyed. Therefore
 the where_ attribute of the segmented_range in the cons points to an
 already destructed single view after the cons is returned to the caller.
 At the moment this is not much of a problem as single view iterators store
 a copy of the value of the actual single_view they point to
 ([https://svn.boost.org/trac/boost/browser/trunk/boost/fusion/view/single_view/single_view_iterator.hpp
 single_view_iterator.hpp]). With the upcoming c++0x port of fusion this
 behaviour will change though. Single view iterators will store a pointer
 to the actual single view instead.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3583>
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:01 UTC