<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 8:18 PM, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br>
<div>[snip..]</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div></div>
We need to keep this key strategic advantage. First off, the fact that this code isn't accepted:<div><br>
<br>
BinaryHeap!(uint[], function (a, b) {return a > b;}) heap;<br>
<br></div>
is a clear bug.<div><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Worst case, BinaryHeap grows a branch which stores/calls a delegate<br>
instead of a template parameter.<br>
</blockquote>
<br></div>
I'll discuss with Walter, but even without any language change we can define a special symbol that means "store this object inside". That symbol has nothing interesting about it, e.g.:<br>
<br>
/// Use this for comparators with state<br>
struct Dynamic(T) {}<br>
<br>
Heap!(uint[], Dynamic!(bool delegate(uint, uint))) myHeap;<br>
<br>
A better solution have us detect from the alias that we need to allocate storage for it in the Heap object.<br><font color="#888888">
<br></font></blockquote><div><br></div><div>Andrei</div><div><br></div><div> Did you get a chance to take this up with Walter? I wanted to make sure that we do not forget this issue altogether. Should I file this on Bugzilla?</div>
<div><br></div><div>Regards</div><div>- Puneet</div><div><br></div></div><br><div><br></div><div><br></div>