On Mon, Jul 18, 2011 at 8:18 PM, Andrei Alexandrescu <
seewebsiteforem...@erdani.org> wrote:
[snip..]


> We need to keep this key strategic advantage. First off, the fact that this
> code isn't accepted:
>
>
> BinaryHeap!(uint[], function (a, b) {return a > b;}) heap;
>
> is a clear bug.
>
>
>  Worst case, BinaryHeap grows a branch which stores/calls a delegate
>> instead of a template parameter.
>>
>
> 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.:
>
> /// Use this for comparators with state
> struct Dynamic(T) {}
>
> Heap!(uint[], Dynamic!(bool delegate(uint, uint))) myHeap;
>
> A better solution have us detect from the alias that we need to allocate
> storage for it in the Heap object.
>
>

Andrei

 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?

Regards
- Puneet

Reply via email to