The example from http://www.dlang.org/phobos/std_container#BinaryHeap fails:
---
import std.algorithm, std.container;
void main() {
// Example from "Introduction to Algorithms" Cormen et al, p 146
int[] a = [ 4, 1, 3, 2, 16, 9, 10, 14, 8, 7 ];
auto h = heapify(a);
// largest element
assert(h.front == 16);
// a has the heap property
assert(equal(a, [ 16, 14, 10, 9, 8, 7, 4, 3, 2, 1 ]));
}
---
core.exception.AssertError@test(9): Assertion failure
Tested with dmd 2.057 and 2.058head.
Interestingly, the corresponding unit test in container.d differs slightly from
the example (and passes).
Comment #1 by lovelydear — 2012-04-19T14:11:13Z
Fails also on Win32 2.059
Comment #2 by alienballance — 2012-11-28T16:42:50Z