On 3/24/12, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:
> On 3/23/12, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:
>> Does someone have a map implementation that maintains the insertion
>> order of the keys?
>
> Here's a sloppy implementation:

I forgot to make opIndex ref, but also the isValue check fails on
structs with alias this, it's better to use is(typeof()) instead of
directly checking the type. The fix would be:

static if (isArray!Value)
{
    template isValue(T)
    {
       enum bool isValue = is(typeof( { Value v; T t; v = t; } )) ||
is(BaseElement!Value == T);
    }
}
else
{
    template isValue(T) { enum bool isValue = is(typeof( { Value v; T
t; v = t; } )); }
}

Reply via email to