martinmoene / expected-lite

expected lite - Expected objects in C++11 and later in a single-file header-only library
Boost Software License 1.0
389 stars 35 forks source link

Use C++20 library feature tests #48

Closed purpleKarrot closed 3 days ago

purpleKarrot commented 2 years ago

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

striezel commented 3 days ago

Looks like this issue has been fixed in commit 34524d46e538f1e6ed114d8f8409f7cd173d96e6 / release 0.6.2, so this issue could be closed.

martinmoene commented 3 days ago

Thanks @striezel !