Possible @property compromise

Timon Gehr timon.gehr at gmx.ch
Tue Jan 29 09:21:30 PST 2013


On 01/29/2013 06:16 PM, Adam D. Ruppe wrote:
> Not awful... but what about opDispatch setters?
>
> Perhaps we could do it this way:
>
>
> void opSet(string variable, T)(T value) {}
>...
> Oh crap what if it needs to be virtual. Blargh. I'll throw it out anyway.

private int _s;
protected void setS(int value){ this._s=value; }
template opSet(string variable : "s")(int value){ alias opSet = setS; }


More information about the Digitalmars-d mailing list