Fix compilation when forcing later C++.#24194
Merged
opencv-alalek merged 3 commits intoopencv:4.xfrom Aug 27, 2023
Merged
Conversation
Contributor
Author
|
The CI on OSX failed because of this: https://github.com/opencv/opencv/actions/runs/5964752904/job/16180691776?pr=24193 |
mshabunin
reviewed
Aug 24, 2023
| const float border_width = 2.0; | ||
|
|
||
| void randomShuffle(std::string& info) { | ||
| #if defined CV_CXX11 |
Contributor
There was a problem hiding this comment.
I thought we are going to remove CV_CXX11 completely, see #23736
cc @asmorkalov , @opencv-alalek , @vpisarev
Contributor
Author
There was a problem hiding this comment.
Indeed. Plus, OpenCV 4.x is C++11 so we can just use std::shuffle by default.
mshabunin
approved these changes
Aug 25, 2023
Contributor
mshabunin
left a comment
There was a problem hiding this comment.
Reproduced with libstdc++ (warning) and libc++ (error) and clang 17 (CMAKE_CXX_STANDARD=17):
/opencv/modules/objdetect/test/test_qrcode_encode.cpp:267:22: warning: 'random_shuffle<__gnu_cxx::__normal_iterator<char *, std::basic_string<char>>>' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
267 | std::random_shuffle(input_info.begin(),input_info.end());
| ^
/opencv/modules/objdetect/test/test_qrcode_encode.cpp:267:22: error: no member named 'random_shuffle' in namespace 'std'
267 | std::random_shuffle(input_info.begin(),input_info.end());
| ~~~~~^
No issues after fix.
This was referenced Sep 5, 2023
Merged
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
Jan 4, 2024
* Fix compilation when forcing later C++. * Remove random_shuffle. * Remove random_shuffle.
thewoz
pushed a commit
to thewoz/opencv
that referenced
this pull request
May 29, 2024
* Fix compilation when forcing later C++. * Remove random_shuffle. * Remove random_shuffle.
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.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request