Bug 9502 – std_container.BinaryHeap.pop?

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-12T17:45:41Z
Last change time
2017-08-25T10:36:15Z
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-02-12T17:45:41Z
A very common operation to do with a heap is to take the front item and remove it from the heap: auto item = heap.front; heap.removeFront(); So maybe it's a good idea to add a handy short-named method that does both: auto item = heap.pop(); This is useful in script-like D coding.
Comment #1 by razvan.nitu1305 — 2017-08-25T10:36:15Z
The implementation is compliant with the range api. All ranges might benefit from having a pop method but none implement one, so I guess that adding pop for this one might break consistency. Closing as WONTFIX.