https://d.puremagic.com/issues/show_bug.cgi?id=11452


Simen Kjaeraas <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #2 from Simen Kjaeraas <[email protected]> 2013-11-06 08:45:06 
PST ---
I'm not sure this is something we actually do want. Consider:

template Foos(uint size, T) {
    static if (is(T == string)) {
        alias Foos = T[size*3];
    } else {
        alias Foos = T[size];
    }
}

void func(uint size, T)(Foos!(size, T)) {
}

void test() {
    string[6] a;
    func(a);
}


How is the poor compiler to figure out the values of size and T? An even
simpler example:

template Foos(uint size, T) {
    alias Foos = float;
}


Bottom line is, templates can be arbitrarily complex. This sort of matching can
only be done for very simple cases.

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

Reply via email to