BinaryHeap is a range so it goes in std.range. Agree?

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 8 09:32:52 PDT 2010


On Tue, 08 Jun 2010 12:26:19 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

>
> I agree that a BinaryHeap built on top of a container may ultimately  
> affect the topology of the container, which makes it unlike e.g. Take or  
> Chain. I could choose to disallow that and simply require that  
> BinaryHeap always works on top of a range, not a container. But I think  
> it's useful to have the growing functionality, and I don't think that  
> makes BinaryHeap hopelessly confusing.

What about making a BinaryHeapRange and a BinaryHeapContainer (well, with  
better names)?

Essentially, the container flavored heap would use a BinaryHeapRange for  
its range type, and would supply the necessary functions for it to be a  
container.

I admit not reading any code for BinaryHeap, so this might just be a  
foolish suggestion...

-Steve


More information about the Digitalmars-d mailing list