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

Don't test for C++version, test for features #1

Open
mapron opened this issue Jul 31, 2022 · 2 comments
Open

Don't test for C++version, test for features #1

mapron opened this issue Jul 31, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@mapron
Copy link

mapron commented Jul 31, 2022

#if !(defined(_MSC_VER) && _MSC_VER >= 1910 && ((defined(_MSVC_LANG) && _MSVC_LANG > 201402)) || (__cplusplus > 201402))
#error "Library SUTFCPP requires a compiler that supports C++ 17!"
#endif

I found such a check in your code.
I think it's much better to check for library feature macros and compiler feature macros for what you exactly used.

I had a lot of problems in my past, checking for __cplusplus and then having issues in Linux, when compiler and STL version are not in sync (imagine using clang 10 with libstdc++6 for example).

@devatrun devatrun added the enhancement New feature or request label Aug 2, 2022
@devatrun
Copy link
Owner

devatrun commented Aug 3, 2022

Completely agree with your comment. I also encountered this problem on Linux. Actually this guard was made only from the reason of complication. However, we have another problem, how to keep track of these flexible settings when the library changed.
I will take this into account and i will think about this problem.

@mapron
Copy link
Author

mapron commented Aug 3, 2022

About problem 'how to track' - yeah. If you don't used to tracking feature test macros and stuff, it is hard. But that thing make things way more portable. Bad things also can happen even if you a large company - google/googletest#3659

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

No branches or pull requests

2 participants