Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use C++20 library feature tests #48

Open
purpleKarrot opened this issue Jul 1, 2022 · 0 comments
Open

Use C++20 library feature tests #48

purpleKarrot opened this issue Jul 1, 2022 · 0 comments

Comments

@purpleKarrot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant