Skip to content

Instantly share code, notes, and snippets.

@dibayendu
Created April 5, 2017 10:21
Show Gist options
  • Save dibayendu/06b5e8460bcba4c6e04e010efdea2ad6 to your computer and use it in GitHub Desktop.
Save dibayendu/06b5e8460bcba4c6e04e010efdea2ad6 to your computer and use it in GitHub Desktop.
Determines the version or standard of C++ compiler
#include <iostream>
int main(){
#if __cplusplus==201402L
std::cout << "C++14" << std::endl;
#elif __cplusplus==201103L
std::cout << "C++11" << std::endl;
#elif __cplusplus==199711L
std::cout << "C++07" << std::endl;
#else
std::cout << "No idea what standard of C++ it is!" << std::endl;
#endif
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment