On Friday, 29 June 2012 at 19:37:50 UTC, Namespace wrote:
This works:

import std.stdio;

struct X {
private:
        bool _x;

public:
        this(bool x) {
                _x = x;
        }

        @property
        bool Get() inout {
                return this._x;
        }

        alias Get this;

        typeof(this) opAssign(bool x) {
                this._x = x;

                return this;
        }
}

void main()
{
        X a = false;
        writeln(a);
        a = true;
        writeln(a);
}

I see, I just thought that opCall @ property equivalent opAssign and wanted to check it out, and now I would be interested to understand why it is not

Reply via email to