Skip to content

remove const from functions returning by value #22041

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 31, 2022

Conversation

nglee
Copy link
Contributor

@nglee nglee commented May 26, 2022

Removed const qualifier on by-value return type.

From Scott Meyer:

Declaring by-value function return values const will prevent their being bound to rvalue references in C++0x. Because rvalue references are designed to help improve the efficiency of C++ code, it's important to take into account the interaction of const return values and the initialization of rvalue references when specifying function signatures.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@asmorkalov asmorkalov requested review from rogday and removed request for asmorkalov May 27, 2022 05:54
@nglee
Copy link
Contributor Author

nglee commented May 28, 2022

Test failed with PermissionError: [WinError 5] Access is denied. Is there a chance that this could be an error in CI?

@nglee
Copy link
Contributor Author

nglee commented May 30, 2022

Test failed with PermissionError: [WinError 5] Access is denied. Is there a chance that this could be an error in CI?

Tests passed :)

Copy link
Member

@rogday rogday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@opencv-pushbot opencv-pushbot merged commit 9da9e82 into opencv:4.x May 31, 2022
@nglee nglee deleted the fix_return_by_const_value branch June 1, 2022 00:17
@alalek alalek mentioned this pull request Aug 21, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants