[Boost-bugs] [Boost C++ Libraries] #5473: [Foreach] non-const rvalue collections are treated as const collections

Subject: [Boost-bugs] [Boost C++ Libraries] #5473: [Foreach] non-const rvalue collections are treated as const collections
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-04-14 23:41:55


#5473: [Foreach] non-const rvalue collections are treated as const collections
-------------------------------------+--------------------------------------
 Reporter: mimomorin@… | Owner: eric_niebler
     Type: Patches | Status: new
Milestone: To Be Determined | Component: foreach
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 In Boost.Foreach, non-const rvalue collections are treated as const
 collections.
 So the following code does not compile:

 {{{
 #include <vector>
 #include <boost/foreach.hpp>

 int main (int argc, char* argv[])
 {
     BOOST_FOREACH(int& x, std::vector<int>(3)) {}
     return 0;
 }
 }}}

 I think treating them as non-const collections is more intuitive
 and, at least, is consistent with C++0x range-based for.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5473>
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:06 UTC