I can set CMAKE_CXX_STANDARD to 17 to get /std:c++17, but I can't set it to latest, can I? I guess I can just brute-force it with
if (MSVC)
add_compiler_options(/std:c++latest)
endif()
of course, but is there an idiomatic way to get /std:c++latest, maybe even toolchain-agnostic?
EDIT Why would anybody want this? Unlike Clang and GCC, MSVC doesn't seem to define /std:c++2a to enable post-C++17 features. It simply uses /std:c++latest for that. If I'm building a code base with a set of known compilers, I know which C++20 features I can use, but I need to tell the build system to enable everything each compiler is capable of.