Hi,

Consider this:

struct S
{
    static S opAssign(int rhs)
    {
        return S();
    }
}

void main()
{
    S s;
    s = 1;
}

And:

struct S
{
    S opAssign(int rhs)
    {
        return S();
    }
}

void main()
{
    S s;
    s = 1;
}

Both will compile. I don't get it. I can understand it in the case of the static opAssign, but with the non-static one, what does 'this' refer to inside opAssign? And why are both seemingly allowed?

- Alex

Reply via email to