<div dir="ltr">This should address both Richard and Marshall's review comments, many thanks to both!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 18, 2014 at 6:51 AM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On Jul 15, 2014, at 12:18 PM, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
<br>
> Ping.<br>
><br>
> On Wed, Jul 9, 2014 at 3:14 AM, David Majnemer <<a href="mailto:david.majnemer@gmail.com">david.majnemer@gmail.com</a>> wrote:<br>
>> std::make_heap is currently implemented by iteratively applying a<br>
>> sift_up-type algorithm.<br>
>> Since sift-up is O(ln n), this gives std::make_heap a worst case time<br>
>> complexity of O(n ln n).  Since the C++ standard mandates that<br>
>> std::make_heap make no more than O(3n) comparisons, this makes our<br>
>> std::make_heap out of spec.<br>
>><br>
>> Fix this by introducing an implementation of __sift_down and switch<br>
>> std::make_heap to create the heap using it.  This gives std::make_heap<br>
>> linear time complexity in the worst case.<br>
>><br>
>> This fixes PR20161.<br>
<br>
</div></div>I added some more bits to the tests.<br>
Your change to “make_heap.pass.cpp” is not right because:<br>
1) It passes a comparison function to make_heap, but that test is testing the version that does not take a comparison predicate.<br>
2) It uses a lambda, which fails when the tests are run with -std=c++03<br>
<br>
Revised test attached.<br>
<span class="HOEnZb"><font color="#888888"><br>
— Marshall<br>
<br>
</font></span></blockquote></div><br></div>