expected-lite icon indicating copy to clipboard operation
expected-lite copied to clipboard

Use C++20 library feature tests

Open purpleKarrot opened this issue 2 years ago • 0 comments

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

See the list of feature tests here: https://en.cppreference.com/w/cpp/feature_test

purpleKarrot avatar Jul 01 '22 05:07 purpleKarrot