Skip to content

G-API: Fix optional move constructor#19528

Merged
alalek merged 1 commit intoopencv:masterfrom
smirnov-alexey:as/gapi_optional_fix
Feb 15, 2021
Merged

G-API: Fix optional move constructor#19528
alalek merged 1 commit intoopencv:masterfrom
smirnov-alexey:as/gapi_optional_fix

Conversation

@smirnov-alexey
Copy link
Copy Markdown
Contributor

@smirnov-alexey smirnov-alexey commented Feb 14, 2021

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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
Xforce_builders_only=linux,docs
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

Xbuild_image:Custom=ubuntu-openvino-2021.1.0:20.04
build_image:Custom Win=openvino-2021.1.0
build_image:Custom Mac=openvino-2021.1.0

Xtest_modules:Custom=gapi
test_modules:Custom Win=gapi
test_modules:Custom Mac=gapi

Xbuildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
Xtest_opencl:Custom=OFF
Xtest_bigdata:Custom=1
Xtest_filter:Custom=*

@smirnov-alexey
Copy link
Copy Markdown
Contributor Author

Example:

cv::util::optional<std::unique_ptr<MyClass>> m_opt;
m_opt(std::move(std::unique_ptr<MyClass>(new MyClass(...))))

Didn't work before the fix

@smirnov-alexey
Copy link
Copy Markdown
Contributor Author

@dmatveev @TolyaTalamanov @rgarnov, please, take a look

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

You're right, cool! 👍

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

Example:

cv::util::optional<std::unique_ptr<MyClass>> m_opt;
m_opt(std::move(std::unique_ptr<MyClass>(new MyClass(...))))

Didn't work before the fix

Sorry for being so boring, but the std::move is redundant :)

@smirnov-alexey
Copy link
Copy Markdown
Contributor Author

@alalek can we merge this?

@alalek alalek merged commit 928d5ae into opencv:master Feb 15, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
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.

3 participants