enforcing alias this on derived types

JS js.mdnq at gmail.com
Mon Jul 8 02:01:54 PDT 2013


> interface A(T)
> {
>     @property T Value();
>     @property T Value(T value);
>     // need to enforce alias Value this somehow
> }
>
> class B(T) : A!T
> {
>     private T _value;
>     @property T Value() { return _value; }
>     @property T Value(T value) { return value = _value; }
      alias Value this;
>     // B must use alias this so B(T) behaves like type T
> }



More information about the Digitalmars-d-learn mailing list