Boost C++ Libraries: Ticket #2993: addressof warning in VC9 https://svn.boost.org/trac10/ticket/2993 <p> CONFIGURATION: Boost 1.39, Visual studio 2008 (VC9), WARNING LEVEL 4 (most verbose). </p> <p> PROBLEM: When iterating over a std::vector&lt;int&gt; with BOOST_FOREACH, the compiler returns a "warning C4512: 'boost::detail::addr_impl_ref&lt;T&gt;' : assignment operator could not be generated". This warning did not appear with boost 1.38. </p> <pre class="wiki">#pragma once #include &lt;vector&gt; #include &lt;iostream&gt; #include &lt;boost/foreach.hpp&gt; // Compile with warning level 4: int main () { std::vector&lt;int&gt; list; // warning C4512: 'boost::detail::addr_impl_ref&lt;T&gt;' : assignment operator could not be generated BOOST_FOREACH (const int &amp; e, list) { std::cout &lt;&lt; e &lt;&lt; std::endl; } return 0; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2993 Trac 1.4.3 Eric Niebler Thu, 07 May 2009 17:10:28 GMT attachment set https://svn.boost.org/trac10/ticket/2993 https://svn.boost.org/trac10/ticket/2993 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">addressof.hpp.patch</span> </li> </ul> <p> patch to eliminate noisy warning on VC++ </p> Ticket Eric Niebler Thu, 07 May 2009 17:12:35 GMT owner, component, summary changed https://svn.boost.org/trac10/ticket/2993#comment:1 https://svn.boost.org/trac10/ticket/2993#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Eric Niebler</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">foreach</span> → <span class="trac-field-new">utility</span> </li> <li><strong>summary</strong> <span class="trac-field-old">BOOST_FOREACH warning in VC9</span> → <span class="trac-field-new">addressof warning in VC9</span> </li> </ul> <p> 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. </p> Ticket Peter Dimov Thu, 07 May 2009 17:30:12 GMT <link>https://svn.boost.org/trac10/ticket/2993#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2993#comment:2</guid> <description> <p> Yes, please commit and merge to release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Daniel James</dc:creator> <pubDate>Sat, 27 Jun 2009 11:54:17 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2993#comment:3 https://svn.boost.org/trac10/ticket/2993#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This was merged to release in <a class="changeset" href="https://svn.boost.org/trac10/changeset/53054" title="Merged revisions 52837 via svnmerge from ...">[53054]</a>. </p> Ticket Mateusz Loskot Thu, 26 Aug 2010 11:25:50 GMT status, milestone changed; cc, version set; resolution deleted https://svn.boost.org/trac10/ticket/2993#comment:4 https://svn.boost.org/trac10/ticket/2993#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">mateusz@…</span> added </li> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>version</strong> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.39.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> It seems sensible to declare hidden private copy constructor as well </p> <pre class="wiki">addr_impl_ref(const addr_impl_ref &amp;); </pre> Ticket Peter Dimov Thu, 24 Feb 2011 17:22:30 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2993#comment:5 https://svn.boost.org/trac10/ticket/2993#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> Ticket