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: 2013-05-01 15:58:16
#7630: Range adaptors do not play nicely with range-based for loops
--------------------------------+-------------------------------------------
Reporter: gromer@⦠| Owner: neilgroves
Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords: range
--------------------------------+-------------------------------------------
Comment (by gromer@â¦):
One point of clarification, since it confused even me when I reread this:
{{{operator |}}} is left-associative, so the adaptor expression is
equivalent to {{{((vec | boost::adaptors::reversed) |
boost::adaptors::uniqued)}}}. The temporary returned by the whole
expression gets bound to {{{__range}}}, and therefore has its lifetime
extended to match {{{__range}}}, but the temporary returned by the
''subexpression'' {{{vec | boost::adaptors::reversed}}} is not bound to a
reference in the scope of the loop, so its lifetime is not extended.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7630#comment:5> 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:13 UTC