title: How can I know if my compiler support XXXX C++11 feature?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5047971/how-do-i-check-for-c11-support">How do I check for C++11 support?</a>  </p>
  </blockquote>
  
  
  
  <p>I am writing a small library and I would like to use class enums whenever the compiler supports them. I also want to use other C++11 features, such as <code>final</code> and <code>override</code> keywords.</p>
  
  <p>So far, I have used tricks to make sure it compiled on all versions of GCC, but I when I booted my Windows partition, Visual Studio 2010 started complaining too. Here is an example of the tricks I used:</p>
  
  <pre><code>#if __GNUC__ == 4 &amp;&amp; (__GNUC_MINOR__ &gt; 7 || \
        (__GNUC_MINOR__ == 7 &amp;&amp; __GNUC_PATCHLEVEL__ &gt; 1))
  #   define TATO_OVERRIDE override
  #   define TATO_NO_THROW nothrow
  #else
  #   define TATO_OVERRIDE
  #   define TATO_NO_THROW throw()
  #endif
  </code></pre>
  
  <p>I know that the newest version of Visual Studio already supports a batch of new features too. What I would like to have, is something like a set of macro which tells me what features are available on the compiler I am using. </p>
  
  <pre><code>#ifdef THIS_COMPILER_SUPPORTS_CLASS_ENUMS
    ...
  #endif
  </code></pre>
  
  <p>Does this exist? Is there a library that does that?</p>
  
  <hr>
  
  <blockquote>
    <p>The compiler’s documentation? </p>
  </blockquote>
  
  <p>Let me clarify. I know how to find those information, my problem is elsewhere. I don’t want to go through every possible compiler’s documentation to gather those information, especially since the same compiler might support different features with respect to its version. This is what I have been doing so far, and what I am looking for is actually a way not to do that. </p>