Boost C++ Libraries: Ticket #11692: boost::insert doesn't return a value on the 2 argument overload causing undefined behaviour https://svn.boost.org/trac10/ticket/11692 <p> In boost/range/algorithm_ext/insert.hpp the second overload for insert doesn't return anything. </p> <p> This was causing our build on clang 3.6 to crash. A simple reproducer is </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;set&gt; #include &lt;boost/range/algorithm_ext/insert.hpp&gt; int main() { std::vector&lt;int&gt; vec({0,1,2,3}); std::set&lt;int&gt; out; boost::insert(out, vec); for (auto val : out) { std::cout &lt;&lt; val &lt;&lt; std::endl; } return 0; } </pre><p> To fix it, simply adding </p> <pre class="wiki"> return on; </pre><p> at the end of the function so that it matches the overload above it fixed the issue. </p> <p> Having looked at the tests <a class="ext-link" href="https://github.com/boostorg/range/blob/master/test/algorithm_ext_test/insert.cpp"><span class="icon">​</span>https://github.com/boostorg/range/blob/master/test/algorithm_ext_test/insert.cpp</a> </p> <p> The test only appear to be testing the overload that takes 3 arguments which works fine. </p> <p> I tested on 1.56, I had a quick look at the code for 1.59 and it appears to have the same issue but have not been able to test it. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11692 Trac 1.4.3 Michel Morin Tue, 29 Sep 2015 13:02:52 GMT owner, component changed https://svn.boost.org/trac10/ticket/11692#comment:1 https://svn.boost.org/trac10/ticket/11692#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Marshall Clow</span> to <span class="trac-author">Neil Groves</span> </li> <li><strong>component</strong> <span class="trac-field-old">algorithm</span> → <span class="trac-field-new">range</span> </li> </ul> <p> It is already fixed on develop branch, but it's not merged to master branch. (A test case for binary <code>insert</code> is still missing in develop branch.) </p> Ticket anonymous Fri, 30 Jun 2017 08:27:54 GMT <link>https://svn.boost.org/trac10/ticket/11692#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11692#comment:2</guid> <description> <p> Issue is still exist in 1.64 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 27 Sep 2017 15:05:14 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/11692#comment:3 https://svn.boost.org/trac10/ticket/11692#comment:3 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.56.0</span> → <span class="trac-field-new">Boost 1.63.0</span> </li> </ul> <p> Still exists in 1.63 </p> Ticket