Having read this thread:
http://stackoverflow.com/questions/3017/how-to-generate-getters-and-setters-in-visual-studio
and tried (somewhat) the techniques described, I have failed miserably to graduate beyond the longhand way of writing Getters and Setters.
While I recognize the conceptual advantage of encapsulation (private members of a class in this case) Writing 25 getters and setters is a waste of space and my time.
Why 25? Well apart form the exageration factor (approx 2.5) I just don't know at what point I will need access to that one variable in the future. I guess I could write a function that returns all of them and fish out the one I need, but if I add more members (often do) then the function must be changed throughout the code.
I like the form suggested here
http://geekswithblogs.net/wojan/archive/2007/12/12/117629.aspx
of
string sName { get; set; }
But it wont compile in C++. Is this just for .NOT and C#
Is there some tidy way to simulate this in C++?