<br><br><div class="gmail_quote">On Mon, May 31, 2010 at 01:56, Andrei Alexandrescu <span dir="ltr">&lt;<a href="mailto:SeeWebsiteForEmail@erdani.org">SeeWebsiteForEmail@erdani.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 05/30/2010 04:53 PM, Philippe Sigaud wrote:<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
There are some simple containers I&#39;d like to see in std.containers:<br>
<br>
- a priority queue<br>
- a heap<br>
</blockquote>
<br></div>
What&#39;s the difference between the two?<br></blockquote><div><br>Looking at some old code of mine, not much. Once you have a BinaryHeap, a PriorityQueue!(Payload,Priority) is just a BinaryHeap!(Tuple!(Payload, Priority))<br>
with a sorter acting on the tuple&#39;s second field and front() (or whatever it&#39;s called for containers) returning the first field.<br>And, of course, nice creating functions.<br><br>So, heap is the basis, priority queue is just a nice wrapper. But I want nice wrappers! They are easy to code, and gives joe phobos what he wants.<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
- a stack, a queue<br>
</blockquote>
<br>
These are adaptors over other containers, I agree they should be in.<br></blockquote><div><br>Yes, an adaptor with a default implementation. Do you consider built-in arrays (not slices) to be containers? <br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
- a set<br>
</blockquote>
<br>
Yah, though I want std.container to focus on implementation, not policy.<br></blockquote><div><br>Please, a set, please, a set!<br>I mean, where would you put it otherwise?<br><br><br><br>Philippe<br><br></div></div><br>