Boost C++ Libraries: Ticket #11481: zip_iterator issue with _GLIBCXX_DEBUG and std::vector::insert https://svn.boost.org/trac10/ticket/11481 <p> If one uses the <code>zip_iterator</code> class template with <code>std::vector::insert(It1, It2, It2)</code>, with <code>_GLIBCXX_DEBUG</code> defined, g++ return a compilation error: </p> <pre class="wiki">/usr/include/c++/4.9.2/debug/functions.h:220:69: error: invalid initialization of non-const reference of type ‘boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;&amp;’ from an rvalue of type ‘boost::iterator_facade&lt;boost::zip_iterator&lt;boost::tuples::tuple&lt;__gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;int*, std::__cxx1998::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, std::__debug::vector&lt;int&gt; &gt;, __gnu_debug::_Safe_iterator&lt;__gnu_cxx::__normal_iterator&lt;int*, std::__cxx1998::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, std::__debug::vector&lt;int&gt; &gt; &gt; &gt;, boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;, boost::random_access_traversal_tag, boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;, long int&gt;::reference {aka boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;}’ return __foreign_iterator_aux4(__it, std::__addressof(*__other)); ^ </pre><p> The attached test case <code>test.cpp</code> shows the error, with g++-4.9. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11481 Trac 1.4.3 anonymous Thu, 16 Jul 2015 11:59:45 GMT attachment set https://svn.boost.org/trac10/ticket/11481 https://svn.boost.org/trac10/ticket/11481 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> Ticket