diff --git a/include/boost/heap/binomial_heap.hpp b/include/boost/heap/binomial_heap.hpp index a72b342..e8b2828 100644 --- a/include/boost/heap/binomial_heap.hpp +++ b/include/boost/heap/binomial_heap.hpp @@ -686,6 +686,8 @@ try_again: } else { this_iterator = trees.erase( this_iterator ); carry_node = merge_trees( this_node, carry_node ); + if ( this_iterator == trees.end() ) + break; } goto try_again; } else {