title: GNU C++ how to check when -std=c++0x is in effect?
body: <p>My system compiler (gcc42) works fine with the TR1 features that I want, but trying to support newer compiler versions other than the systems, trying to accessing TR1 headers an #error demanding the -std=c++0x option because of how it interfaces with library or some hub bub like that.</p>
  
  <pre><code>/usr/local/lib/gcc45/include/c++/bits/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
  </code></pre>
  
  <p>Having to supply an extra switch is no problem, to support GCC 4.4 and 4.5 under this system (FreeBSD), but obviously it changes the picture!</p>
  
  <p>Using my system compiler (g++ 4.2 default dialect):</p>
  
  <pre><code>#include &lt;tr1/foo&gt;
  using std::tr1::foo;
  </code></pre>
  
  <p>Using newer (4.5) versions of the compiler with -std=c++0x:</p>
  
  <pre><code>#include &lt;foo&gt;
  using std::foo;
  </code></pre>
  
  <p>Is there anyway using the pre processor, that I can tell if g++ is running with C++0x features enabled?</p>
  
  <p><strong>Something like this is what I'm looking for</strong>:</p>
  
  <pre><code>#ifdef __CXX0X_MODE__
  #endif
  </code></pre>
  
  <p>but I have not found anything in the manual or off the web.</p>
  
  <p>At this rate, I'm starting to think that life would just be easier,  to use Boost as a dependency, and not worry about a new language standard arriving before TR4... hehe.</p>