-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Enable the latest C++ standard with Visual Studio #1287
Comments
Is it good style to set these flags from the project? Wouldn't this be something the user sets? |
In visual studio project I normally specify explicitly |
I'm not using MSVC myself, that's why I would like to discuss whether it is best practice to set such switches. |
What features are you looking to use, and how would you make sure that the library is still usable with only C++11? |
There are standard switch macros in the code ( |
I still have not understood why this library should set the C++ version when this is usually done by the code that actually uses the library. Do I miss something between CMake and MSVC? |
No: my idea here is using the latest supported C++ in MSVC even in tests: MSVC is not a major platform for you and in this way you will have less macros for VS (as it uses the latest standard what it could handle). |
I am already testing with these flags on AppVeyor. And if I would remove macros, wouldn't this break support for older MSVC versions? |
The flag is supported since Visual C++ 2015 Update 3. If older VS versions are supported in tests, it shouldn't be introduced. Otherwise it's safe to go. |
I still have not understood the benefit of enforcing this flag to projects using the library. FWIW, we use this AppVeyor configuration, where we additionally check |
Ok, nevermind. |
If the following flag would be added to MSVC part, the MSVC C++14 and C++17 features could be used in the code (including
std::string_view
and variadic templatestd::less
).I'm happy to write the code (opt-out as the latest VS runs properly with all tests passed).
The text was updated successfully, but these errors were encountered: