Automatic getter/setter generation

Saaa empty at needmail.com
Wed Oct 21 20:15:40 PDT 2009


I was thinking about using a template which would generate a variable and 
its getters/setters automatically.
Something like this:

mixin var!(int,"_name","rwr-");

// private int _name
// public int name(){return _name};
// protected void name(int value){_name=value};

What do you think about something like that?

Also, it would be nicer if it would take:
mixin var!(int _name, "rwr-");
But I don't know how to get the name that way. 




More information about the Digitalmars-d-learn mailing list