title: How do I test the version of libstdc++, not GCC, at compile time?
body: <p>I am trying to test the version of <code>libstdc++</code> because <a href="https://stackoverflow.com/a/12665408"><code>std::regex</code> is implemented, but largely broken,</a> in the versions of <code>libstdc++</code> distributed with GCC before version 4.9.0.</p>
  
  <p>Note that:</p>
  
  <ul>
  <li><p>I need to test the version of <strong><code>libstdc++</code>, not GCC</strong> because Clang also supports using <code>libstdc++</code> as the standard library. This rules out <a href="https://stackoverflow.com/a/21398203/111426">testing the <code>__GNUC_PATCHLEVEL__</code>, <code>__GNUC__</code>, and <code>__GNUC_MINOR__</code> macros</a>.</p></li>
  <li><p>The <code>__GLIBCXX__</code> macro <strong>is a date, not a version number</strong> and <a href="https://stackoverflow.com/questions/21622561/how-to-detect-the-libstdc-version-in-clang#comment41077776_21622871">does not increase monotonically</a>. For example, GCC 4.8.4 ships with <code>#define __GLIBCXX__ 20150426</code>, which is newer than the release date of GCC 4.9.0.</p></li>
  </ul>
  
  <p>Is there any portable way to test the version of <code>libstdc++</code> that does not depend on using GCC my compiler?</p>