http://d.puremagic.com/issues/show_bug.cgi?id=7287
Summary: std.container.BinaryHeap example fails Product: D Version: D2 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: mailm...@nilsb.dyndns.org --- Comment #0 from Nils <mailm...@nilsb.dyndns.org> 2012-01-12 21:52:21 PST --- 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). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------