Boost C++ Libraries: Ticket #7031: (back_|front_)move_insert_iterator::op= cannot take rvalue https://svn.boost.org/trac10/ticket/7031 <p> For example, following code occurs compile error both of C++03 and C++11. </p> <pre class="wiki">vector&lt;movable_type&gt; container; *boost::back_move_inserter(container) = movable_type(); *boost::front_move_inserter(container) = movable_type(); *boost::move_inserter(container, container.end()) = movable_type(); </pre><p> Another example, following code also occurs compile error in C++11 (does not C++03). </p> <pre class="wiki">vector&lt;movable_type&gt; container; movable_type v; *boost::back_move_inserter(container) = boost::move(v); *boost::front_move_inserter(container) = boost::move(v); *boost::move_inserter(container, container.end()) = boost::move(v); </pre><p> It seems missing definition of (back_|front_)move_insert_iterator::op=(C::value_type &amp;&amp;) . </p> <p> The simple patch is here, and I tested under only trunk, <a class="changeset" href="https://svn.boost.org/trac10/changeset/79106" title="Corrected the Boost Build core_nt_cmd_line.py test failure caused by ...">r79106</a>. </p> <pre class="wiki">@@ -817,6 +817,8 @@ class back_move_insert_iterator explicit back_move_insert_iterator(C&amp; x) : container_m(&amp;x) { } back_move_insert_iterator&amp; operator=(typename C::reference x) + { return operator=(boost::move(x)); } + back_move_insert_iterator&amp; operator=(BOOST_RV_REF(typename C::value_type) x) { container_m-&gt;push_back(boost::move(x)); return *this; } back_move_insert_iterator&amp; operator*() { return *this; } @@ -852,6 +854,8 @@ public: explicit front_move_insert_iterator(C&amp; x) : container_m(&amp;x) { } front_move_insert_iterator&amp; operator=(typename C::reference x) + { return operator=(boost::move(x)); } + front_move_insert_iterator&amp; operator=(BOOST_RV_REF(typename C::value_type) x) { container_m-&gt;push_front(boost::move(x)); return *this; } front_move_insert_iterator&amp; operator*() { return *this; } @@ -887,6 +891,8 @@ class move_insert_iterator {} move_insert_iterator&amp; operator=(typename C::reference x) + { return operator=(boost::move(x)); } + move_insert_iterator&amp; operator=(BOOST_RV_REF(typename C::value_type) x) { pos_ = container_m-&gt;insert(pos_, ::boost::move(x)); ++pos_; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7031 Trac 1.4.3 Ion Gaztañaga Wed, 11 Jul 2012 22:33:57 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7031#comment:1 https://svn.boost.org/trac10/ticket/7031#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">fixed</span> </li> </ul> <p> Thanks for the report, fixed in trunk at revision: 79431 </p> Ticket