Summary: std.container's BinaryHeap doesn't work with Array!(T)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from 2011-11-16 06:27:06 PST ---
The documentation of BinaryHeap in std.container says that:
"If Store is a range, the BinaryHeap cannot grow beyond the size of that range.
If Store is a container that supports insertBack, the BinaryHeap may grow by
adding elements to the container."

But the Array!(T) container, which does have a insertBack() method, can't be
used with a BinaryHeap, as the following code:

import std.container;
void main() {
  auto array = Array!(int)();
  auto heap  = heapify(array);
  //auto heap = BinaryHeap!(Array!(int))(array); // gives same error

Gives the following compilation error:
\phobos\std\container.d(2660): Error: this._store()[this._length()] is not an

This happens to make growable BinaryHeaps impossible using only Phobos

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

Reply via email to