[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2017-08-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4271

RazvanN  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from RazvanN  ---
It seems that meanwhile, binaryHeap has been moved from std.algorithm to
std.container and the method removeAny [1] was added which does exactly what
this bug report asks for. Closing as fixed.

[1] http://dlang.org/phobos/std_container_binaryheap.html#.BinaryHeap.removeAny

--


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2016-12-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4271

greenify  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #4 from greenify  ---
Imho this is a common problem of the range API and I would love to see a
generic solution. For prior art see e.g.

https://github.com/dlang/phobos/pull/4010

and a good, generic solution in phobos-next that checks as a constraint whether
it's valid to do the move:

https://github.com/nordlow/phobos-next/blob/master/src/range_ex.d#L57

--


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2016-12-23 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4271

RazvanN  changed:

   What|Removed |Added

   Keywords||trivial
 CC||razvan.nitu1...@gmail.com

--


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4271

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|future  |D2

--


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2011-01-09 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4271


Andrei Alexandrescu and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 AssignedTo|nob...@puremagic.com|and...@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2010-06-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4271



--- Comment #2 from bearophile_h...@eml.cc 2010-06-04 15:40:21 PDT ---
In most of my usages of a heap I don't have just to use the top item or just to
pop the top item, I have to pop the top item and then use the popped out item.

To perform this operation I can currently use something like:

item = heap.top();
heap.pop();

But this is not handy because that is not a single expression, so I can't put
it inside other expressions. So I have to use:

somefunction(heap.top(1)[0]);

But being this operation so common, I'd like to write simpler code:

somefunction(heap.top());

I have suggested to add the drop() method too to not decrease the performance
of the (uncommon) code that just needs to remove the top item with no need to
use it (or uses it using top() in other points of the code).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4271] drop/pop methods for std.algorithm.BinaryHeap

2010-06-04 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4271



--- Comment #3 from bearophile_h...@eml.cc 2010-06-04 16:00:04 PDT ---
Sorry, that was a partially wrong comment, I meant:

So I have to use:

somefunction(heap.pop(1)[0]);

But being this operation so common, I'd like to write simpler code:

somefunction(heap.pop());

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---