COMP: Use default copy, move for construc, assign RealTimeStamp#4626
Merged
jhlegarreta merged 1 commit intoInsightSoftwareConsortium:masterfrom May 2, 2024
Conversation
Member
Author
|
@seanm Hopefully this will remove some of the 199 warnings on RogueResearch22. |
Member
|
Perhaps the constructor needs to be removed and explicitly or implicitly defaulted? |
9cf3a4c to
e4658ec
Compare
ITK_DISALLOW_COPY_AND_MOVE in itk::RealTimeStampRealTimeStamp
831dec1 to
47a4d27
Compare
Use the compiler-proved default implementations for `itk::RealTimeStamp`
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/itkRealTimeStamp.h:56:3:
warning: definition of implicit copy assignment operator for 'RealTimeStamp' is deprecated because it has a user-declared destructor [-Wdeprecated]
~RealTimeStamp();
^
[CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkDataObject.h:452:3:
note: in implicit copy assignment operator for 'itk::RealTimeStamp' first required here
itkSetMacro(RealTimeStamp, RealTimeStamp);
^
[CTest: warning matched] /Users/builder/externalModules/Core/Common/include/itkMacro.h:992:22:
note: expanded from macro 'itkSetMacro'
this->m_##name = std::move(_arg); \
^
[CTest: warning suppressed] 1 warning generated.
```
And other similar warnings stemming from `itk::RealTimeStamp` 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
47a4d27 to
9aff210
Compare
N-Dekker
approved these changes
May 1, 2024
Contributor
N-Dekker
left a comment
There was a problem hiding this comment.
the C++ standard deprecated the implicit generation of copy and assignment operators.
Just for the sake of completeness, in general, the "rule of zero" is still allowed (even though it assumes implicit generation of copy and assignment operators). But when following the rule of zero, the destructor should also be "implicit".
Thanks Jon, approved 👍
dzenanz
reviewed
May 1, 2024
thewtex
approved these changes
May 1, 2024
This was referenced May 2, 2024
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
May 8, 2024
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`"
N-Dekker
added a commit
to N-Dekker/ITK
that referenced
this pull request
May 13, 2024
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`"
hjmjohnson
pushed a commit
that referenced
this pull request
May 15, 2024
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`"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the compiler-proved default implementations for
itk::RealTimeStampcopy 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::RealTimeStampthat 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