MS claim to support is_consant_evaluated on their conformance page and their <type_traits> header does include an implementation, guarded with #if _HAS_CXX20.
It seems though that (with MSVC Community 16.6.5, at least) /std:c++latest does not cause _HAS_CXX20 to be defined. The UI does not offer a /std:c++20 option.
e.g.
#include <type_traits>
static_assert( std::is_constant_evaluated(), "" );
#ifdef _HAS_CXX20
static_assert(false, "");
#endif
gives the following output:
1>ConsoleApplication7.cpp
1>ConsoleApplication7.cpp(3,21): error C2039: 'is_constant_evaluated': is not a member of 'std'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\type_traits(20): message : see declaration of 'std'
1>ConsoleApplication7.cpp(3,42): error C3861: 'is_constant_evaluated': identifier not found
1>ConsoleApplication7.cpp(5,15): error C2338:
1>Done building project "ConsoleApplication7.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Note that the use of is_constant_evauluated produces an error, and that the static_assert does not.
What am I missing?
