Boost C++ Libraries: Ticket #7749: In Assignment operator, argument should be passed by reference. https://svn.boost.org/trac10/ticket/7749 <p> In file boost/multi_index_container.hpp When defining the assignment operator, argument is not passed by reference. </p> <pre class="wiki">multi_index_container&lt;Value,IndexSpecifierList,Allocator&gt;&amp; operator=( multi_index_container&lt;Value,IndexSpecifierList,Allocator&gt; x) { BOOST_MULTI_INDEX_CHECK_INVARIANT; this-&gt;swap(x); return *this; } </pre><p> Attached patch is fix for it. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7749 Trac 1.4.3 Gaurav Gupta <g.gupta@…> Thu, 29 Nov 2012 05:42:38 GMT attachment set https://svn.boost.org/trac10/ticket/7749 https://svn.boost.org/trac10/ticket/7749 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">multi_index_container.hpp_patch</span> </li> </ul> <p> Proposed patch for the bug raised </p> Ticket Joaquín M López Muñoz Thu, 29 Nov 2012 07:01:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7749#comment:1 https://svn.boost.org/trac10/ticket/7749#comment:1 <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">invalid</span> </li> </ul> <p> This manner of implementing assignment operator is not a bug. It's described in Sutter and Alexandrescu's <a class="ext-link" href="http://www.gotw.ca/publications/c++cs.htm"><span class="icon">​</span>C++ Coding Standards</a> and more briefly on the <a class="ext-link" href="http://en.wikipedia.org/wiki/Assignment_operator_%28C%2B%2B%29"><span class="icon">​</span>Wikipedia</a>. </p> <p> BTW, your patch is invalid: it'd rule out assignment from a const object. </p> Ticket