Comment by stabbles
3 months ago
Yeah, developers should specify what language and dialect a project is written in. In practice though, support for that in build systems is cumbersome.
For example in CMake the natural variable is CMAKE_CXX_STANDARD, but it's implemented backwards: if you set it to 14 but your compiler supports only C++11, they'll add -std=gnu++11. You have to also set CMAKE_CXX_STANDARD_REQUIRED to ON, which not man projects do. I don't think there's an easy way to say "this project requires C++14 or higher".
There is - you simply build your code with -std=c++XY, and if your toolchain doesn't support it (which one btw doesn't support at least c++17?), it will simply error out, no? That should be a pretty strong signal that your code requires XY standard without having to go into the CMake territory. Even if you want to, I see nothing wrong with the way they are implemented. Two simple variables doing two simple things.