[Issue 9502] New: std_container.BinaryHeap.pop?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 12 17:45:42 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9502

           Summary: std_container.BinaryHeap.pop?
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-02-12 17:45:41 PST ---
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.

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


More information about the Digitalmars-d-bugs mailing list