InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

COMP: Use default copy, move for construc, assign `RealTimeStamp` #4626

Closed jhlegarreta closed 2 months ago

jhlegarreta commented 2 months ago

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

PR Checklist

jhlegarreta commented 2 months ago

@seanm Hopefully this will remove some of the 199 warnings on RogueResearch22.

dzenanz commented 2 months ago

Perhaps the constructor needs to be removed and explicitly or implicitly defaulted?