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 |
| hashtab.clear(); | ||
| hashtab.resize(HASH_SIZE0); | ||
| pool.clear(); | ||
| pool.resize(nodeSize); |
There was a problem hiding this comment.
It's not safe replacement. Pool elements cannot be used after it, but they could be before.
There was a problem hiding this comment.
Thank you for your point, GCC 13 + C++20 shows warning, so I append pragma to suppress it.
VadimLevin
left a comment
There was a problem hiding this comment.
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.