I need to compile some small cpp files so I'd like to do that through the terminal. I'm using Catalina 10.15.5. I found out that macOS has a built-in clang compiler and I can use commands like
g++. It's version:
Apple clang version 11.0.3 (clang-122.214.171.124) Target: x86_64-apple-darwin19.5.0 Thread model: posix
But I need to know which c++ version it uses (e.g. c++17, c++11 or even less version). It's really important for my files.
I know I can specify the version like
c++ --std=gnu++17 but the question is how to make the compiler to use it by default (without aliases, there must be a command to change it). Or at least how to find out which version does it use right now?