The question is quite clear I think. I\'m trying to write a compiler detection header to be able to include in the application information on which compiler was used and whi
I agree that the best choice is to use has feature macroses, not version macroses. Example with boost:
#include 
#if defined(BOOST_NO_CXX11_NOEXCEPT)
 #if defined(BOOST_MSVC)
  #define MY_NOEXCEPT throw()
 #else
  #define MY_NOEXCEPT
 #endif
#else
 #define MY_NOEXCEPT noexcept
#endif
void my_noexcept_function() MY_NOEXCEPT; // it's example, use BOOST_NOEXCEPT (:
 But anyway, if you need compiler version, you can use boost.predef:
#include 
#include 
int main() {
#if (BOOST_COMP_CLANG)
  std::cout << BOOST_COMP_CLANG_NAME << "-" << BOOST_COMP_CLANG << std::endl;
#else
  std::cout << "Unknown compiler" << std::endl;
#endif
  return 0;
}
  Output examples:
Clang-30400000
Clang-50000000