Boost C++ Libraries: Ticket #12679: Merging heaps causes them to "forget" pending lazy updates. https://svn.boost.org/trac10/ticket/12679 <p> In my opinion, a reasonable behavior for the code below would be to print out: 99, 2, 1, In reality, though, the output is: 2, 99, 1, </p> <p> This means that the lazy_update() is somehow forgotten in the process of merging the two heaps. </p> <pre class="wiki"> boost::heap::fibonacci_heap&lt;float&gt; q1, q2; std::vector&lt;boost::heap::fibonacci_heap&lt;float&gt;::handle_type&gt; handles; handles.push_back(q1.push(0.f)); handles.push_back(q1.push(1.f)); handles.push_back(q2.push(2.f)); q1.update_lazy(handles[0], 99.f); q1.merge(q2); while (!q1.empty()) { std::cout &lt;&lt; q1.top() &lt;&lt; ", "; q1.pop(); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12679 Trac 1.4.3 SanketM Wed, 14 Dec 2016 05:03:27 GMT <link>https://svn.boost.org/trac10/ticket/12679#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12679#comment:1</guid> <description> <p> I have tried this code. It is showing the expected behavior and printing 99,2,1. </p> </description> <category>Ticket</category> </item> </channel> </rss>