title: How to generate automatic properties (get, set) for Visual Studio 2008 C++
body: <p>Having read this <a href="https://stackoverflow.com/questions/3017/how-to-generate-getters-and-setters-in-visual-studio">question</a> on generating 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. </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>I like the form suggested <a href="http://geekswithblogs.net/wojan/archive/2007/12/12/117629.aspx" rel="nofollow noreferrer">here</a> for VS 2008:</p>
  
  <pre><code>string sName { get; set; }
  </code></pre>
  
  <p>But it won't compile in C++. Is this just for <a href="http://www.c-sharpcorner.com/UploadFile/john_charles/WhatnewinVisualStudioNET200802012008121831PM/WhatnewinVisualStudioNET2008.aspx" rel="nofollow noreferrer">.NET and C#</a>?</p>
  
  <p>Is there some tidy way to simulate this in C++?</p>