Repository navigation
Make <array> #ifdef true for MSVC - #10589
Merged
Merged
Conversation
Member
|
Looks good. |
Contributor
|
we are moving towards enabling C++ 11, and so because there are no updates to fix the warnings, let's close it for now |
I think MSVC had `std::array` for quite a while (possibly going back as far as VS 2012, but it's definitely there in 2015 and 2017. So I think `_MSC_VER` `1900` is a safe bet. Probably `1800` and maybe even `1700` could work as well but I can't test that locally.
alalek
approved these changes
Feb 17, 2018
|
So... this broke C consumers. The check used to be "if using C++ ≥ C++11". This changed it to "if (using C++ ≥ C++11) or (using MSVC ≥ VS2015)". The problem is, that second check doesn't actually check that you're using C++, and so breaks C consumers of OpenCV (when compiled with MSVC). |
SavyaSanchi-Sharma
pushed a commit
to SavyaSanchi-Sharma/opencv
that referenced
this pull request
Jul 30, 2026
* Make <array> #ifdef true for MSVC I think MSVC had `std::array` for quite a while (possibly going back as far as VS 2012, but it's definitely there in 2015 and 2017. So I think `_MSC_VER` `1900` is a safe bet. Probably `1800` and maybe even `1700` could work as well but I can't test that locally. * fix test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think MSVC had
std::arrayfor quite a while (possibly going back as far as VS 2012, but it's definitely there in 2015 and 2017. So I think_MSC_VER1900is a safe bet. Probably1800and maybe even1700could work as well but I can't test that locally.