Re: [Boost-bugs] [Boost C++ Libraries] #7630: Range adaptors do not play nicely with range-based for loops

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7630: Range adaptors do not play nicely with range-based for loops
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-09 01:06:56


#7630: Range adaptors do not play nicely with range-based for loops
-------------------------------+------------------------
  Reporter: gromer@… | Owner: neilgroves
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: range
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords: range
-------------------------------+------------------------

Comment (by neilgroves):

 I don't think the provided example does suffer undefined behaviour. It
 doesn't matter that the subexpression lifetime is short since the
 subexpression was used as input to the outer expression. The outer
 expression holds iterators by value by copying them. It doesn't hold onto
 the source range as stated in the report.

 If one were to have a slightly different example with, for example, a
 vector returned by value from a function and then directly passed into the
 adaptors this would be undefined. I'm not convinced that this use case is
 worth the general penalty.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7630#comment:13>
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:15 UTC