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: 2016-06-02 11:33:48
#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 rob.desbois@â¦):
What's the current status of this? I have scoured Boost Trac and mailing
lists recently and still feel uncertain whether the described pattern is
generally safe. My typical use case is slightly different, though suffers
from the same potentially-undefined behaviour: functions which return a
range produced by piping a container through some adaptor chain.
Looking through the code for some of these adaptors my best understanding
is that it is safe based on Neil's comment:13 regarding copying of
underlying iterators. I don't feel comfortable with that though: what if
the implementation changes?.
Perhaps while there is no fix (if there still isn't) could a summary of
the issue and some advice be given in the Boost.Range docs? Even if it
simply says "Here's the possible issue, but the implementation all of
Boost's range adaptors means this is never UB" that would suffice: this is
too concerning an issue regarding a common usage pattern to have no
official recommendation for IMHO.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7630#comment:18> 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:20 UTC