Defining a top-level no-op in C++?
<p>Is the following legal according to the C++ standard?  (If the answer differs from standard to standard, I would like to know that, too.)</p>

<pre><code>#define VERY_OLD_COMPILER 1

#ifdef VERY_OLD_COMPILER
#define USING_NAMESPACE_STD enum { }
#else
#define USING_NAMESPACE_STD using namespace std
#endif

USING_NAMESPACE_STD;

int main(int argc, char *argv[]) {
// etc.
</code></pre>

<p>The goal is to define a macro that I can invoke at the top-level <em>and follow with a semicolon</em>, such that it has no effect.  I am pretty sure stray semicolons at the top-level are not allowed (GCC complains about them, anyway), so simply defining an empty macro does not work.</p>

<p>Declaring an empty anonymous struct does not work because it needs a name, and I do not want to pollute the namespace.</p>

<p>Does an anonymous empty enum declaration (<code>enum { }</code>) do the trick?  It works on all of the compilers I have tried, but of course that is not the same thing as being permitted by the spec.</p>

<p>Any other ideas/comments welcome.  Well, anything other than "throw out that compiler".  Believe me, I would love to.</p>
