On Monday, 11 August 2014 at 03:12:45 UTC, Vlad Levenfeld wrote:
[snip]

        this (Elements...)(Elements elements)
        if (Elements.length == length)
        {
                foreach (i, element; elements)
                        components[i] = element;
        }
        this (Element element)
        {
                components[] = element;
        }
[snip]

The following gives an error in 2066

struct S(F, size_t L)
{
    F[L] c;
    this(E...)(E el)
    if(E.length == L)
    {
        foreach(i, e; el) {
            c[i]= e;
        }
    }
    this(F e) {
        c[0] = e;
    }
}
void main()
{
    auto s = S!(double, 1)(1);
auto s = S!(double, 3)(1,2,3); // <-- ERROR: declaration hacks.main.s is already defined
}


Cheers,
uri

Reply via email to