www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12123] New: heap.pop


           Summary: heap.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 2014-02-09 13:45:24 PST ---
This is a split from Issue 5462 .

In code that uses the BinaryHeap I often use two lines of code like (note it
use removeFront and not popFront):

auto item = heap.front;

So I suggest to add to BinaryHeap a handy member function pop() that does both

auto item = heap.pop;

(In a dynamic array a pop() should call back+popBack, so it's a function
specialized for heaps.)

See also:




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