Opened 13 years ago
Closed 12 years ago
#2993 closed Bugs (wontfix)
addressof warning in VC9
| Reported by: | Owned by: | Peter Dimov | |
|---|---|---|---|
| Milestone: | To Be Determined | Component: | utility |
| Version: | Boost Development Trunk | Severity: | Problem |
| Keywords: | Cc: | mateusz@… |
Description
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;
}
Attachments (1)
Change History (6)
by , 13 years ago
| Attachment: | addressof.hpp.patch added |
|---|
comment:1 by , 13 years ago
| Component: | foreach → utility |
|---|---|
| Owner: | changed from to |
| Summary: | BOOST_FOREACH warning in VC9 → addressof warning in VC9 |
This warning is actually coming from addressof.hpp, so I'm reassigning and attaching a very simple patch. Peter, I can commit this if you approve.
comment:3 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This was merged to release in [53054].
comment:4 by , 12 years ago
| Cc: | added |
|---|---|
| Milestone: | Boost 1.39.0 → To Be Determined |
| Resolution: | fixed |
| Status: | closed → reopened |
| Version: | → Boost Development Trunk |
It seems sensible to declare hidden private copy constructor as well
addr_impl_ref(const addr_impl_ref &);
comment:5 by , 12 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | reopened → closed |

patch to eliminate noisy warning on VC++