How can I inquire whether the compiler can handle / is set up to use C++20? I know that it is in principle possible to inquire the C++ version by:
#if __cplusplus > ??? // C++20 code here #endif
??? be for C++20?
It's too early for that.
Until the standard replaces it, use:
#if __cplusplus > 201703L // C++20 code #endif
since the predefined macro of C++20 is going to be larger than the one of C++17.
cpp.predefined specifies (emphasis mine):
The integer literal
201703L. [Note: It is intended that future versions of this International Standard will replace the value of this macro with a greater value.]
In Nov 2018, the macros used are: