[Boost-bugs] [Boost C++ Libraries] #2993: BOOST_FOREACH warning in VC9

Subject: [Boost-bugs] [Boost C++ Libraries] #2993: BOOST_FOREACH warning in VC9
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-05 11:43:18


#2993: BOOST_FOREACH warning in VC9
-----------------------------------------------------------+----------------
 Reporter: Fredrik Orderud <fredrik.orderud_at_[hidden]> | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: foreach
  Version: | Severity: Problem
 Keywords: |
-----------------------------------------------------------+----------------
 CONFIGURATION:
 Boost 1.39, Visual studio 2008 (VC9), WARNING LEVEL 4 (most verbose).

 PROBLEM:
 When iterating over a std::vector<int> with BOOST_FOREACH, the compiler
 returns a "warning C4512: 'boost::detail::addr_impl_ref<T>' : assignment
 operator could not be generated". This warning did not appear with boost
 1.38.

 {{{
 #pragma once
 #include <vector>
 #include <iostream>
 #include <boost/foreach.hpp>

 // Compile with warning level 4:
 int main () {
         std::vector<int> list;
         // warning C4512: 'boost::detail::addr_impl_ref<T>' : assignment
 operator could not be generated
         BOOST_FOREACH (const int & e, list) {
                 std::cout << e << std::endl;
         }
         return 0;
 }
 }}}

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