November 16, 2011 [Issue 6959] New: std.container's BinaryHeap doesn't work with Array!(T) | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6959 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 AssignedTo: nobody@puremagic.com ReportedBy: zetetyck@gmail.com --- Comment #0 from zetetyck@gmail.com 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 lvalue This happens to make growable BinaryHeaps impossible using only Phobos containers. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
November 16, 2011 [Issue 6959] std.container's BinaryHeap doesn't work with Array!(T) | ||||
---|---|---|---|---|
| ||||
Posted in reply to zetetyck@gmail.com | http://d.puremagic.com/issues/show_bug.cgi?id=6959 zetetyck@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE --- Comment #1 from zetetyck@gmail.com 2011-11-16 07:07:07 PST --- *** This issue has been marked as a duplicate of issue 5998 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation