On 2011-10-03 21:54, bearophile wrote:
Jacob Carlborg:

I would like to have something similar as this possible as well:

class Foo
{
      @get_set int x;
}

Would insert a getter and setter for "x" like this:

class Foo
{
      int x_;

      int x () { return x_; }
      int x (int x) { return x_ = x; }
}

I think a template mixin is already able to do this.

Bye,
bearophile

Template mixins can do (most of) the other things suggested in this thread as well, except for your suggestion. But it's not pretty.

--
/Jacob Carlborg

Reply via email to