Summary: std.container: BinaryHeap interface is broken.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from 2011-05-28 03:05:00 PDT ---
>From my code:

auto h=BinaryHeap!(typeof(s),"a.y<b.y")(s);

The two argument's order is reverse: the compiler can always infer the type but
hardly the comparison predicate.

That the "convenience function" heapify does not take an optional comparison
predicate does not make things any better.

Ideally, it should be possible to write:

auto h=heapify!"a.y<b.y"(s);

(As is consistent with Eg. sort.)

1. Ideally, the order of the two arguments for BinaryHeap should change.
2. heapify _really_ should take a comparison predicate as its first template
argument. This won't break code, because no sane D developer has explicitly
passed the type to heapify.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to