Boost logo

Boost :

Subject: Re: [boost] Boost and exceptions
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2012-06-23 04:14:12

By the way, my first thought when I encountered this problem
is that C++11 ought to have specified the range-based for loop
in such a way that the lifetime of temporaries in the range
expression is extended for the duration of the loop.

Does anyone share this opinion? Would there be any downsides
to this?

It is also interesting to note that boost::for_each together
with a lambda - a from to which any range-based for loop can
easily be converted - does not suffer from this problem. I think
this corroborates the fact that the range-base for loop is
suboptimally specified in the standard - after all the range-
based for loop was meant to replace things like boost::for_each.


Boost list run by bdawes at, gregod at, cpdaniel at, john at