title: compile time windows version wishful thinking
body: <p>To show exactly what I would like to have, basically I have taken the code from <a href="https://docs.microsoft.com/en-us/windows/desktop/sysinfo/getting-the-system-version" rel="nofollow noreferrer">here</a> , and transformed it into wishful thinking as bellow:</p>
  
  <pre><code>int wmain( int argc, PCWSTR argv[] )
  {
      UNREFERENCED_PARAMETER(argc);
      UNREFERENCED_PARAMETER(argv);
  
      if constexpr (IsWindowsXPOrGreater())
      {
          printf("XPOrGreater\n");
      }
      else if constexpr (IsWindowsXPSP1OrGreater())
      {
          printf("XPSP1OrGreater\n");
      }
      else if constexpr (IsWindowsXPSP2OrGreater())
      {
          printf("XPSP2OrGreater\n");
      }
      else if constexpr (IsWindowsXPSP3OrGreater())
      {
          printf("XPSP3OrGreater\n");
      }
      else if constexpr (IsWindowsVistaOrGreater())
      {
          printf("VistaOrGreater\n");
      }
      else if constexpr (IsWindowsVistaSP1OrGreater())
      {
          printf("VistaSP1OrGreater\n");
      }
      else if constexpr (IsWindowsVistaSP2OrGreater())
      {
          printf("VistaSP2OrGreater\n");
      }
      else if constexpr (IsWindows7OrGreater())
      {
          printf("Windows7OrGreater\n");
      }
      else if constexpr (IsWindows7SP1OrGreater())
      {
          printf("Windows7SP1OrGreater\n");
      }
      else if constexpr (IsWindows8OrGreater())
      {
          printf("Windows8OrGreater\n");
      }
      else if constexpr (IsWindows8Point1OrGreater())
      {
          printf("Windows8Point1OrGreater\n");
      }
      else if constexpr (IsWindows10OrGreater())
      {
          printf("Windows10OrGreater\n");
      }
      else if constexpr (IsWindowsServer())
      {
          printf("Server\n");
      }
      else
      {
          printf("Client\n");
      }
  }
  </code></pre>
  
  <p>The aim is obviously to have standard C++ code, using <code>constexpr-if</code> with windows version compile time detection. It is all there in <code>VersionHelpers.h</code> but it is not compile time C++17.</p>
  
  <p>Functions from <code>VersionHelpers.h</code>, are not returning constexpr values. The question is if anyone has done such a thing? Or a different implementation to achieve the same? </p>