Boost C++ Libraries: Ticket #11001: insert_range lacks support for extensible associative sequences https://svn.boost.org/trac10/ticket/11001 <p> According to reference, the insert_range should work for any Extensible sequence or Extensible Associative sequence, but the following fails to compile. </p> <pre class="wiki">#include &lt;boost/mpl/pair.hpp&gt; #include &lt;boost/mpl/map.hpp&gt; #include &lt;boost/mpl/insert_range.hpp&gt; #include &lt;boost/mpl/end.hpp&gt; #include &lt;boost/mpl/equal.hpp&gt; typedef boost::mpl::map&lt;boost::mpl::pair&lt;int, int&gt;, boost::mpl::pair&lt;void, void&gt; &gt; myMap; typedef boost::mpl::insert_range&lt;boost::mpl::map&lt;&gt;, boost::mpl::end&lt;boost::mpl::map&lt;&gt; &gt;::type, myMap&gt;::type copyOfMyMap; BOOST_MPL_ASSERT((boost::mpl::equal&lt;myMap, copyOfMyMap&gt;)); int main() { return 0; } </pre><p> I tracked the issue down to the definition of insert_range_impl, whose default implementation assumes a front_inserter is defined for the given sequence, but neither Extensible nor every Extensible Associative sequences are required to also be a Front Extensible sequence: </p> <pre class="wiki">reverse_copy&lt; joint_view&lt; iterator_range&lt;typename begin&lt;Sequence&gt;::type,Pos&gt; , joint_view&lt; Range , iterator_range&lt;Pos,typename end&lt;Sequence&gt;::type&gt; &gt; &gt; , front_inserter&lt; typename clear&lt;Sequence&gt;::type &gt; &gt; </pre><p> I found the fix to be implementing insert_range_impl by means of insert, which is defined for every Extensible sequence, using fold to iterate: </p> <pre class="wiki">fold&lt; joint_view&lt; iterator_range&lt;typename begin&lt;Sequence&gt;::type,Pos&gt; , joint_view&lt; Range , iterator_range&lt;Pos,typename end&lt;Sequence&gt;::type&gt; &gt; &gt; , typename clear&lt;Sequence&gt;::type , insert&lt;_1, end&lt;_1&gt;, _2&gt; &gt; </pre><p> I'll file a pull request for this fix, any comments are welcome. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11001 Trac 1.4.3