-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
COMP: Use default copy and move construct and assign in itk::Region
#4627
COMP: Use default copy and move construct and assign in itk::Region
#4627
Conversation
@seanm Hopefully this will remove some of the 199 warnings on RogueResearch22. |
Cool, thanks! I defer to C++ experts on the correctness of this change, but seems reasonable to me! |
I'm sorry I think
It's a bit cumbersome, but I guess the warnings will go away by adding four of those "explicitly defaulted" member functions to the public section:
|
43ad378
to
7eba4b2
Compare
#4627 (comment) 👍 Done. Thanks Niels. |
7eba4b2
to
40830f7
Compare
ITK_DISALLOW_COPY_AND_MOVE
in itk::Region
itk::Region
Use the compiler-proved default implementations for `itk::Region` copy constructor, copy assignment, move constructor, and move assignment functions. As noted in [1], the C++ standard deprecated the implicit generation of copy and assignment operators. Fixes: ``` [CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkRegion.h:91:11: warning: definition of implicit copy assignment operator for 'Region' is deprecated because it has a user-declared destructor [-Wdeprecated] virtual ~Region() = default; ^ [CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkImageIORegion.h:117:30: note: in implicit copy assignment operator for 'itk::Region' first required here operator=(Self &&) = default; ^ [CTest: warning matched] /Users/builder/externalModules/IO/ImageBase/include/itkImageIOBase.h:228:3: note: in implicit move assignment operator for 'itk::ImageIORegion' first required here itkSetMacro(IORegion, ImageIORegion); ^ [CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkMacro.h:992:22: note: expanded from macro 'itkSetMacro' this->m_##name = std::move(_arg); \ ^ ``` And other similar warnings stemming from `itk::Region` that have been appearing consistently in some macOS site builds in the dashboard: https://open.cdash.org/viewBuildError.php?type=1&buildid=9579479 [1] https://learn.microsoft.com/bs-latn-ba/cpp/error-messages/compiler-warnings/c5267?view=msvc-150#remarks
40830f7
to
ec2677f
Compare
/azp run ITK.Windows |
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.
Does it indeed fix the warnings? I guess so, but you never know... anyway, approved, of course. 👍 Thanks Jon!
776e1dc
into
InsightSoftwareConsortium:master
Instead of "manually" defaulting their copy and move member functions. Follow-up to two commits by Jon Haitz Legarreta Gorroño: pull request InsightSoftwareConsortium#4626 commit 9aff210 "COMP: Use default copy, move for construc, assign `RealTimeStamp`" pull request InsightSoftwareConsortium#4627 commit ec2677f "COMP: Use `default` copy and move construct and assign in `itk::Region`"
Instead of "manually" defaulting their copy and move member functions. Follow-up to two commits by Jon Haitz Legarreta Gorroño: pull request InsightSoftwareConsortium#4626 commit 9aff210 "COMP: Use default copy, move for construc, assign `RealTimeStamp`" pull request InsightSoftwareConsortium#4627 commit ec2677f "COMP: Use `default` copy and move construct and assign in `itk::Region`"
Instead of "manually" defaulting their copy and move member functions. Follow-up to two commits by Jon Haitz Legarreta Gorroño: pull request #4626 commit 9aff210 "COMP: Use default copy, move for construc, assign `RealTimeStamp`" pull request #4627 commit ec2677f "COMP: Use `default` copy and move construct and assign in `itk::Region`"
Use the compiler-proved default implementations for
itk::Region
copy constructor, copy assignment, move constructor, and move assignment functions.As noted in [1], the C++ standard deprecated the implicit generation of copy and assignment operators.
Fixes:
And other similar warnings stemming from
itk::Region
that have been appearing consistently in some macOS site builds in the dashboard: https://open.cdash.org/viewBuildError.php?type=1&buildid=9579479[1] https://learn.microsoft.com/bs-latn-ba/cpp/error-messages/compiler-warnings/c5267?view=msvc-150#remarks
PR Checklist