www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9502] New: std_container.BinaryHeap.pop?


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

--- Comment #0 from bearophile_hugs 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;

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: -------
Feb 12 2013