Find out which C++ standard is supported by g++.
05 Jan 2024I’m fiddling around with some stuff in Docker, and need the c++ compiler to support C++14. How to check? Run
g++ -dM -E -x c++ /dev/null | grep -F __cplusplus
Example from my docker container – so this version of g++ supports the C++17 standard. Relevant StackOverflow post.
# g++ -dM -E -x c++ /dev/null | grep -F __cplusplus
#define __cplusplus 201703L
root@d804ccfaefc5:/# exit