title: Macro "parameter" name mesh. Can it work? What am I doing wrong?
body: <pre><code>    // MACROS
  
  #define A_PROPERTY(TYPE, NAME)                      \
      private:                                        \
          TYPE NAME;                                  \
      public:                                         \
          void SetNAME(TYPE theNAME) {NAME=theNAME;}  \
          TYPE GetNAME() {return NAME;}               \
  </code></pre>
  
  <p>I am trying to creat a simple Macro that will take a TYPE and a NAME and will create:</p>
  
  <ol>
  <li>Private member of TYPE named NAME</li>
  <li>Public "getter" method called GetNAME (where NAME is variable...)</li>
  <li>Public "setter" method called GetNAME (where NAME is variable...)</li>
  </ol>
  
  <p>This is how i'd use it from a class definition:</p>
  
  <pre><code>A_PROPERTY(int, Age)
  </code></pre>
  
  <p>The MACRO works, but creates a "getNAME" method instead of "get(whatever I put in NAME)". It seems MACROS don't parse strings and "parameters" together very well. Is there a way to achieve what I want? or should I just have the method as "NAME" with a different signature to differentiate the get and the set?</p>