The following code breaks when it is compiled with a C++20 capable compiler without using a C++20 capable standard library:
#if nsel_CPP20_OR_GREATER
using std::remove_cvref;
#else
Please don't assume that C++20 library features are available depending on the language standard that was selected with -std=.
Instead, check for each feature individually, as in
#if defined(__cpp_lib_remove_cvref)
using std::remove_cvref;
#else
The following code breaks when it is compiled with a C++20 capable compiler without using a C++20 capable standard library:
Please don't assume that C++20 library features are available depending on the language standard that was selected with
-std=
. Instead, check for each feature individually, as inSee the list of feature tests here: https://en.cppreference.com/w/cpp/feature_test