From 2558ea1f13ad71e69be18bf5c34cd795ec820e3c Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 8 May 2024 19:25:57 +0200 Subject: [PATCH] STYLE: Use ITK_DEFAULT_COPY_AND_MOVE for exceptions of Image and Mesh IO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to pull request https://github.com/InsightSoftwareConsortium/ITK/pull/4639 commit d1ebdfaff661227e8425b2439696dea8d267b74f "COMP: Fix implicit copy constructor definition deprecation warnings" by Jon Haitz Legarreta GorroƱo --- .../IO/ImageBase/include/itkImageFileReaderException.h | 9 ++------- Modules/IO/ImageBase/include/itkImageFileWriter.h | 9 ++------- Modules/IO/MeshBase/include/itkMeshFileReaderException.h | 9 ++------- Modules/IO/MeshBase/include/itkMeshFileWriterException.h | 9 ++------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/Modules/IO/ImageBase/include/itkImageFileReaderException.h b/Modules/IO/ImageBase/include/itkImageFileReaderException.h index 5855b387ea8b..2ee6c399f796 100644 --- a/Modules/IO/ImageBase/include/itkImageFileReaderException.h +++ b/Modules/IO/ImageBase/include/itkImageFileReaderException.h @@ -31,6 +31,8 @@ namespace itk class ITKIOImageBase_EXPORT ImageFileReaderException : public ExceptionObject { public: + ITK_DEFAULT_COPY_AND_MOVE(ImageFileReaderException); + /** \see LightObject::GetNameOfClass() */ itkOverrideGetNameOfClassMacro(ImageFileReaderException); @@ -52,13 +54,6 @@ class ITKIOImageBase_EXPORT ImageFileReaderException : public ExceptionObject /** Has to have empty throw(). */ ~ImageFileReaderException() noexcept override; - - ImageFileReaderException(const ImageFileReaderException &) = default; - ImageFileReaderException(ImageFileReaderException &&) = default; - ImageFileReaderException & - operator=(const ImageFileReaderException &) = default; - ImageFileReaderException & - operator=(ImageFileReaderException &&) = default; }; } // namespace itk #endif // itkImageFileReaderException_h diff --git a/Modules/IO/ImageBase/include/itkImageFileWriter.h b/Modules/IO/ImageBase/include/itkImageFileWriter.h index 7cecf9ca096d..25630480c2c8 100644 --- a/Modules/IO/ImageBase/include/itkImageFileWriter.h +++ b/Modules/IO/ImageBase/include/itkImageFileWriter.h @@ -34,6 +34,8 @@ namespace itk class ITKIOImageBase_EXPORT ImageFileWriterException : public ExceptionObject { public: + ITK_DEFAULT_COPY_AND_MOVE(ImageFileWriterException); + /** \see LightObject::GetNameOfClass() */ itkOverrideGetNameOfClassMacro(ImageFileWriterException); @@ -55,13 +57,6 @@ class ITKIOImageBase_EXPORT ImageFileWriterException : public ExceptionObject /** Has to have empty throw(). */ ~ImageFileWriterException() noexcept override; - - ImageFileWriterException(const ImageFileWriterException &) = default; - ImageFileWriterException(ImageFileWriterException &&) = default; - ImageFileWriterException & - operator=(const ImageFileWriterException &) = default; - ImageFileWriterException & - operator=(ImageFileWriterException &&) = default; }; /** \class ImageFileWriter diff --git a/Modules/IO/MeshBase/include/itkMeshFileReaderException.h b/Modules/IO/MeshBase/include/itkMeshFileReaderException.h index 64c6eaaf3841..b823c3e1dfe6 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileReaderException.h +++ b/Modules/IO/MeshBase/include/itkMeshFileReaderException.h @@ -32,6 +32,8 @@ namespace itk class ITKIOMeshBase_EXPORT MeshFileReaderException : public ExceptionObject { public: + ITK_DEFAULT_COPY_AND_MOVE(MeshFileReaderException); + /** Has to have empty throw(). */ ~MeshFileReaderException() noexcept override; @@ -49,13 +51,6 @@ class ITKIOMeshBase_EXPORT MeshFileReaderException : public ExceptionObject unsigned int line, const char * message = "Error in IO", const char * loc = "Unknown"); - - MeshFileReaderException(const MeshFileReaderException &) = default; - MeshFileReaderException(MeshFileReaderException &&) = default; - MeshFileReaderException & - operator=(const MeshFileReaderException &) = default; - MeshFileReaderException & - operator=(MeshFileReaderException &&) = default; }; } // end namespace itk diff --git a/Modules/IO/MeshBase/include/itkMeshFileWriterException.h b/Modules/IO/MeshBase/include/itkMeshFileWriterException.h index bba41cdf8d50..138184f5945b 100644 --- a/Modules/IO/MeshBase/include/itkMeshFileWriterException.h +++ b/Modules/IO/MeshBase/include/itkMeshFileWriterException.h @@ -32,6 +32,8 @@ namespace itk class ITKIOMeshBase_EXPORT MeshFileWriterException : public ExceptionObject { public: + ITK_DEFAULT_COPY_AND_MOVE(MeshFileWriterException); + /** Has to have empty throw(). */ ~MeshFileWriterException() noexcept override; @@ -49,13 +51,6 @@ class ITKIOMeshBase_EXPORT MeshFileWriterException : public ExceptionObject unsigned int line, const char * message = "Error in IO", const char * loc = "Unknown"); - - MeshFileWriterException(const MeshFileWriterException &) = default; - MeshFileWriterException(MeshFileWriterException &&) = default; - MeshFileWriterException & - operator=(const MeshFileWriterException &) = default; - MeshFileWriterException & - operator=(MeshFileWriterException &&) = default; }; } // end namespace itk