[Issue 8737] Associative Array (AA) KeyType is not Unqual-able

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 29 15:54:45 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8737



--- Comment #1 from monarchdodra at gmail.com 2012-09-29 15:55:11 PDT ---
(In reply to comment #0)
> Here, the implementer of "foo" is unable to tranform his keys, because their
> types are not mutable.

I meant "to"

> The real problem is that KeyType returned "const(int)[int]", is not really
> const, but not mutable either. Because of this Unqual doesn't work.
> 
> Suggestion: The type returned by KeyType should be "full const", eg:
> const(int[int]).

No, wait that is bad advice. Recommend changing "Unqual" actually;

--------
template Unqual(T)
    if(!isAssociativeArray!T) //New condition
{
    //As it was
}

//New overload
template Unqual(T)
    if(isAssociativeArray!T)
{
    alias KeyType!T K;
    alias Unqual!(ValueType!T) V;
    alias V[K] Unqual;
}
--------

I'll do this tommorrow, unless I get some objections?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list