16 Jan
2006
16 Jan
'06
10:07 p.m.
Thorsten Ottosen wrote:
Eric Niebler wrote:
Thorsten Ottosen wrote:
as_mutable();
The latter would be a cast from rvalue to lvalue like it happens in boost.foreach.
Not sure what you're referring to. Boost.Foreach does no such rvalue-to-lvalue cast.
So this wouldn't compile:
vector<int> foo(); ... BOOST_FOREACH( int& r, foo() ) ++r
?
No, it doesn't compile, and it shouldn't. What would be the point of mutating the unnamed temporary vector returned by foo()? -- Eric Niebler Boost Consulting www.boost-consulting.com