CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
support C++20 standard #26590
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
support C++20 standard #26590
Conversation
- use constexpr instead of enum definition value - cast to calicurate mixing different enums - do not increment volatile variable - remove unused variable - use vector.reserve() instead of vector.resise() after vector.clear()
Thank you for your comment ! I fixed with ”+ENUM” method for enum arithmetic. There are some enum definitions to define const numerics. |
I'm sorry, I append to fix |
@@ -171,7 +171,7 @@ void SparseMat::Hdr::clear() | |||
hashtab.clear(); | |||
hashtab.resize(HASH_SIZE0); | |||
pool.clear(); | |||
pool.resize(nodeSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not safe replacement. Pool elements cannot be used after it, but they could be before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your point, GCC 13 + C++20 shows warning, so I append pragma to suppress it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my perspective using +
trick for suppressing enum
arithmetic is way too obscure.
Why not to use static_cast<*>
where it is required? It describes clearly describes intent.
I limited to use +enum trick for only combination difference enums. For arithmetic between enums and float/double. static_cast<>(enum) is used. |
@Kumataro Thanks a lot for the contribution! We have some issues with x86 linux host in CI. I'll merge the patch as soon as we fix the configuration. |
Support C++20 standard opencv#26590 Close opencv#26589 Related opencv/opencv_contrib#3842 Related: opencv#20269 - do not arithmetic enums and ( different enums or floating numeric) - remove unused variable ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Support C++20 standard opencv#26590 Close opencv#26589 Related opencv/opencv_contrib#3842 Related: opencv#20269 - do not arithmetic enums and ( different enums or floating numeric) - remove unused variable ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
Close #26589
Related opencv/opencv_contrib#3842
Related: #20269
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.