[Issue 6515] Support for a basic BinaryHeap operation

2017-10-19 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6515

RazvanN  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||razvan.nitu1...@gmail.com
 Resolution|--- |INVALID

--- Comment #2 from RazvanN  ---
Using the method insert as pointed out in comment 2 is the way to go. Closing
as invalid.

--


[Issue 6515] Support for a basic BinaryHeap operation

2016-10-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6515

Andrei Alexandrescu  changed:

   What|Removed |Added

   Keywords||bootcamp
 CC||and...@erdani.com

--


[Issue 6515] Support for a basic BinaryHeap operation

2016-10-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6515

safety0ff.bugz  changed:

   What|Removed |Added

 CC||safety0ff.b...@gmail.com

--- Comment #1 from safety0ff.bugz  ---
import std.container.binaryheap;
import std.container.array;
import std.random;
void main()
{
  BinaryHeap!(Array!uint) heap;
  uint n = uniform(100, 2000);
  foreach (_;0..n)
heap.insert(uniform(0,uint.max));
}

I didn't get it to work with uint[], perhaps there's a bug.
It kept saying "Cannot grow a heap created over a range," but as you can see,
it should work with uint[] as the following static if should evaluate to true.

https://github.com/dlang/phobos/blob/master/std/container/binaryheap.d#L279

--