Skip to content

remove const from functions returning by value#22041

Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom
nglee:fix_return_by_const_value
May 31, 2022
Merged

remove const from functions returning by value#22041
opencv-pushbot merged 1 commit intoopencv:4.xfrom
nglee:fix_return_by_const_value

Conversation

@nglee
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants