title: Are empty macro arguments legal in C++11?
body: <p>I sometimes deliberately omit macro arguments. For example, for a function-like macro like</p>
  
  <pre><code>#define MY_MACRO(A, B, C)  ...
  </code></pre>
  
  <p>I might call it as:</p>
  
  <pre><code>MY_MACRO(, bar, baz)
  </code></pre>
  
  <p>There are still technically 3 arguments; it's just that the first one is "empty". This question is not about variadic macros.</p>
  
  <p>When I do this I get warnings from g++ when compiling with <code>-ansi</code> (aka <code>-std=c++98</code>), but not when I use <code>-std=c++0x</code>. Does this mean that empty macro args are legal in the new C++ standard? </p>
  
  <p>That's the entirety of my question, but anticipating the "why would you want to?" response, here's an example. I like keeping .h files uncluttered by function bodies, but implementing simple accessors outside of the .h file is tedious. I therefore wrote the following macro:</p>
  
  <pre><code>#define IMPLEMENT_ACCESSORS(TEMPLATE_DECL, RETURN_TYPE, CLASS, FUNCTION, MEMBER) \
    TEMPLATE_DECL                                                         \
    inline RETURN_TYPE* CLASS::Mutable##FUNCTION() {                      \
      return &amp;MEMBER;                                                     \
    }                                                                     \
                                                                          \
    TEMPLATE_DECL                                                         \
    inline const RETURN_TYPE&amp; CLASS::FUNCTION() const {                   \
      return MEMBER;                                                      \
    }
  </code></pre>
  
  <p>This is how I would use it for a class template that contains an <code>int</code> called <code>int_</code>:</p>
  
  <pre><code>IMPLEMENT_ACCESSORS(template&lt;typename T&gt;, int, MyTemplate&lt;T&gt;, Int, int_)
  </code></pre>
  
  <p>For a non-template class, I don't need <code>template&lt;typename T&gt;</code>, so I omit that macro argument:</p>
  
  <pre><code>IMPLEMENT_ACCESORS(, int, MyClass, Int, int_)
  </code></pre>