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 feature test macro instead of exact C++ version match #39

Merged
merged 1 commit into from
Apr 27, 2020
Merged

Use feature test macro instead of exact C++ version match #39

merged 1 commit into from
Apr 27, 2020

Conversation

davidstone
Copy link
Contributor

Resolves #38

@davidstone
Copy link
Contributor Author

I'm realizing the flaw in this code. The feature test macros are provided by two headers: their relevant header (optional for __cpp_lib_optional) and version. But version does not exist prior to C++20, and we are trying to use this test for much older versions of C++. __has_include could also be used for this purpose, but that is C++17 only. I guess, since you support older language standards, language version testing is probably good enough.

@davidstone
Copy link
Contributor Author

The version I have up now should correctly resolve the problem. I do not know what is causing the Visual Studio errors in the CI build.

@quicknir quicknir merged commit 7fb8445 into quicknir:master Apr 27, 2020
@quicknir
Copy link
Owner

@davidstone that was broken before, so not your fault (though i did miss it before, which is annoying :-( ). Thanks for your help! If you end up using this project and have any feedback, by all means. You can ping me in the cpp slack too, I think I've seen you there. Cheers.

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

Successfully merging this pull request may close these issues.

string_type is string_view for C++17 and const char * for C++20
2 participants