Possible @property compromise
Adam D. Ruppe
destructionator at gmail.com
Tue Jan 29 09:16:59 PST 2013
Not awful... but what about opDispatch setters?
Perhaps we could do it this way:
void opSet(string variable, T)(T value) {}
Foo foo;
foo.s = 10; // if s doesn't exist, do opSet!"s"(10)
If you only want a setter for one particular name
void opSet(string name : "s")(int val) {}
It'd solve the unicode thing too, though at the cost of a little
more verboseness for some things.
Oh crap what if it needs to be virtual. Blargh. I'll throw it out
anyway.
More information about the Digitalmars-d
mailing list